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/
|