Difference between revisions of "Reiser4"

From ArchWiki
Jump to navigation Jump to search
Line 3: Line 3:
  
 
''Contributed by Itlain and others''
 
''Contributed by Itlain and others''
 +
"Updated after a long time by ilikenwf"
  
 
{{stub}}
 
{{stub}}
  
 
==Short Introduction==
 
==Short Introduction==
Reiser4 is a new file system developed by [http://www.namesys.com/v4/v4.html Namesys]. It is a very fast file system (according to Namesys, the fastest). You can find [http://www.namesys.com/benchmarks.html 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."
+
Reiser4 is a new file system developed by Namesys (site now dead). It is a very fast file system (according to Namesys, the fastest) with such features as transparent compression with little to no extra processing cost. You can find [http://vizzzion.org/?id=reiser4 benchmarks] between the different file systems available on Linux. It is 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."
 +
 
 +
Since the original writing, this tutorial has been retooled to focus more on moving everything but /boot to Reiser4.
  
 
==Important Notes==
 
==Important Notes==
 
* Reiser4 requires a patched kernel
 
* 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
+
* If you're still using a 2.4 kernel, note that Reiser4 is developed for the 2.6 kernel and is not backported
 
* Reiser4 consumes a little more CPU than other filesystems
 
* Reiser4 consumes a little more CPU than other filesystems
 
* Be warned that Reiser4 is still not considered a stable release.
 
* Be warned that Reiser4 is still not considered a stable release.
  
 
==Required materials==
 
==Required materials==
* Recommended partitions:
 
 
- One empty partition for the new reiser4 system
 
  
- One small (12 - 20 MB) ext2 partition for /boot
+
* One empty partition for the new Reiser4 system
  
- ''Optional:'' reiser4 partitions for /home, /var, /home/user/temp and anything you want
+
* One small (12 - 200 MB) non-Reiser4 partition, such as ext2 for /boot
  
''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.''
+
* gparted is probably a necessity for resizing unless you want to use parted from the command line. Install to your Arch install, or just get the [ http://gparted.sourceforge.net/livecd.php LiveCD].
  
* Reiser4 enabled LiveCDs:
+
* A Reiser4 enabled LiveCD. Only a few are still in existance for some reason:
* Recovery Is Possible http://www.tux.org/pub/people/kent-robotti/looplinux/rip/
 
* The Jackass! project http://jackass.homelinux.org
 
* The Conrad project http://forums.gentoo.org/viewtopic-t-483382.html
 
* GParted offers a LiveCD or LiveUSB running X http://gparted.sourceforge.net/livecd.php
 
  
* Another LiveCD:
+
I highly reccomend the [http://rescuecd.pld-linux.org/ PLD RescueCD], as it seems to be one of the few in existance that still have working Reiser4 support. You will probably need Gparted's livecd as mentioned above too.
* Kanotix @ http://kanotix.com/files/kanotix/
 
  
 
==Packages==
 
==Packages==
''Note that you have to enable unstable and maybe testing repos to install some of this packages, uncommenting them in /etc/pacman.conf''
+
You will need to use '''yaourt''', since the unstable repo was recently emptied.
  
1.- Install '''reiser4progs''' from unstable
+
1. Install '''reiser4progs'''
<pre>pacman -Sy reiser4progs</pre>
+
<pre>yaourt -S reiser4progs</pre>
  
2.- You'll need a reiser4 patched kernel. I recommend you to install '''kernel26mm''' from unstable, or '''kernel26zen-git''' from AUR.
+
2. You'll need a reiser4 patched kernel. I recommend '''kernel26zen-git''' from AUR, but you could also try installing '''kernel26mm''' from the repos. Note that it seems the mainline kernels have had broken Reiser4 support in the recent past.
<pre>pacman -Sy kernel26mm</pre>
 
  
3.- Bootloader
+
<pre>yaourt -S kernel26zen-git</pre>
  
a) '''lilo''' is the recommended one because it is filesystem-independent
+
3. Bootloader
  
b) If you wish to use '''grub''' with reiser4, the grub package should be rebuild applying the reiser4 patch.
+
a) '''Reccomended:''' make a small (as mentioned above, 20-200mb) partition for /boot with a filesystem other than Reiser4 with gparted, and then copy your /boot folder to the partition. Update the menu.lst accordingly, making a new entry for your Reiser4 partition.
  
[http://cvs.archlinux.org/cgi-bin/viewcvs.cgi/*checkout*/base/grub/install-grub install-grub] and [http://cvs.archlinux.org/cgi-bin/viewcvs.cgi/*checkout*/base/grub/menu.lst menu.lst] from Arch Linux CVS
+
b) '''lilo''' is reccomended if you with to put everything including /boot on a Reiser4 partition. This is not advised, as you'll get an error when trying to update lilo.conf.
  
<pre>
+
c) If you wish to use '''grub''' with /boot residing on a Reiser4 partition, the grub package should be rebuilt applying the reiser4 patch. This site has a great guide, however I (ilikenwf) have tried this but failed.
pkgname=grub
 
pkgver=0.97
 
pkgrel=2
 
pkgdesc="A GNU multiboot boot loader"
 
url="http://www.gnu.org/software/grub/"
 
depends=('ncurses' 'libaal' 'reiser4progs' 'bash')
 
  
source=(ftp://ftp.namesys.com/pub/reiser4progs/grub-0.97-reiser4-20050808.tar.gz \
 
  menu.lst install-grub)
 
backup=('boot/grub/menu.lst')
 
md5sums=('c5a860a4cd81cffc95a3b9ca5624aa7b' '615101c2fc1bc2204be8eba33cfaf52c'\
 
        '4876f193005df5fca8ca9647729d1e23')
 
  
build() {
+
===Install and reboot===
  cd $startdir/src/$pkgname-$pkgver
+
You'll have to install the new packages, and update your kernel and your bootloader. Then, check and make sure it all works.
# 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
 
}
 
</pre>
 
  
===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.
 
Remember to run lilo as root if you choose it as bootloader.
  
 
==Moving to Reiser4==
 
==Moving to Reiser4==
In the next steps we'll copy the data to the new reiser4 partitions, so make
+
In the next steps we'll copy the data from your current root partition to the new Reiser4 partitions. Make
sure you have enough disk space on hda2. You can check this disk information with '''df'''.
+
sure you have enough disk space on the Reiser4 partition. You can check this disk information with '''df'''.
  
 
===Sample system===
 
===Sample system===
 
<pre>
 
<pre>
* /dev/hda2: (10 Gb, 5 Gb free); Reiserfs /
+
* /dev/hda1: (10 Gb, 5 Gb free); Reiserfs /mnt/reiser4
* /dev/hda3: (10 Gb, 1 Gb used); Reiserfs /home
+
* /dev/hda2: (10 Gb, 10 Gb free); Reiser4 /
* /dev/hda4: (1 Gb);             swap
+
* /dev/hda3: (200 Mb, 180 Mb free); ext2 /boot
 
</pre>
 
</pre>
  
===Backup===
+
===Formatting===
Next big thing is to make sure your /home directory is save:
+
Run the following commands:
  
(as root)
 
 
<pre>
 
<pre>
mkdir /backup
+
mkfs.reiser4 /dev/hda1
cp -R /home /backup
+
mkdir /mnt/reiser4
 +
mount -t reiser4 /dev/hda1 /mnt/reiser4
 
</pre>
 
</pre>
  
Once the /home directory is safely backed up (and there is no important data remaining on the hda3 partition), you can continue.
+
It is recommended that you use the amazing Cryptcompress plugin by formatting with the following command:
 
 
===Formating===
 
Run the following commands:
 
 
 
 
<pre>
 
<pre>
mkfs.reiser4 /dev/hda5
+
mkfs.reiser4 -o create=ccreg40,compress=lzo1 /dev/hda1
fsck.reiser4 --fix /dev/hda5
 
mkdir /reiser4
 
mount -t reiser4 /dev/hda5 /reiser4
 
 
</pre>
 
</pre>
  
I strongly recommend the amazing Cryptcompress plugin by formatting with the following command:
+
===Copy system===
 +
Once the partition is formated, copy you current system to the new partition and create the system directories. You may either do this from Archlinux, or '''to make it easier''' (so that you don't have to use makedev later), just '''boot up with the PLD Rescue CD and mount both your new Reiser4 partition and your current root partition. Then, just copy everything over (as root) like so:
 +
'''
 
<pre>
 
<pre>
mkfs.reiser4 -o create=ccreg40,compress=lzo1 /dev/sdxx
+
cd /mnt
 +
mkdir oldroot
 +
mkdir reiser4
 +
mount /dev/hda1 oldroot
 +
mount /dev/hda2 reiser4 (the Reiser4 partition)
 +
cp -R -a /mnt/oldroot/* /mnt/reiser4/
 
</pre>
 
</pre>
  
===Copy system===
+
Then, you need to mount your /boot partition, and if you haven't already, copy /boot from your original root partition over to it. Note that it is suggested you remove /boot from your new Reiser4 partition and then make an empty folder called boot in the root of the partition to use as a mountpoint for it, which is reflected later in your fstab.
Once the partition is formated, copy you current system to the new partition and create the system directories:
 
  
 
<pre>
 
<pre>
# Copy the system
+
mkdir bootpart
cp -a /bin /reiser4
+
mount /dev/hda3 bootpart
cp -a /boot /reiser4
+
cp -R -a /mnt/oldroot/boot/* /mnt/bootpart/
cp -a /etc /reiser4
+
</pre>
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
+
Don't forget to edit your bootloader's config appropriately (see examples at the bottom of the article).
cp -a /backup/home /reiser4
 
  
#Mount points (check you fstab file)
+
====/reiser4/etc/fstab:====
mkdir /reiser4/mnt/cd
 
mkdir /reiser4/mnt/dvd
 
 
 
# Create system directories
 
mkdir /reiser4/sys
 
mkdir /reiser4/proc
 
mkdir /reiser4/dev
 
  
#Migrate Udev
+
Note: If Reiser4 works out well for you, I'd (at least in the sample system) format the old root partition once everything is confirmed working with a stable fs and use it for storage.
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
 
</pre>
 
  
===Configure system:===
 
====/reiser4/etc/fstab:====
 
 
<pre>
 
<pre>
 
#  
 
#  
Line 169: Line 118:
 
/dev/cdroms/cdrom0    /mnt/dvd  udf      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/hda1             reiser4           defaults,noatime,nodiratime,notail           0      1
/dev/hda2              /boot          ext2     defaults          0      1
+
/dev/hda2              /mnt/storage        ext3     defaults          0      0
/dev/hda5             /              reiser4   defaults          0      1
+
/dev/hda3             /storage             ext2   defaults          0      1
 +
</pre>
 +
 
 +
 
 +
== Bootloader Examples ==
 +
 
 +
====/boot/grub/menu.lst:====
 +
(on ext2 /boot partition, mind you)
 +
 
 +
<pre>
 +
color light-blue/black light-cyan/blue
 +
timeout 0
 +
default 0
 +
 
 +
# (0) Arch Linux
 +
title  Arch Linux
 +
root  (hd0,1) '''# You will have to change this to appopriately point to your /boot partion'''
 +
kernel /boot/vmlinuz26zen '''root=/dev/sdaX''' ro noatime nodiratime notail acl init=/sbin/bootchartd
 +
initrd /boot/kernel26zen.img
 +
 
 +
# (1) Arch Linux
 +
title  Arch Linux Fallback
 +
root  (hd0,1)  '''# You will have to change this to appopriately point to your /boot partion'''
 +
kernel /boot/vmlinuz26 '''root=/dev/sdaX''' ro
 +
initrd /boot/kernel26.img
 +
 
 +
# (1) Windoze
 +
#title Windows
 +
#rootnoverify (hd0,1)  '''# You will have to change this to appopriately point to your /boot partion'''
 +
#makeactive
 +
#chainloader +1
 
</pre>
 
</pre>
  
Line 188: Line 167:
 
lba32
 
lba32
 
prompt
 
prompt
 +
compact
  
 
image=/boot/vmlinuz26beyond
 
image=/boot/vmlinuz26beyond
Line 219: Line 199:
  
 
==External Links==
 
==External Links==
* [http://www.namesys.com/v4/v4.html Reiser4 homepage]
 
 
* [http://en.wikipedia.org/wiki/Reiser4 Reiser4] from Wikipedia.org
 
* [http://en.wikipedia.org/wiki/Reiser4 Reiser4] from Wikipedia.org
* [http://www.namesys.com/install_v4.html Getting started with Reiser4] from Namesys.com
 

Revision as of 18:10, 19 August 2008


Contributed by Itlain and others "Updated after a long time by ilikenwf"


Short Introduction

Reiser4 is a new file system developed by Namesys (site now dead). It is a very fast file system (according to Namesys, the fastest) with such features as transparent compression with little to no extra processing cost. You can find benchmarks between the different file systems available on Linux. It is 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."

Since the original writing, this tutorial has been retooled to focus more on moving everything but /boot to Reiser4.

Important Notes

  • Reiser4 requires a patched kernel
  • If you're still using a 2.4 kernel, note that Reiser4 is developed for the 2.6 kernel and is not backported
  • Reiser4 consumes a little more CPU than other filesystems
  • Be warned that Reiser4 is still not considered a stable release.

Required materials

  • One empty partition for the new Reiser4 system
  • One small (12 - 200 MB) non-Reiser4 partition, such as ext2 for /boot
  • A Reiser4 enabled LiveCD. Only a few are still in existance for some reason:

I highly reccomend the PLD RescueCD, as it seems to be one of the few in existance that still have working Reiser4 support. You will probably need Gparted's livecd as mentioned above too.

Packages

You will need to use yaourt, since the unstable repo was recently emptied.

1. Install reiser4progs

yaourt -S reiser4progs

2. You'll need a reiser4 patched kernel. I recommend kernel26zen-git from AUR, but you could also try installing kernel26mm from the repos. Note that it seems the mainline kernels have had broken Reiser4 support in the recent past.

yaourt -S kernel26zen-git

3. Bootloader

a) Reccomended: make a small (as mentioned above, 20-200mb) partition for /boot with a filesystem other than Reiser4 with gparted, and then copy your /boot folder to the partition. Update the menu.lst accordingly, making a new entry for your Reiser4 partition.

b) lilo is reccomended if you with to put everything including /boot on a Reiser4 partition. This is not advised, as you'll get an error when trying to update lilo.conf.

c) If you wish to use grub with /boot residing on a Reiser4 partition, the grub package should be rebuilt applying the reiser4 patch. This site has a great guide, however I (ilikenwf) have tried this but failed.


Install and reboot

You'll have to install the new packages, and update your kernel and your bootloader. Then, check and make sure it all 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 from your current root partition to the new Reiser4 partitions. Make sure you have enough disk space on the Reiser4 partition. You can check this disk information with df.

Sample system

* /dev/hda1: (10 Gb, 5 Gb free); Reiserfs /mnt/reiser4
* /dev/hda2: (10 Gb, 10 Gb free); Reiser4 /
* /dev/hda3: (200 Mb, 180 Mb free); ext2 /boot

Formatting

Run the following commands:

mkfs.reiser4 /dev/hda1
mkdir /mnt/reiser4
mount -t reiser4 /dev/hda1 /mnt/reiser4

It is recommended that you use the amazing Cryptcompress plugin by formatting with the following command:

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

Copy system

Once the partition is formated, copy you current system to the new partition and create the system directories. You may either do this from Archlinux, or to make it easier (so that you don't have to use makedev later), just boot up with the PLD Rescue CD and mount both your new Reiser4 partition and your current root partition. Then, just copy everything over (as root) like so:

cd /mnt
mkdir oldroot
mkdir reiser4
mount /dev/hda1 oldroot
mount /dev/hda2 reiser4 (the Reiser4 partition)
cp -R -a /mnt/oldroot/* /mnt/reiser4/

Then, you need to mount your /boot partition, and if you haven't already, copy /boot from your original root partition over to it. Note that it is suggested you remove /boot from your new Reiser4 partition and then make an empty folder called boot in the root of the partition to use as a mountpoint for it, which is reflected later in your fstab.

mkdir bootpart
mount /dev/hda3 bootpart
cp -R -a /mnt/oldroot/boot/* /mnt/bootpart/

Don't forget to edit your bootloader's config appropriately (see examples at the bottom of the article).

/reiser4/etc/fstab:

Note: If Reiser4 works out well for you, I'd (at least in the sample system) format the old root partition once everything is confirmed working with a stable fs and use it for storage.

# 
# /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/hda1              reiser4           defaults,noatime,nodiratime,notail           0      1
/dev/hda2              /mnt/storage         ext3      defaults           0      0
/dev/hda3              /storage              ext2   defaults           0      1


Bootloader Examples

/boot/grub/menu.lst:

(on ext2 /boot partition, mind you)

color light-blue/black light-cyan/blue
timeout 0
default 0

# (0) Arch Linux
title  Arch Linux
root   (hd0,1) '''# You will have to change this to appopriately point to your /boot partion'''
kernel /boot/vmlinuz26zen '''root=/dev/sdaX''' ro noatime nodiratime notail acl init=/sbin/bootchartd
initrd /boot/kernel26zen.img

# (1) Arch Linux
title  Arch Linux Fallback
root   (hd0,1)  '''# You will have to change this to appopriately point to your /boot partion'''
kernel /boot/vmlinuz26 '''root=/dev/sdaX''' ro
initrd /boot/kernel26.img

# (1) Windoze
#title Windows
#rootnoverify (hd0,1)  '''# You will have to change this to appopriately point to your /boot partion'''
#makeactive
#chainloader +1

/etc/lilo.conf:

#
# /etc/lilo.conf
#

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

default=Arch4
timeout=20
lba32
prompt
compact

image=/boot/vmlinuz26beyond
        label=Arch4
        root=/dev/hda5
        append="video=vesafb:1024x768-24@56,ywrap,mtrr splash=verbose,theme:darch console=tty1 resume2=swap:/dev/hdb1"
initrd=/boot/initramfs-beyond.img
read-only

image=/boot/vmlinuz26beyond
        label=Arch
        root=/dev/hda3
        append="video=vesafb:1024x768-24@56,ywrap,mtrr splash=verbose,theme:darch console=tty1 resume2=swap:/dev/hdb1"
initrd=/boot/initramfs-beyond.img
read-only

Run lilo to install new kernels.

Done

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 username.group <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