http://www.freeos.com/articles/3933/
By Mayank Sarup <Mayank@freeos.com> Posted: ( 2001-04-16 06:49:53 EST by gatha )
A Journal Filesystem keeps track of all the transactions undertaken. And the lack of a proper journal filesystems has always been sited as one of the reasons holding back widespread adoption of Linux in the enterprise space. But this argument no longer holds true, for currently, there are four journal filesystems to choose from — XFS, JFS, ext3 and ReiserFS. Here we shall look into ReiserFs.
Of all the journal filesystems available today, ReiserFS, is the most developed under Linux. While IBM's JFS and SGI's XFS have been around a lot longer, they are still in an prenatal stage as far as the Linux OS is concerned. Ext3 has also quite a way to go. So, for now, our choice of a journal filesystem is ReiserFS. Of course, this isn't to say that we're settling for ReiserFS for lack of a better option. ReiserFS is a good choice regardless of the number of options in the market or the quality of those options.
Journaling filesystems are sort of the elite in the business. They're what filesystems like FAT and ext2 want to grow up into. They're also essential for big enterprise server where data integrity is a priority.
The idea behind journal filesystems comes from big databases like Oracle. Database operations quite often include several related and dependent sub-operations. The failure of any one operation means that the entire operation is invalid and any changes made to the database are rolled back. Journal filesystems use a similar system.
A journal log file is maintained on the partition. Filesystem writes are first written to the log file. If a write operation is interrupted due to the machine unexpectedly going down — power failure, crash — then at the next boot, the journal log file is read and operations are rolled back. This process takes only a few seconds to few minutes rather than the hours that a `fsck' can possibly take, on larger servers.
A far more effective description can be seen in this LinuxGazette article.
Start by patching the kernel for ReiserFS, then it's time to compile the ReiserFS utilities. The utilities are place in the directory /usr/src/linux/fs/reiserfs/utils. Do a "make" followed by a "make install" to install the programs. The utilities are not included in the 2.4 kernels and are a separate download. Get the package from this location.
Un-tar the file.
# tar zxvf reiserfsprogs-3.x.0j.tar.gz # cd reiserfsprogs-3.x.0j # ./configure # make # make install
Unfortunately, there is no "ext2toreiserfs" utility to make our lives easier. So the basic procedure for converting root (/) from ext2 to reiserfs becomes the following three-step procedure.
Create a new partition. ReiserFS does not require a special partition type. Use 83 (Linux).
# fdisk -l /dev/hda /dev/hda9 2872 3126 2048256 83 Linux /dev/hda10 3127 3381 2048256 83 Linux
Now create a ReiserFS filesystem on the new partition.
# mkreiserfs /dev/hda10
Mount the new partition
# mount -t reiserfs /dev/hda10 /mnt/hda10
Copy the data onto the new partition.
# cd /mnt/hda10 # tar cvlf - / | tar xf -
Edit fstab to point to the new root
/dev/hda10 / reiserfs defaults 1 1
Create a symlink to reiserfsck because the Red Hat boot looks for fsck.reiserfs.
# ln -s /sbin/reiserfsck /sbin/fsck.reiserfs
Get at least lilo 21.6. This was the first version to support ReiserFS. The alternative is to keep a small /boot partition that is ext2. The first option — upgrading lilo — is preferred. A better boot manager that we recommend for use is GRUB.
Install lilo after creating new lilo.conf entries for your new kernel and boot with it. The "root =" entry should point to the new root.
Reboot! You'll now have root on ReiserFS.
The above procedure was for putting root on ReiserFS, but it is pretty much what you will want to use when converting any of your partitions to ReiserFS. The procedure given in this article should work across distributions and partitions. But do let us know, in case you encounter any problems regarding the new kernel.
ReiserFS home ReiserFS FAQ LinuxGazette article on journal filesystems XFS by SGI IBM's JFS Ext3 beta testing program on redhat.com