Article Title: Comparison of space occupied by Ext3 and Reiserfs file systems. Linux is a technology channel of the IT lab in China. Including desktop applications, Linux system management, kernel research, embedded systems, open-source, and other basic classification Ext3 file systems and reiserfs file systems are now very popular on linux systems. Next we will compare the usage of these two file systems on hard disk space. Because my hard disk partitions have been basically fixed and cannot be changed, we use the File Creation Method for comparison-after all, we are not comparing speed here, it is a space -- however, I do not know whether it is different from the actual device.
(1) first, we need a partition with enough free space for this experiment. My free space is less than 5 GB, so I had to make every maximum partition of the Experiment 2 GB. in my experiment, we first compare MB "partitions", then 1 GB partitions, and finally 2 GB partitions. The tool we need is also very simple: dd tool, used to quickly obtain a large file; mkfs tool for file creation. ext3 and mkfs. reiserfs; df tool, used to view partition usage.
Here we will explain in advance the simple situation of my system: the kernel is 2.6.23.1 and compiled by myself. The command is replaced by alias ll = 'LS-l'. The reiserfs version is 3.6.
(2) start construction now:
1. Create a M file:
Dd if =/dev/zero of = d-ext3fs bs = 1 M count = 100
Dd if =/dev/zero of = d-reiserfs bs = 1 M count = 100
2. Create a file system:
2.1 create an ext3 File System:
Togry @ xiaowp :~ /Disks $ sudo mkfs. ext3 d-ext3fs mke2fs 1.40.4 (31-Dec-2007) d-ext3fs is not a block special device. Proceed anyway? (Y, n) yFilesystem label = OS type: LinuxBlock size = 1024 (log = 0) Fragment size = 1024 (log = 0) 25688 inodes, 102400 blocks5120 blocks (5.00%) reserved for the super userFirst data block = 1 Maximum filesystem blocks = 6737100813 block groups8192 blocks per group, 8192 fragments per group1976 inodes per groupSuperblock backups stored on blocks: 8193,245 77, 40961,573 45, 73729 Writing inode tables: done Creating Journal (4096 blocks): doneWriting superblocks and filesystem accounting information: doneThis filesystem will be automatically checked every 31 mounts or180 days, whichever comes first. use tune2fs-c or-I to override.2.2 create a reiserfs File System: togry @ xiaowp :~ /Disks $ sudo mkfs. reiserfs d-reiserfs mkfs. reiserfs 3.6.19 (2003 www.namesys.com) A pair of credits: Lycos Europe (www.lycos-europe.com) had a support contract with us thatconsistently came in just when we wowould otherwise have mispayroll, and thatthey kept doubling every year. much thanks to them. jeremy Fitzhardinge wrote the teahash. c code for V3. Colin Plumb alsocontributed to that. d-reiserfs I S not a block special deviceUse-f to force over /////////// ha, do not allow me to create a file system on the file by default. Togry @ xiaowp :~ /Disks $ sudo mkfs. reiserfs d-reiserfs-fmkfs. reiserfs 3.6.19 (2003 seconds) A pair of credits: The Defense Advanced Research Projects Agency (DARPA, www.darpa.mil) is theprimary sort sor of Reiser4. DARPA does not endorse this project; it merely modify sit. jeremy Fitzhardinge wrote the teahash. c code for V3. Colin Plumb alsocontributed to that. d-reiserfs is not a block special deviceContinue (y/n): yGuessing about desired format .. kernel 2.6.23.1.build51 is running. format 3.6 with standard journalCount of blocks on the device: 25600 Number of blocks consumed by mkreiserfs formatting process: 8212 Blocksize: 4096 Hash function used to sort names: "r5" Journal Size 8193 blocks (first block 18) Journal Max transaction length 1024 inode generation number: 0 UUID: 3bb7a2109b78a-462f-9ea0-a001_1c8667initializing journal-0% .... 20% .... 40% .... 60% .... 80% .... 100% Syncing .. okTell your friends to use a kernel based on 2.4.18 or later, and especially not akernel based on 2.4.9, when you use reiserFS. have fun. reiserFS is successfully created on d-reiserfs.
|
3. After creating the file system, mount them and view their available space.
Togry @ xiaowp :~ /Disks $ sudo mount d-ext3fs ext/-t ext3-o loop
Togry @ xiaowp :~ /Disks $ sudo mount d-reiserfs rei/-t reiserfs-o loop
Togry @ xiaowp :~ /Disks $ df
File System 1 K-block used available % mount point
...... (Skip irrelevant items here)
/Home/togry/disks/d-ext3fs
99150 5664 88366 7%/home/togry/disks/ext
/Home/togry/disks/d-reiserfs
102392 32840 69552 33%/home/togry/disks/rei
Yo! The reiserfs file system actually occupies such a large space, with no more than 1/3.
4. Create two 1 GB files for comparison. Compared with the previous one, it is simpler here.
Drwxr-xr-x 2 togry 48 2008-01-11 :07 ext
-Rw-r -- 1 togry 1073741824 2008-01-22 20:53 ext3
Drwxr-xr-x 2 togry 48 2008-01-11 17:07 rei
-Rw-r -- 1 togry 1073741824 2008-01-22 20:50 reiserfs
The etc3 and reiserfs files are "devices ".
5. Create a File System
togry@xiaowp:~/disks$ sudo mkfs.reiserfs reiserfs -fmkfs.reiserfs 3.6.19 (2003 www.namesys.com)A pair of credits:Edward Shushkin wrote the encryption and compression file plugins, and the V3journal relocation code.Lycos Europe (www.lycos-europe.com) had a support contract with us thatconsistently came in just when we would otherwise have missed payroll, and thatthey kept doubling every year. Much thanks to them.reiserfs is not a block special deviceContinue (y/n):yGuessing about desired format.. Kernel 2.6.23.1.build51 is running.Format 3.6 with standard journalCount of blocks on the device: 262144Number of blocks consumed by mkreiserfs formatting process: 8219Blocksize: 4096Hash function used to sort names: "r5"Journal Size 8193 blocks (first block 18)Journal Max transaction length 1024inode generation number: 0UUID: 2b05d990-54b3-49c7-a197-79807a173c5bInitializing journal - 0%....20%....40%....60%....80%....100%Syncing..okTell your friends to use a kernel based on 2.4.18 or later, and especially not akernel based on 2.4.9, when you use reiserFS. Have fun.ReiserFS is successfully created on reiserfs.togry@xiaowp:~/disks$ sudo mkfs.extmkfs.ext2 mkfs.ext3 togry@xiaowp:~/disks$ sudo mkfs.ext3 extext/ ext3 togry@xiaowp:~/disks$ sudo mkfs.ext3 ext3 mke2fs 1.40.4 (31-Dec-2007)ext3 is not a block special device.Proceed anyway? (y,n) yFilesystem label=OS type: LinuxBlock size=4096 (log=2)Fragment size=4096 (log=2)131072 inodes, 262144 blocks13107 blocks (5.00%) reserved for the super userFirst data block=0Maximum filesystem blocks=2684354568 block groups32768 blocks per group, 32768 fragments per group16384 inodes per groupSuperblock backups stored on blocks: 32768, 98304, 163840, 229376Writing inode tables: done Creating journal (8192 blocks): doneWriting superblocks and filesystem accounting information: doneThis filesystem will be automatically checked every 28 mounts or180 days, whichever comes first. Use tune2fs -c or -i to override.
|
6. view the remaining space after mounting the File System
Togry @ xiaowp :~ /Disks $ df
File System 1 K-block used available % mount point
......
/Home/togry/disks/ext3
1032088 34092 945568 4%/home/togry/disks/ext
/Home/togry/disks/reiserfs
1048540 32840 1015700 4%/home/togry/disks/rei
Togry @ xiaowp :~ /Disks $ df-h
File System capacity used available % mount point
......
/Home/togry/disks/ext3
1008 M 34 M 924 M 4%/home/togry/disks/ext
/Home/togry/disks/reiserfs
1.0G 33 M 992 M 4%/home/togry/disks/rei
It seems that the file space usage is quite good. Let's take a look at the situation in the 2 GB File System:
7. Create a file:
Dd if =/dev/zero of = ext3 bs = 1G count = 2
Dd if =/dev/zero of = reiserfs bs = 1G count = 2
Take a look at the results:
Drwxr-xr-x 2 togry 48 2008-01-11 :07 ext
-Rw-r -- 1 togry 2147483648 2008-01-22 21:30 ext3
Drwxr-xr-x 2 togry 48 2008-01-11 17:07 rei
-Rw-r -- 1 togry 2147483648 2008-01-22 21:35 reiserfs
8. Create a file system:
togry@xiaowp:~/disks$ sudo mkfs.ext3 ext3 mke2fs 1.40.4 (31-Dec-2007)ext3 is not a block special device.Proceed anyway? (y,n) yFilesystem label=OS type: LinuxBlock size=4096 (log=2)Fragment size=4096 (log=2)262144 inodes, 524288 blocks26214 blocks (5.00%) reserved for the super userFirst data block=0Maximum filesystem blocks=53687091216 block groups32768 blocks per group, 32768 fragments per group16384 inodes per groupSuperblock backups stored on blocks: 32768, 98304, 163840, 229376, 294912Writing inode tables: done Creating journal (16384 blocks): doneWriting superblocks and filesystem accounting information: doneThis filesystem will be automatically checked every 25 mounts or180 days, whichever comes first. Use tune2fs -c or -i to override.togry@xiaowp:~/disks$ sudo mkfs.reiserfs reiserfs -fmkfs.reiserfs 3.6.19 (2003 www.namesys.com)A pair of credits:BigStorage (www.bigstorage.com) contributes to our general fund every month,and has done so for quite a long time.Lycos Europe (www.lycos-europe.com) had a support contract with us thatconsistently came in just when we would otherwise have missed payroll, and thatthey kept doubling every year. Much thanks to them.reiserfs is not a block special deviceContinue (y/n):yGuessing about desired format.. Kernel 2.6.23.1.build51 is running.Format 3.6 with standard journalCount of blocks on the device: 524288Number of blocks consumed by mkreiserfs formatting process: 8227Blocksize: 4096Hash function used to sort names: "r5"Journal Size 8193 blocks (first block 18)Journal Max transaction length 1024inode generation number: 0UUID: 0d3e668d-77e5-4b5d-a157-a3e937cbc7f4Initializing journal - 0%....20%....40%....60%....80%....100%Syncing..okTell your friends to use a kernel based on 2.4.18 or later, and especially not akernel based on 2.4.9, when you use reiserFS. Have fun.ReiserFS is successfully created on reiserfs.
|
This time it takes longer to create a file system than before.
9. Mount the file system. Check the result:
Togry @ xiaowp :~ /Disks $ sudo mount ext3 ext-t ext3-o loop & sudo mount reiserfs rei-t reiserfs-o loop
Togry @ xiaowp :~ /Disks $ df
File System 1 K-block used available % mount point
......
/Home/togry/disks/ext3
2064208 68680 1890672 4%/home/togry/disks/ext
/Home/togry/disks/reiserfs
2097084 32840 2064244 2%/home/togry/disks/rei
Togry @ xiaowp :~ /Disks $ df-h
File System capacity used available % mount point
......
/Home/togry/disks/ext3
2.0G 68 M 1.9G 4%/home/togry/disks/ext
/Home/togry/disks/reiserfs
2.0G 33 M 2.0G 2%/home/togry/disks/rei
(3) In summary, I can say for the ext3 file system, when the partition increases, the space used by it also increases rapidly; the growth of the reiserfs system is far slower than that of the ext3 file system. In addition, because reiserfs is a real log file system, it is more suitable for reading and writing files. ext3 file system also has certain log functions, but its performance is not that good. For small partitions, such as/boot, it is ideal to use ext3 or ext2 as read-only partitions.