Linux - reiserfs setup

By: John McFarlane <john.mcfarlane@rockfloat.com>
Last updated: 10/20/2002 @15:00

Abstract:
This document will go thru a step by step setup of the Reiser file system on Red Hat 7.2 (Note: this howto is outdated).

Table of Contents:
  1. install distro (redhat 7.2 for this example)
  2. Compile reiser support into the kernel, 7.2:
  3. Compile your new kernel
  4. Install your new kernel
  5. add another entry boot entry into /etc/lilo.conf, here is an example lilo.conf (note the second image= stuff):
  6. Update your master boot record
  7. just to be sure, resolve any dependancies
  8. Finish up
  9. Setup any additional reiser dependancies
  10. Prepare your partitions
  11. Format the new partition(s) with reiserfs
  12. Update /etc/fstab
  13. Now that /dev/hdc1 is ready to be root we need to update lilo again
  14. Update the master boot record
  15. Copy the entire system to the temporary root partition
  16. We are now ready to boot to the temporary root partition
  17. hope you don't get a kernel panic
  18. upon bootup, mtab will show:
  19. now you need to make hda3 (the old root) reiserfs
  20. Copy the sytem back to the normal place
  21. Edit /etc/fstab yet again
  22. Edit /etc/lilo.conf
  23. now you gotta get /boot on reiser
  24. edit fstab, changing the filetype of /boot from ext2 to reiserfs
  25. DO NOT REBOOT UNTIL THE NEXT STEP IS COMPLETE.. OTHERWISE YOUR SCREWED
  26. reboot and now you got everything on reiser, including root and boot
  27. Changelog


1. install distro (redhat 7.2 for this example)

I'm finished with this step

2. Compile reiser support into the kernel, 7.2:


root# cd /usr/src/2.4.7
root# make menuconfig
        
make sure "prompt for development and/or incomplete code..." is checked under: "code maturity level options"

go to filesystems.. and put shift + y into the reiser box // we want it "compiled in", not "a module of" the kernel

exit and save
I'm finished with this step

3. Compile your new kernel


root# make dep && make bzImage && make modules && make modules_install
        
I'm finished with this step

4. Install your new kernel

cd to /boot and take note of the file /boot/vmlinuz, this is your current kernel

cp /usr/src/linux-2.4.7-10/arch/i386/boot/bzImage /boot/vmlinuz-2.4.7-10.reiser
cp vmlinuz-2.4.7-10.reiser /boot/System.map
        
I'm finished with this step

5. add another entry boot entry into /etc/lilo.conf, here is an example lilo.conf (note the second image= stuff):


prompt
timeout=100
default=linux-reiser
boot=/dev/hda
map=/boot/map
install=/boot/boot.b
message=/boot/message

image=/boot/vmlinuz-2.4.7-10
    label=linux-stock
    read-only
    root=/dev/hda3

image=/boot/vmlinuz-2.4.7-10.reiser
    label=linux-reiser
    read-only
    root=/dev/hda3
        
I'm finished with this step

6. Update your master boot record

run lilo to update the mbr with /boot and /etc/lilo.conf

root# lilo
        
I'm finished with this step

7. just to be sure, resolve any dependancies


root# depmod -a 2.4.7-10
        
I'm finished with this step

8. Finish up

cross fingers and reboot :)
I'm finished with this step

9. Setup any additional reiser dependancies

upgrade to at least lilo 26.1

root# rpm -ivh rpm-26.2.rpm
        
I'm finished with this step

10. Prepare your partitions

say we have this fdisk -l

hda1 = /boot
hda2 = swap
hda3 = /

hdb = clean
hdc = clean
      
use fdisk to add partitions hdb1 and hdc1 to hdb and hdc respectively
I'm finished with this step

11. Format the new partition(s) with reiserfs


root# mkreiserfs -h r5 /dev/hdb1
root# mkreiserfs -h r5 /dev/hdc1
root# mount -t reiserfs /dev/hdb1 /hdb
root# mount -t reiserfs /dev/hdc1 /hdc
        
I'm finished with this step

12. Update /etc/fstab

make your /etc/fstab look like this:

/dev/hda1      /boot          ext2          defaults                1 1
/dev/hda2      swap           swap          defaults                0 0
#/dev/hda3     /              ext2          defaults                0 0
/dev/hdb1      /hdb           reiserfs      defaults                1 1
/dev/hdc1      /              reiserfs      defaults                1 1
none           /dev/pts       devpts        gid=5,mode=620          0 0
none           /proc          proc          defaults                0 0
none           /dev/shm       tmpfs         defaults                0 0
/dev/cdrom     /mnt/cdrom     iso9660       noauto,owner,kudzu,ro   0 0
/dev/fd0       /mnt/floppy    auto          noauto,owner,kudzu      0 0
        
