模拟LINUX磁盘分区有可用空间无可用Inodes时报错:No space left

参考:磁盘文件系统1.创建测试脚本:

[oracle@ocm1 ~]$ vi touchfile.sh

#!/bin/bashfor abc in {1..9}do touch /boot/test/$abcdone"touchfile.sh" 5L, 66C written 2.创建测试目录、测试脚本[root@ocm1 oracle]# cd /boot[root@ocm1 boot]# mkdir test[root@ocm1 boot]# lsconfig-2.6.18-308.el5 symvers-2.6.32-300.10.1.el5uek.gzconfig-2.6.32-300.10.1.el5uek System.map-2.6.18-308.el5grub System.map-2.6.32-300.10.1.el5uekinitrd-2.6.18-308.el5.img testinitrd-2.6.32-300.10.1.el5uek.img vmlinuz-2.6.18-308.el5lost+found vmlinuz-2.6.32-300.10.1.el5ueksymvers-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]# ls1 2 3 4 5 6 7 8 93.查看当前/boot目录可用Inodes数量[root@ocm1 test]# df -iFilesystem Inodes IUsed IFree IUse% Mounted on/dev/sda3 7318528 185460 7133068 3% //dev/sda1 26104 50 26054 1% /boottmpfs 128334 1 128333 1% /dev/shm4.修改脚本,直接将可用Inodes用光[root@ocm1 boot]# cd /home/oracle/[root@ocm1 oracle]# vi touchfile.sh #!/bin/bashfor abc in {10..26110}do touch /boot/test/$abcdone~"touchfile.sh" 5L, 71C written5.执行脚本,脚本未执行完,即报错:No space left on device,

事实上此时用df -h可以看到目录下有可用空间,可是因为没有Inodes,已经无法新建文件了,报错为:No space left on device

[root@ocm1 oracle]# sh touchfile.sh [root@ocm1 oracle]# sh touchfile.sh touch: cannot touch `/boot/test/26064′: No space left on devicetouch: cannot touch `/boot/test/26065′: No space left on device………………………………………………touch: cannot touch `/boot/test/26109′: No space left on devicetouch: cannot touch `/boot/test/26110′: No space left on device[root@ocm1 oracle]# df -hFilesystem Size Used Avail Use% Mounted on/dev/sda3 28G 11G 15G 43% //dev/sda1 99M 21M 73M 23% /boottmpfs 502M 0 502M 0% /dev/shm[root@ocm1 oracle]# df -iFilesystem Inodes IUsed IFree IUse% Mounted on/dev/sda3 7318528 185460 7133068 3% //dev/sda1 26104 26104 0 100% /boottmpfs 128334 1 128333 1% /dev/shm手动执行创建目录和文件命令报同样错误:[root@ocm1 oracle]# cd /boot/[root@ocm1 boot]# mkdir amkdir: cannot create directory `a’: No space left on device[root@ocm1 boot]# touch abctouch: cannot touch `abc’: No space left on device不论你在什么时候开始,重要的是开始之後就不要停止

模拟LINUX磁盘分区有可用空间无可用Inodes时报错:No space left

相关文章:

你感兴趣的文章:

标签云: