Using the New Linux ReiserFS Filesystem

The pros and cons of the new Linux filesystem type, ReiserFS.

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

For most of Linux's history, the extended2 (ext2) filesystem has been the standard, although the Linux kernel can be configured to read/write many other types of filesystems. Recently, work has been done on some new filesystem types in an attempt to improve on the performance of ext2. Ext3 and ReiserFS are two of these projects. Ext3 adds journaling to ext2, whereas ReiserFS is a whole new filesystem, with journaling. This article will focus on the strengths and weaknesses of ReiserFS, as well as how to go about setting it up, should you decide to give it a try.

Journaling

If you're not familiar with database systems, journaling means that each transaction is written to a journal, or log. It is then possible to replay this journal in the event of a catastrophe and recover the lost transactions. Periodically, the journal is flushed, after it is certain the transactions have taken place.

In addition, for performance reasons, the author of ReiserFS has chosen to store both the file names and the files in a database, rather than just the file names and locations. This arrangement allows better storage of small files. Rather than allocating a whole block for a file that is smaller than the block size, small files are combined for optimal usage of disk space.

Strengths and Weaknesses

ReiserFS has a number of strengths:

  • Generally higher performance for all file sizes.

  • Wastes less space. There is no static inode space allocation; small files are packed together.

  • Much higher performance for large directories, even compared to other balanced tree filesystems.

  • Uses B* balanced trees, whereas other balanced tree filesystems use obsolete B+ trees.

  • Partitions can be resized while in use.

  • Extremely fast recovery in the event of unplanned machine shutdown (loss of power). Rather than taking many seconds or even minutes to check the filesystem as e2fsck does, ReiserFSck takes only seconds.

    Of course, it also has its weaknesses:

    • The software is still relatively new. You may want to hold off implementing in production systems, although results to date have been good.

    • No quota support (yet).

    • Dump does not work (yet).

    • Kernel-based NFS is not very stable yet.

    • Certain programs (qmail, for one) have issues with ReiserFS. Patches are available in many cases.

    • It is not possible to change live filesystems back and forth from ext2 to ReiserFS. To make the change, you need to back up your data, create the file system, and restore.

    • Occasionally, you may experience a stall condition (read starves). When large writes are scheduled all at once, reads can starve. A fix for this is in the works, and the later your ReiserFS patch, the better this situation is handled.

    Precautions

    When you use ReiserFS, you'll need to take a number of precautions:

    • If you're using Lilo, you will need to set the notail option on / (the root partition) if you use ReiserFS on that partition. The new version of Lilo claims notail isn't needed anymore, but it also requires a newer version of ReiserFS.

    • If using md (software raid) to spread ReiserFS over multiple disks, turn off REISERFS_READ_LOCK. To do so, comment out
      #define REISERFS_READ_LOCK

      in linux/include/linux/reiserfs_fs.h.

    • If you want to run Windows 98 under Linux using VMware, add the following line to the configuration file (~/vmware/win98/win98.cfg): host.FSSupportLocking1 = 0x52654973

    Utilities

    Several utilities are included with ReiserFS kernel patches:

    • mkreiserfsCreates a Linux ReiserFS file system on a device. This utility is equivalent to mke2fs.

    • reiserfsckPerforms a consistency check for the Linux ReiserFS file system. It is equivalent to e2fsck on ext2.

    • resize_reiserfsUsed for offline file system resizing. As far as I know, ext2 has no equivalent to this command.

    I am currently running ReiserFS on /home and /usr on a SuSE7.0 Linux install, leaving the / partition as ext2. SuSE 7.0 comes with ReiserFS as an install option, if you pick the expert install. For testing purposes, I created equivalent partitions /usr2, and /home2 using ext2. The following is the output from mount:

    larry:~ # mount
    /dev/hda2 on / type ext2 (rw)
    proc on /proc type proc (rw)
    /dev/hda1 on /boot type ext2 (rw)
    /dev/hda5 on /usr type reiserfs (rw)
    /dev/hda7 on /home type reiserfs (rw)
    

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