I'm finished with this step

13. Now that /dev/hdc1 is ready to be root we need to update lilo again

Make /etc/lilo.conf look like this:

prompt
timeout=50
default=linux
boot=/dev/hda
map=/boot/map
install=/boot/boot.b
message=/boot/message
linear

image=/boot/vmlinuz-2.4.7-10
    label=linux
    initrd=/boot/initrd-2.4.7-10.img
    read-only
    root=/dev/hdc1
        
I'm finished with this step

14. Update the master boot record

Remember to run lilo -v to make sure you have lilo 26.1 or greater

root# lilo
        
I'm finished with this step

15. Copy the entire system to the temporary root partition


cp -ax / /hdc
        
I'm finished with this step

16. We are now ready to boot to the temporary root partition

reboot when your sure all of the following happened:
          I'm finished with this step

          17. hope you don't get a kernel panic

          I'm finished with this step

          18. upon bootup, mtab will show:

          
          /dev/hda1   /boot    ext2                       0 0
          /dev/hdb1   /hdb     reiserfs                   0 0
          /dev/hdc1   /        reiserfs                   0 0
          none        /proc    proc  rw                   0 0
          none        /dev/pts devpts rw,gid=5,mode=620   0 0
          none        /dev/shm tmpfs rw                   0 0
                  
          I'm finished with this step

          19. now you need to make hda3 (the old root) reiserfs

          
          root# mkreiserfs -h r5 /dev/hda3
          root# mount -t reiserfs /dev/hda3 /hda
                  
          I'm finished with this step

          20. Copy the sytem back to the normal place

          Now that /dev/hda3 is reiserfs, you can copy the system back onto it
          
          root# cd /
          root# cp -ax * /hda
                  
          I'm finished with this step

          21. Edit /etc/fstab yet again

          Make it look like this:
          
          /dev/hda1      /boot          ext2        defaults                1 1
          /dev/hda2      swap           swap        defaults                0 0
          /dev/hda3      /              reiserfs    defaults                0 0
          /dev/hdb1      /hdb           reiserfs    defaults                1 1
          /dev/hdc1      /hdc           reiserfs    defaults                1 1
          none           /dev/pts       devpts      gid=5,mode=620          0 0
          none           /proc          proc        defaults                0 0
          none           /dev/shm       tmpfs       defaults                0 0
          /dev/cdrom     /mnt/cdrom     iso9660     noauto,owner,kudzu,ro   0 0
          /dev/fd0       /mnt/floppy    auto        noauto,owner,kudzu      0 0
                  
          I'm finished with this step

          22. Edit /etc/lilo.conf

          Update lilo.conf telling it to boot from your shiny new reiser root partition:
          
          prompt
          timeout=50
          default=linux
          boot=/dev/hda
          map=/boot/map
          install=/boot/boot.b
          message=/boot/message
          linear
          
          image=/boot/vmlinuz-2.4.7-10
                  label=linux
                  initrd=/boot/initrd-2.4.7-10.img
                  read-only
                  root=/dev/hda3
                  
          I'm finished with this step

          23. now you gotta get /boot on reiser

          
          root# mkdir /boot_good
          root# cp -ax /boot /boot_good
          root# ps -aux | grep klogd
          --> kill *whatever the pid of klogd is
          root# umount /boot
          root# mkreiserfs -r5 /dev/hda1
          root# mount -t reiserfs /dev/hda1 /boot
          root# cp -ax /boot_good /boot
                  
          I'm finished with this step

          24. edit fstab, changing the filetype of /boot from ext2 to reiserfs

          I'm finished with this step

          25. DO NOT REBOOT UNTIL THE NEXT STEP IS COMPLETE.. OTHERWISE YOUR SCREWED

          Update the master boot record once again with the new lilo config:
          
          root# lilo
                  
          I'm finished with this step

          26. reboot and now you got everything on reiser, including root and boot

          Congrats, hopefully your now looking at a system with both /root and /boot on reiserfs

          Well done, you deserve coffee and a pop tart
          I'm finished with this step

          Changelog: Date Description
          10/20/2002 @15:00 Initial creation

          This document was originally created on 10/20/2002


          Disclaimer:
          This page is not endorsed by gentoo.org or any other cool cats. Any information provided in this document is to be used at your own risk.