From ArchWiki
Revision as of 21:41, 27 February 2008 by MartinZ (talk | contribs) (→‎Formating)
Jump to navigation Jump to search

Contributed by Itlain and others

Short Introduction

Reiser4 is a new file system developed by Namesys. It is a very fast file system (according to Namesys, the fastest). You can find benchmarks between the different file systems available on Linux on their website. It's also an atomic file system, "which means that your file system operations either entirely occur, or they entirely don't, and they don't corrupt due to half occurring."

Important Notes

  • Reiser4 requires a patched kernel
  • You're still using a 2.4 kernel: reiser4 is developed for 2.6 kernel, and has not been back ported to 2.4
  • Reiser4 consumes a little more CPU than other filesystems
  • Be warned that Reiser4 is still not considered a stable release.

Required materials

  • Recommended partitions:

- One empty partition for the new reiser4 system

- One small (12 - 20 MB) ext2 partition for /boot

- Optional: reiser4 partitions for /home, /var, /home/user/temp and anything you want

It is very easy to manage your partitions with gparted from extra. Archie LiveCD may be helpful to modify partitions, it already has gparted installed.


Note that you have to enable unstable and maybe testing repos to install some of this packages, uncommenting them in /etc/pacman.conf

1.- Install reiser4progs from unstable

pacman -Sy reiser4progs

2.- You'll need a reiser4 patched kernel. I recommend you to install kernel26mm from unstable, or kernel26zen-git from AUR.

pacman -Sy kernel26mm

3.- Bootloader

a) lilo is the recommended one because it is filesystem-independent

b) If you wish to use grub with reiser4, the grub package should be rebuild applying the reiser4 patch.

install-grub and menu.lst from Arch Linux CVS

pkgdesc="A GNU multiboot boot loader"
depends=('ncurses' 'libaal' 'reiser4progs' 'bash')

source=( \
  menu.lst install-grub)
md5sums=('c5a860a4cd81cffc95a3b9ca5624aa7b' '615101c2fc1bc2204be8eba33cfaf52c'\

build() {
  cd $startdir/src/$pkgname-$pkgver
# optimizations break the build -- disable them
  CFLAGS= ./configure --prefix=/usr --bindir=/bin --sbindir=/sbin
  CFLAGS= make || return 1
  make DESTDIR=$startdir/pkg install 
  install -D -m644 ../install-grub $startdir/pkg/sbin/install-grub
  install -D -m755 ../install-grub $startdir/pkg/sbin/install-grub
  mkdir -p $startdir/pkg/usr/share
  ln -s ../lib/grub $startdir/pkg/usr/share/grub

Install and reboot

You'll have to install the new packages, update you kernel and your bootloader, to make sure it works. Remember to run lilo as root if you choose it as bootloader.

Moving to Reiser4

In the next steps we'll copy the data to the new reiser4 partitions, so make sure you have enough disk space on hda2. You can check this disk information with df.

Sample system

* /dev/hda2: (10 Gb, 5 Gb free); Reiserfs /
* /dev/hda3: (10 Gb, 1 Gb used); Reiserfs /home
* /dev/hda4: (1 Gb);             swap


Next big thing is to make sure your /home directory is save:

(as root)

mkdir /backup
cp -R /home /backup

Once the /home directory is safely backed up (and there is no important data remaining on the hda3 partition), you can continue.


Run the following commands:

mkfs.reiser4 /dev/hda5
fsck.reiser4 --fix /dev/hda5
mkdir /reiser4
mount -t reiser4 /dev/hda5 /reiser4

I strongly recommend the amazing Cryptcompress plugin by formatting with the following command:

mkfs.reiser4 -o create=ccreg40,compress=lzo1 /dev/sdxx

Copy system

Once the partition is formated, copy you current system to the new partition and create the system directories:

# Copy the system
cp -a /bin /reiser4
cp -a /boot /reiser4
cp -a /etc /reiser4
cp -a /lib /reiser4
cp -a /opt /reiser4
cp -a /root /reiser4
cp -a /sbin /reiser4
cp -a /tmp /reiser4
cp -a /usr /reiser4
cp -a /var /reiser4

# Restore Backup
cp -a /backup/home /reiser4

#Mount points (check you fstab file)
mkdir /reiser4/mnt/cd
mkdir /reiser4/mnt/dvd

# Create system directories
mkdir /reiser4/sys
mkdir /reiser4/proc
mkdir /reiser4/dev

#Migrate Udev
mknod /reiser4/dev/console c 5 1
mknod -m 666 /reiser4/dev/null c 1 3
mknod -m 666 /reiser4/dev/zero c 1 5

Configure system:


# /etc/fstab: static file system information
# <file system>        <dir>         <type>    <options>          <dump> <pass>
none                   /dev/pts      devpts    defaults            0      0
none                   /dev/shm      tmpfs     defaults            0      0
tmpfs                  /tmp          tmpfs     defaults            0      0
usbfs                  /proc/bus/usb usbfs     defaults            0      0

/dev/cdroms/cdrom0     /mnt/cd   iso9660   ro,user,noauto,unhide   0      0
/dev/cdroms/cdrom0     /mnt/dvd  udf       ro,user,noauto,unhide   0      0

/dev/hda4              swap           swap      defaults           0      0
/dev/hda2              /boot          ext2      defaults           0      1
/dev/hda5              /              reiser4   defaults           0      1


# /etc/lilo.conf

# This line often fixes L40 errors on bootup
# disk=/dev/hda bios=0x80


        append="video=vesafb:1024x768-24@56,ywrap,mtrr splash=verbose,theme:darch console=tty1 resume2=swap:/dev/hdb1"

        append="video=vesafb:1024x768-24@56,ywrap,mtrr splash=verbose,theme:darch console=tty1 resume2=swap:/dev/hdb1"

Run lilo to install new kernels.


You are hopefully done now, you can reboot your system and try to run the 'new' reiser4 installation. If you plan to format /dev/hda3, make sure you run lilo or grub from the new system and configure them like above.

Possible Issues

  • Permissions: chown -R <userdir>
  • If you have problem with "su" command after the change of fs, you should reinstall coreutils package.
  • The first time you start the new system, no modules are loaded:
    • Run hwdetect --load-modules
    • Restart some daemons from /etc/rc.d
    • Everything works fine now and the next time you reboot.

External Links