![]() |
|
|
|
|
|
Racing to ReiserFS on Red Hat
By Mayank Sarup <Mayank@freeos.com>
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. Why Journaling? 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. Getting ReiserFS Kernels 2.4.1 include the ReiserFS code. If you have kernel 2.4.1, then upgrade to kernel 2.4.3, which carries the latest ReiserFS code. Version 3.6.25 is the latest and we recommend that you start using this code as important bug fixes and updates are included in it. If you have kernel 2.4.3, then the updates are already in the kernel. We'll be using kernel 2.4.3 for this article but 2.4.2 with latest patches is equally good. Patches for the 2.2 kernels are also available but they seem to be at version 3.5.x. Using ReiserFS Start by patching the kernel for ReiserFS For 2.2 kernels use Do a "make menuconfig". First thing to do is select the option "Prompt for development and/or incomplete code/drivers" under "Code maturity level options" else, ReiserFS will not be visible. Then go down to "File Systems" and compile in support for ReiserFS. If you're not interested in putting your root on ReiserFS, you can get away with compiling it in as a module. We'll be doing a root-on-reiserfs later in this article and you need to compile in support for that. Compile the kernel and modules. Note: If you're on Red Hat 7, first edit the Makefile and replace all instances of "gcc" with "kgcc". You will also need to install the kgcc package off your installation cdrom. This step is a must do or you will keep getting kernel panics. Gcc 2.96, which is included in Red Hat, is very buggy. All stock kernel compiles should be done using kgcc. Only Red Hat kernels will compile with gcc. Now 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. 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. 1. Create a new partition and format it with ReiserFS. Create a new partition. ReiserFS does not require a special partition type. Use 83 (Linux). # fdisk -l /dev/hda 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 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
Other articles by Mayank Sarup
Current Rating: [ 7.34 / 10 ]
Number of Times Rated: [ 140 ]
|
|
|
© 1998-2004 FreeOS Technologies (I) Pvt. Ltd. All rights reserved.
[Privacy Policy]
![]() |