When a disk partition in a simulated LINUX has free space and no Inodes is available, the error "Nospaceleftondevice" is returned.

Source: Internet
Author: User

Reference: Disk File System
1. Create a test script:

[Oracle @ ocm1 ~] $ Vi touchfile. sh

#! /Bin/bash
For abc in {1 .. 9}
Do
Touch/boot/test/$ abc
Done
"Touchfile. sh" 5L, 66C written
2. Create a test directory and test script [root @ ocm1 oracle] # cd/boot
[Root @ ocm1 boot] # mkdir test
[Root @ ocm1 boot] # ls
Config-2.6.18-308.el5 symvers-2.6.32-300.10.1.el5uek.gz
Config-2.6.32-300.10.1.el5uek System. map-2.6.18-308.el5
Grub System. map-2.6.32-300.10.1.el5uek
Initrd-2.6.18-308.el5.img test
Initrd-2.6.32-300.10.1.el5uek.img vmlinuz-2.6.18-308.el5
Lost + found vmlinuz-2.6.32-300.10.1.el5uek
Symvers-2.6.18-308.el5.gz
[Root @ ocm1 boot] # cd-
/Home/oracle
[Root @ ocm1 oracle] # sh touchfile. sh
[Root @ ocm1 oracle] # cd-
/Boot
[Root @ ocm1 boot] # cd test
[Root @ ocm1 test] # ls
1 2 3 4 5 6 7 8 9
3. view the number of Inodes available in the current/boot directory [root @ ocm1 test] # df-I
Filesystem Inodes IUsed IFree IUse % Mounted on
/Dev/sda3 7318528 185460 7133068 3%/
/Dev/sda1 26104 5026054 1%/boot
Tmpfs 128334 1 128333 1%/dev/shm
4. Modify the script to directly use Inodes [root @ ocm1 boot] # cd/home/oracle/
[Root @ ocm1 oracle] # vi touchfile. sh
#! /Bin/bash
For abc in {10 .. 26110}
Do
Touch/boot/test/$ abc
Done
~
"Touchfile. sh" 5L, 71C written
5. Run the script. If the script is not completed, the error "No space left on device" is returned,

In fact, df-h can be used to view the available space in the directory. However, because No Inodes exists, you cannot create a new file. The error is: No space left on device.

[Root @ ocm1 oracle] # sh touchfile. sh
[Root @ ocm1 oracle] # sh touchfile. sh
Touch: cannot touch '/boot/test/100': No space left on device
Touch: cannot touch '/boot/test/100': No space left on device
......................................................
Touch: cannot touch '/boot/test/100': No space left on device
Touch: cannot touch '/boot/test/100': No space left on device
[Root @ ocm1 oracle] # Df-h
Filesystem Size Used Avail Use % Mounted on
/Dev/sda3 28G 11G 15G 43%/
/Dev/sda1 99 MB 21 M 73 M 23%/boot
Tmpfs 502 M 0 502 M 0%/dev/shm
[Root @ ocm1 oracle] # df-I
Filesystem Inodes IUsed IFree IUse % Mounted on
/Dev/sda3 7318528 185460 7133068 3%/
/Dev/sda1 26104 26104 0 100%/boot
Tmpfs 128334 1 128333 1%/dev/shm
The same error is reported when you manually execute the create directory and file command:
[Root @ ocm1 oracle] # cd/boot/
[Root @ ocm1 boot] # mkdir
Mkdir: cannot create directory 'A': No space left on device
[Root @ ocm1 boot] # touch abc
Touch: cannot touch 'abc': No space left on device

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.