September 15, 2003

mke2fs -i -b -J 參數關係

test script

#!/bin/sh
for b in 1024 2048 4096
do
for i in 1024 2048 4096
do
mke2fs -m0 -b $b -i $i -j /dev/hda1 > /dev/null 2>&1
mount /dev/hda1 /mnt
cp -a /devel/flash/conf /mnt
cp -a /boot /mnt
cp system.gz /mnt
echo b=$b i=$i
df -k | grep mnt
df -i | grep mnt
umount /mnt >/dev/null 2>&1
sync
done
done


b=1024 i=1024
/dev/hda1 109363 45137 64226 42% /mnt
/dev/hda1 125056 146 124910 1% /mnt
b=1024 i=2048
/dev/hda1 117171 45137 72034 39% /mnt
/dev/hda1 62592 146 62446 1% /mnt
b=1024 i=4096
/dev/hda1 121075 45137 75938 38% /mnt
/dev/hda1 31360 146 31214 1% /mnt
b=2048 i=1024
/dev/hda1 116820 45184 71636 39% /mnt
/dev/hda1 65536 146 65390 1% /mnt
b=2048 i=2048
/dev/hda1 117196 45184 72012 39% /mnt
/dev/hda1 62528 146 62382 1% /mnt
b=2048 i=4096
/dev/hda1 121100 45184 75916 38% /mnt
/dev/hda1 31296 146 31150 1% /mnt
b=4096 i=1024
/dev/hda1 120928 45336 75592 38% /mnt
/dev/hda1 32768 146 32622 1% /mnt
b=4096 i=2048
/dev/hda1 120928 45336 75592 38% /mnt
/dev/hda1 32768 146 32622 1% /mnt
b=4096 i=4096
/dev/hda1 121116 45336 75780 38% /mnt
/dev/hda1 31264 146 31118 1% /mnt

加了 -j, 預設多了 4MB 的日誌
b=1024 i=1024
/dev/hda1 109363 49251 60112 46% /mnt
/dev/hda1 125056 146 124910 1% /mnt

-J size=1 是最小, 日誌最小為 1024 blocks, 即 -J size=1

結論: 要空間佔最小, mkfs 後空間最大(但是 inode 較少), 日誌最小用
mke2fs -b 1024 -i 8192 -J size=1

Posted by pank at September 15, 2003 12:08 PM
Comments
Post a comment













Remember personal info?