Comparison of space occupied by ext3 file system and reiserfs File System
Source: Internet
Author: User
Comparison of space occupied by ext3 file system and reiserfs file system itself-Linux general technology-Linux programming and kernel information. The following is a detailed description. Ext3 file system and reiserfs file system are 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) y
Filesystem label =
OS type: Linux
Block size = 1024 (log = 0)
Fragment size = 1024 (log = 0)
25688 inodes, 102400 blocks
5120 blocks (5.00%) reserved for the super user
First data block = 1
Maximum filesystem blocks = 67371008
13 block groups
8192 blocks per group, 8192 fragments per group
1976 inodes per group
Superblock backups stored on blocks:
8193,245 77, 40961,573 45, 73729
This filesystem will be automatically checked every 31 mounts or
180 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 that
Consistently came in just when we wocould otherwise have missed payroll, and that
They kept doubling every year. Much thanks to them.
Jeremy Fitzhardinge wrote the teahash. c code for V3. Colin Plumb also
Contributed to that.
D-reiserfs is not a block special device
Use-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-f
Mkfs. reiserfs 3.6.19 (2003 www.namesys.com)
A pair of credits:
The Defense Advanced Research Projects Agency (DARPA, www.darpa.mil) is
The
Primary sor of Reiser4. DARPA does not endorse this project; it mer
Ely
Extends SORS it.
Jeremy Fitzhardinge wrote the teahash. c code for V3. Colin Plumb
Lso
Contributed to that.
D-reiserfs is not a block special device
Continue (y/n): y
Guessing about desired format .. Kernel 2.6.23.1.build51 is running.
Format 3.6 with standard journal
Count 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: 3bb7a2492b78a-462f-9ea0-a004251c8667
Initializing journal-0%... 20%... 40%... 60%... 80%
Syncing... OK
Tell your friends to use a kernel based on 2.4.18 or later, and especially n
Ot
Kernel 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-f
Mkfs. reiserfs 3.6.19 (2003 www.namesys.com)
A pair of credits:
Edward Shushkin wrote the encryption and compression file plugins, and the V3
Journal relocation code.
Lycos Europe (www.lycos-europe.com) had a support contract with us that
Consistently came in just when we wocould otherwise have missed payroll, and that
They kept doubling every year. Much thanks to them.
Reiserfs is not a block special device
Continue (y/n): y
Guessing about desired format .. Kernel 2.6.23.1.build51 is running.
Format 3.6 with standard journal
Count of blocks on the device: 262144
Number of blocks consumed by mkreiserfs formatting process: 8219
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: 2b05d990-54b3-49c7-a197-79807a173c5b
Initializing journal-0%... 20%... 40%... 60%... 80%
Syncing... OK
Tell your friends to use a kernel based on 2.4.18 or later, and especially not
Kernel based on 2.4.9, when you use reiserFS. Have fun.
ReiserFS is successfully created on reiserfs.
Togry @ xiaowp :~ /Disks $ sudo mkfs. ext
Mkfs. ext2 mkfs. ext3
Togry @ xiaowp :~ /Disks $ sudo mkfs. ext3 ext
Ext/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) y
Filesystem label =
OS type: Linux
Block size = 4096 (log = 2)
Fragment size = 4096 (log = 2)
131072 inodes, 262144 blocks
13107 blocks (5.00%) reserved for the super user
First data block = 0
Maximum filesystem blocks = 268435456
8 block groups
32768 blocks per group, 32768 fragments per group
16384 inodes per group
Superblock backups stored on blocks:
32768,983 04, 163840,229 376
This filesystem will be automatically checked every 28 mounts or
180 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) y
Filesystem label =
OS type: Linux
Block size = 4096 (log = 2)
Fragment size = 4096 (log = 2)
262144 inodes, 524288 blocks
26214 blocks (5.00%) reserved for the super user
First data block = 0
Maximum filesystem blocks = 536870912
16 block groups
32768 blocks per group, 32768 fragments per group
16384 inodes per group
Superblock backups stored on blocks:
32768,983 04, 163840,229 376, 294912
This filesystem will be automatically checked every 25 mounts or
180 days, whichever comes first. Use tune2fs-c or-I to override.
Togry @ xiaowp :~ /Disks $ sudo mkfs. reiserfs-f
Mkfs. 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 that
Consistently came in just when we wocould otherwise have missed payroll, and that
They kept doubling every year. Much thanks to them.
Reiserfs is not a block special device
Continue (y/n): y
Guessing about desired format .. Kernel 2.6.23.1.build51 is running.
Format 3.6 with standard journal
Count of blocks on the device: 524288
Number of blocks consumed by mkreiserfs formatting process: 8227
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: 0d3e668d-77e5-4b5d-a157-a3e937cbc7f4
Initializing journal-0%... 20%... 40%... 60%... 80%
Syncing... OK
Tell your friends to use a kernel based on 2.4.18 or later, and especially not
Kernel 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.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.