Reiser4

From ArchWiki
Revision as of 04:56, 24 July 2005 by SleepyDog (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Reiser4 File System Howto

Contributed by Itlain

This is my first attempt at using a wiki so bear with me please. Feel free to make any corrections to whatever. This should be a community effort. The following is what worked for me flawlessly the first time. Be warned that Reiser4 is still not considered a stable release. You will be required to patch your kernel.

NOTE: if you need a reiser4 enabled livecd (you just might!) the check these out - http://lxnay.dnsalias.org/livecd-iso/index.php - the last two are a very small download considering their useful reiser4 tools!

Reiser4 info can be found at:

http://www.namesys.com/v4/v4.html

To upgrade to Reiser4 there are 3 main things that you will need before you attempt the process. They are as follows:

libaal

ftp://ftp.namesys.com/pub/reiser4progs/libaal-1.0.2.tar.gz
mirror: http://ftp.roedu.net/pub/mirrors/ftp.namesys.com/pub/reiser4progs/libaal-1.0.2.tar.gz

PKGBUILD

pkgname=libaal
pkgver=1.0.3
pkgrel=1
pkgdesc=\"libaal\"
url=\"http://www.namesys.com\"
depends=()
install=
source=(ftp://ftp.namesys.com/pub/reiser4progs/$pkgname-$pkgver.tar.gz)
md5sums=('78b06fcea858031c776f99628c4f7376')

build() {
  cd $startdir/src/$pkgname-$pkgver
  ./configure --prefix=/usr
  # if you wish to add GRUB reiser4 functionality, use the next configure instead :
  #./configure --prefix=/usr --enable-libminimal
  make ||| return 1
  make prefix=$startdir/pkg/usr install
}

reiser4progs

ftp://ftp.namesys.com/pub/reiser4progs/reiser4progs-1.0.2.tar.gz
mirror: http://ftp.roedu.net/pub/mirrors/ftp.namesys.com/pub/reiser4progs/reiser4progs-1.0.2.tar.gz

PKGBUILD

pkgname=reiser4progs
pkgver=1.0.3
pkgrel=1
pkgdesc=\"Reiser4 filesystem programs\"
url=\"http://www.namesys.com/v4/v4.html\"
depends=('e2fsprogs' 'libaal')
source=(ftp://ftp.namesys.com/pub/reiser4progs/$pkgname-$pkgver.tar.gz)
license=\"\"
md5sums=('9b0bb224aa592809448390d4cf1b88e9')

build() {
  cd $startdir/src/$pkgname-$pkgver
  ./configure --prefix=/usr
  # if you wish to add GRUB reiser4 functionality, use the next configure instead :
  #./configure --prefix=/usr --enable-libminimal
  make ||| return 1
  make prefix=$startdir/pkg/usr install
}

grub

if you wish to use grub with reiser4, the grub package should also be rebuild with applying the reiser4 patch.

ftp://alpha.gnu.org/gnu/grub/grub-0.95.tar.gz

PKGBUILD

pkgname=grub
pkgver=0.95
pkgrel=2
pkgdesc=\"A GNU multiboot boot loader\"
url=\"http://www.gnu.org/software/grub/\"
depends=('ncurses' 'libaal' 'reiser4progs' 'bash')
source=(ftp://alpha.gnu.org/gnu/grub/grub-$pkgver.tar.gz \
  menu.lst install-grub \
  'ftp://ftp.namesys.com/pub/reiser4progs/grub/LATEST_PATCH')
backup=('boot/grub/menu.lst')
md5sums=('4ca8e4363d5f1980f2c63b7f5cdbe0d1' '3f0e8e1615769b3368b5ae2dbfbb986b'\
         '3b108306c5e76968de9dc01216ba1ef7' '64406c6a858eb79761ac4a1a45122380')

build() {
  cd $startdir/src/$pkgname-$pkgver
  patch -Np1 -i ../LATEST_PATCH ||| return 1
# optimizations break the build -- disable them
  CFLAGS<code> ./configure --prefix</code>/usr --bindir<code>/bin --sbindir</code>/sbin
  CFLAGS= make ||| return 1
  make prefix<code>$startdir/pkg/usr bindir</code>$startdir/pkg/bin \
    sbindir=$startdir/pkg/sbin install
  mkdir -p $startdir/pkg/boot/grub
  cp ../menu.lst $startdir/pkg/boot/grub
  install -m755 -D ../install-grub $startdir/pkg/sbin/install-grub
}

Kernel Patch

You will also need to compile a new kernel with the patches. There are two ways to do this. The way that I would recommend is to download a vanilla 2.6.9 kernel. The patch that I used to update my kernel can be found here:

http://members.optusnet.com.au/ckolivas/kernel/

After downloading both the kernel and the patch extract both to /usr/src.

Execute the following commands:

>>  cd /usr/src/linux-2.6.9
>>  patch -p1 < patch-2.6.9-ck2

The patch should install with no rejects or complaints.

If you don't want to use the -ck patch, you can also patch directly from: ftp://ftp.namesys.com/pub/reiser4-for-2.6/2.6.9/

>> zcat reiser4-for-2.6.9-2.gz || patch -p1
or
>> gunzip -d reiser4-for-2.6.9-2.gz
>> patch -p1 < reiser4-for-2.6.9-2

Once this is done simply config and compile your new kernel. Ensure that you enable the following:

CONFIG_REISER4_FS=y
CONFIG_REISER4_LARGE_KEY=y

You also have to ensure that under kernel hacking that 4k stacks are NOT enabled. You will get an error if you attempt. Once the kernel is compiled ensure you do a make modules and a make modules_install.

Next up came the backing up of my current system. My system was configured as the following:

  • /dev/hda2 was my current Reiser3 / partition
  • /dev/hda3 was my current Reiser3 /home partition
  • /dev/hda4 was my swap partition


I executed the following command as root:

>> cp -R /home /hometmp

Once my /home directory was safely backed up I made the Reiser4 partition with the following commands:

>> mkfs.reiser4 /dev/hda3
>> mkdir /reiser4
>> mount -t reiser4 /dev/hda3 /reiser4

Now that my partition was mounted I proceded to copy my current system over to my new Reiser4 partition with the following:

>>  mkdir /reiser4/dev
>>  mkdir /reiser4/proc
>>  cp -a /etc /reiser4
>>  cp -a /bin /reiser4
>>  cp -a /var /reiser4
>>  cp -a /hometmp /reiser4
>>  cp -a /usr /reiser4
>>  cp -a /lib /reiser4
>>  cp -a /root /reiser4
>>  cp -a /boot /reiser4
>>  cp -a /tmp /reiser4
>>  cp -a /sbin /reiser4
>>  mkdir /reiser4/sys

Make sure too that you copy any other files or directories that you want to the new partition. Next I had to adjust my /etc/fstab and my /etc/lilo.conf

First off is my new lilo.conf
<pre>
boot=/dev/hda
default=reiser4                  # Change my default boot partition to my new Reiser4
timeout=50
lba32
compact
prompt
image=/boot/arch
        label=arch               # My old reiser3 arch installation
        root=/dev/hda2
        read-only
        append<code>\"devfs</code>nomount\"   # Notice I use udev. Don't add this line if you use devfs or you will have problems
image=/boot/reiser4arch
        label=reiser4            # My new reiser4 partition
        read-only
        root=/dev/hda3           # Notice this used to be my /home partition.
        append<code>\"devfs</code>nomount\"
other=/dev/hda1
        label=dos                # What can I say. Need it for work :)

~# End of file

And my /etc/fstab

none                   /proc         proc      defaults            0      0
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/cdrom   /mnt/cd   iso9660   ro,user,noauto,unhide   0      0
/dev/dvd     /mnt/dvd  udf       ro,user,noauto,unhide   0      0

/dev/hda4 swap swap defaults 0 0
#/dev/hda2 / reiserfs defaults 0 0             # I commented out my old installation that was my root partition
/dev/hda3 / reiser4 defaults 0 0               # Changed my /home partition to my root and changed the type to reiser4

Once this one done I re-ran lilo to install my new kernels.

I then rebooted into my new system with no problems whatsoever.
Log in as root and execute the following:

>> mv /hometmp /home
>> cd /home
>> chown -R username.group <userdir>         # Changes ownership back to each user. Otherwise you will have problems
                                             # Mine for example was \"chown -R itlain.users itlain\"

I then logged out as root and back in as my regular user and started X back up. So far everything works great and I don't expect any problems from the changeover.
My todo list is however to move my old root partition to my new /home partition to seperate the 2.

I was pretty happy with the whole thing. If you have any questions or comments I'm usually on the irc channel