1 2 3 4 5 6 7 8 9 10 11 12 13 14 | # df -i --print-type Filesystem Type Inodes IUsed IFree IUse% Mounted on /dev/sda7 ext4 3147760 283483 2864277 10% / udev devtmpfs 496088 553 495535 1% /dev tmpfs tmpfs 499006 491 498515 1% /run none tmpfs 499006 3 499003 1% /run/lock none tmpfs 499006 15 498991 1% /run/shm /dev/sda6 fuseblk 74383900 4786 74379114 1% /media/DiskE /dev/sda8 fuseblk 29524592 19939 29504653 1% /media/DiskF # find / -inum 1114 /media/DiskE/Pictures/t3.jpg /media/DiskF/123.txt /bin/sync |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 | # dd if=/dev/zero of=mo.img bs=5120k count=1 # ls -lh mo.img -rw-r--r-- 1 root root 5.0M Sep 1 17:54 mo.img # mkfs -t ext4 -F ./mo.img ... OS type: Linux Block size=1024 (log=0) Fragment size=1024 (log=0) Stride=0 blocks, Stripe width=0 blocks 1280 inodes, 5120 blocks 256 blocks (5.00%) reserved for the super user ... ... Writing superblocks and filesystem accounting information: done # mount -o loop ./mo.img /mnt # cat /mnt/inode_test.sh #!/bin/bash for ((i = 1; ; i++)) do if [ $? -eq 0 ]; then echo "This is file_$i" > file_$i else exit 0 fi done # ./inode_test.sh ./inode_test.sh: line 6: file_1269: No space left on device # df -iT /mnt/; du -sh /mnt/ Filesystem Type Inodes IUsed IFree IUse% Mounted on /dev/loop0 ext4 1280 1280 0 100% /mnt 1.3M /mnt/ |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | # ls -aliF /mnt/lost+found total 44 11 drwx------ 2 root root 12288 Sep 1 17:54 ./ 2 drwxr-xr-x 3 root root 31744 Sep 1 17:57 ../ # stat /mnt/lost+found/ File: `/mnt/lost+found/' Size: 12288 Blocks: 24 IO Block: 1024 directory Device: 700h/1792d Inode: 11 Links: 2 Access: (0700/drwx------) Uid: ( 0/ root) Gid: ( 0/ root) Access: 2012-09-01 17:57:17.000000000 +0800 Modify: 2012-09-01 17:54:49.000000000 +0800 Change: 2012-09-01 17:54:49.000000000 +0800 Birth: - |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | # ls -li total 0 // 可对不存在的文件创建软链接 # ln -s old.file soft.link # ls -liF total 0 789467 lrwxrwxrwx 1 root root 8 Sep 1 18:00 soft.link -> old.file // 由于被指向的文件不存在,此时的软链接 soft.link 就是死链接 # cat soft.link cat: soft.link: No such file or directory // 创建被指向的文件 old.file,soft.link 恢复成正常的软链接 # echo "This is an original file_A" >> old.file # cat soft.link This is an original file_A // 对不存在的目录创建软链接 # ln -s old.dir soft.link.dir # mkdir -p old.dir/test # tree . -F --inodes . ├── [ 789497] old.dir/ │ └── [ 789498] test/ ├── [ 789495] old.file ├── [ 789495] soft.link -> old.file └── [ 789497] soft.link.dir -> old.dir/ |
1 2 3 4 5 | $ ls -li total 2136 656627 lrwxrwxrwx 1 harris harris 8 Sep 1 14:37 a -> data.txt 656662 lrwxrwxrwx 1 harris harris 1 Sep 1 14:37 b -> a 656228 -rw------- 1 harris harris 2186738 Sep 1 14:37 data.txt 6 |
欢迎光临 电子技术论坛_中国专业的电子工程师学习交流社区-中电网技术论坛 (http://bbs.eccn.com/) | Powered by Discuz! 7.0.0 |