Using the New Linux ReiserFS Filesystem - Page 2

By Stew Benedict | Posted Dec 21, 2000
Page 2 of 3   |  Back to Page 1
Print ArticleEmail Article
  • Share on Facebook
  • Share on Twitter
  • Share on LinkedIn

Setting Up ReiserFS

To use ReiserFS, you have to patch the kernel source before you can include it in your options. You can download appropriate kernel patches from ftp://ftp.lugoj.org/pub/reiserfs/devlinux.com/pub/namesys/. There are patches for kernel versions 2.2.14 through 2.2.17, the 2.3 series, and the new 2.4.0 kernel.

To apply the kernel patches, do the following:

cd /usr/src
zcat linux-2.2.16-reiserfs-3.5.24-patch.gz | patch -p0

(I was patching a 2.2.16 kernelyours may vary.)

When configuring the kernel, answer "y" or "m" (module) to the ReiserFS support question. Then compile and install the kernel image and modules as usual. ReiserFS utilities are located in the patched kernel source tree in linux/fs/reiserfs/utils. They are built and installed in the usual manner:

cd /usr/src/linux/fs/reiserfs/utils
make
make install  

Boot with your newly built kernel, run mkreiserfs on a spare partition, and mount it. If you want to replace an existing ext2 partition with the new one, it would be wise to boot into single-user mode; then you can either copy the files from the existing partition to the new one or restore to the new partition from backup media. To copy, I generally use the following:

mount /dev/hdx /mnt/temp    (new reiserfs)
cd /home                    (old ext2 fs)
tar -cf - . | (cd /mnt/temp;tar -xf -)

These commands will copy everything from the existing partition to the new one. You can then umount both partitions, edit /etc/fstab appropriately, and remount your new /home. Here is a sample /etc/fstab entry for a Reiserfs partition:

/dev/hda7       /home   reiserfs        defaults 1 2

ReiserFS has a few mount/re-mount options:

  • notailCauses the filesystem to work faster, especially for small appends to small files. The cost is more wasted disk space.

  • replayonlyForces the filesystem driver to replay the journal and exit. Mounting will be avoided. This option is used by fsck, for the most part.

  • resizeLets you expand a ReiserFS partition online. To do this you would specify the mount command as follows:
    mount -o remount,resize=<new blockcount> <reiserfs mount point>

    Of course, you need additional free space on the drive or you may end up consuming an adjacent partition.

Bonnie++ Performance Test

Bonnie++ is a program to test hard drives and file systems for performance. As the man pages for the program mention, there are many different types of filesystem operations. Bonnie++ tests some of them and for each test gives a result of the amount of work done per second and the percentage of CPU time this took. For performance results, higher numbers are better; for CPU usage, lower numbers are better. Bonnie++ can be downloaded from http://www.coker.com.au/bonnie++/.

Here are the results of the test on my machine. I was the only user on the system. X was only running in login mode, and the normal system daemons were running. Here are the hardware specs:

  • Processor: Pentium P166MMX

  • RAM: 80MB

  • Hard Drive: FUJITSU MPB3064ATU, 6187MB w/0kB Cache

I ran Bonnie++ with the defaults, reading and writing first from a 200 MB file, and then creating/reading/deleting from 30 files:

/home/stew (ReiserFS):

Version 1.00d       ------Sequential Output------ --Sequential Input- --Random-
                    -Per Chr- --Block-- -Rewrite- -Per Chr- --Block-- --Seeks--
Machine        Size K/sec %CP K/sec %CP K/sec %CP K/sec %CP K/sec %CP  /sec %CP
larry          200M  1305  95  4431  78  2231  70  1342  95  4560  84  13.6   1
                    ------Sequential Create------ --------Random Create--------
                    -Create-- --Read--- -Delete-- -Create-- --Read--- -Delete--
              files  /sec %CP  /sec %CP  /sec %CP  /sec %CP  /sec %CP  /sec %CP
                 30  1476  98 10719  99  2265 100  1497  99 10617  99  2079  99

/home2/stew (ext2):

Version 1.00d       ------Sequential Output------ --Sequential Input- --Random-
                    -Per Chr- --Block-- -Rewrite- -Per Chr- --Block-- --Seeks--
Machine        Size K/sec %CP K/sec %CP K/sec %CP K/sec %CP K/sec %CP  /sec %CP
larry          200M  1365  94  5000  80  2296  75  1351  94  4561  82  13.9   1
                    ------Sequential Create------ --------Random Create--------
                    -Create-- --Read--- -Delete-- -Create-- --Read--- -Delete--
              files  /sec %CP  /sec %CP  /sec %CP  /sec %CP  /sec %CP  /sec %CP
                 30    71  99   246  99  1460  98    72  99   272 100   181  70

Comment and Contribute
(Maximum characters: 1200). You have
characters left.
Get the Latest Scoop with Enterprise Networking Planet Newsletter