Using the New Linux ReiserFS Filesystem
The pros and cons of the new Linux filesystem type, ReiserFS.
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.
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.
Strengths and Weaknesses
ReiserFS has a number of strengths:
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.
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
- 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
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)