Simulate Linux disk partitions have free space available inodes times wrong problem

Source: Internet
Author: User
Tags config create directory mkdir touch linux

1. Create a test script:

[Oracle@ocm1 ~]$ VI touchfile.sh

#!/bin/bash

For ABC in {1..9}

Todo

touch/boot/test/$ABC

Done

"Touchfile.sh" 5L, 66C written

2. Create test directories, test scripts

[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

This column more highlights: http://www.bianceng.cnhttp://www.bianceng.cn/OS/Linux/

/dev/sda3 7318528 185460 7133068 3%/

/DEV/SDA1 26104 26054 1%/boot

TMPFS 128334 1 128333 1%/DEV/SHM

4. Modify the script, directly use Inodes

[Root@ocm1 boot]# cd/home/oracle/

[Root@ocm1 oracle]# VI touchfile.sh

#!/bin/bash

For ABC in {10..26110}

Todo

touch/boot/test/$ABC

Done

~

"Touchfile.sh" 5L, 71C written

5. Execute the script, the script is not finished, that is, error: No space left on device,

In fact at this time with DF-H can see the directory there is free space, but because there is no inodes, can not create a new file, the error is: No spaces left on device

[ROOT@OCM1 oracle]# SH touchfile.sh

[ROOT@OCM1 oracle]# SH touchfile.sh

Touch:cannot Touch '/boot/test/26064 ': No spaces left on device

Touch:cannot Touch '/boot/test/26065 ': No spaces left on device

......................................................

Touch:cannot Touch '/boot/test/26109 ': No spaces left on device

Touch:cannot Touch '/boot/test/26110 ': No spaces left on device

[Root@ocm1 oracle]# Df-h

FileSystem Size Used Avail use% mounted on

/dev/sda3 28G 11G 15G 43%/

/DEV/SDA1 99M 21M 73M 23%/boot

Tmpfs 502M 0 502M 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

Manual execution of the Create directory and File command reported the same error:

[Root@ocm1 oracle]# cd/boot/

[Root@ocm1 boot]# mkdir A

Mkdir:cannot Create directory ' a ': No spaces left on device

[ROOT@OCM1 boot]# Touch ABC

Touch:cannot Touch ' abc ': No spaces 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.