Free Web Space | BlueHost Review  


Installing GRUB on a Reiser4 Partition.

This article guides you through the compilation of a Reiser4 understanding GRUB.

Boot, the Reiser4 partition that you wish to make your GRUB default root. If you have followed the guide to installing a Linux distro on a Reiser4 partition, this will be /dev/sda3. If you have enabled transparent compression, the following will not work.

Download the following files and save them somewhere, like /grub.

grub-0.97.tar.gz from
libaal-1.0.5.tar.gz from, local copy here,
reiser4progs-1.0.5.tar.gz (not version 1.0.6) from, local copy here,
grub-0.97-libaal-1.0.5-reiser4progs-1.0.5.patch.bz2 (this is a combination of many patches).

 cd /grub

Unpackage everything.

 for a in *.tar.*; do tar -xf $a; done
 bunzip2 grub-0.97-libaal-1.0.5-reiser4progs-1.0.5.patch.bz2

If like me, you are compiling on a 64-bit machine, then you will need to set the variable CC:

 export CC="gcc -m32"

and, if you have followed the above mentioned guide, you already have 64-bit versions of the aal libraries and reiser4progs in /usr/local/. To make sure things do not get mixed up, you need to install to some other destination, eg, /grub/r4. This is done by passing the --prefix=/grub/r4 flag to the configure script.

This is necessary, even if compiling on a 32-bit box. This is because you have the 1.0.6 version of reiser4progs in /usr/local/, but you need to use the 1.0.5 version of reiser4progs to compile GRUB. Once again, you have to keep the different versions separate.

To stop the precompiler and linker using the wrong headers and libraries we add:

 export LDFLAGS=-L/grub/r4/lib CPPFLAGS=-I/grub/r4/include

Also, the grub configuration (below) needs to know where we have put things:

Now compile the aal libraries and install them in /grub/r4 (ie, set prefix=/grub/r4).

 cd /grub/libaal-1.0.5
 ./configure --prefix=/grub/r4
 make install

Now compile the older version of reiser4progs and install in /grub/r4.

 cd /grub/reiser4progs-1.0.5
 ./configure --prefix=/grub/r4
 make install

 cd /grub/grub-0.97

Patch grub for Reiser4.

 patch -p1 < ../grub-0.97-libaal-1.0.5-reiser4progs-1.0.5.patch

 ./configure --prefix=/usr

Note the prefix, /usr. Check that grub has built OK.

 ls /grub/grub-0.97/stage2/*1_5

You should see the files e2fs_stage1_5 fat_stage1_5 ffs_stage1_5 iso9660_stage1_5 jfs_stage1_5 minix_stage1_5 reiser4_stage1_5 reiserfs_stage1_5 ufs2_stage1_5 vstafs_stage1_5 xfs_stage1_5.

If things look OK, then go ahead and OVERWRITE the existing grub programs. Remember, this partition is not presently used to boot your system, and will only be used to boot your system, if the instalation succeeds. Still, whenever dealing with GRUB, it would pay to have a rescue CD/floppy handy (actually, GRUB has always worked like a charm for me).

 make install

Now run grub-install.

 /usr/sbin/grub-install /dev/sda

Remember to change /dev/sda to suit your situation.

The above command sets the booted partition as the default GRUB root (and installs stage1 to the MBR). With the partition numbering of this guide, the default GRUB root will now be /dev/sda3 (it was initially /dev/sda2). The default GRUB root is the partition that GRUB reads the menu list file, /boot/grub/menu.lst, from.

 emacs /boot/grub/menu.lst &

Now adjust the menu.lst file on /dev/sda3:

title	Debian GNU/Linux -- My New Kernel 2.6.23 for Reiser4
root	(hd0,2)
kernel	/boot/vmlinuz-2.6.23 root=/dev/sda3 ro 
initrd	/boot/initrd.img-2.6.23

Note, that this is not the same menu.lst file as in the Linux installation guide (that was on /dev/sda2).

Now, reboot and see how things panned out.


Some md5sums:

cd3f3eb54446be6003156158d51f4884  grub-0.97.tar.gz
6c55201acd2a2c0a1f46addf248da6a2  libaal-1.0.5.tar.gz
b0756831e16b2395d5f443526d640792  reiser4progs-1.0.5.tar.gz
ef539be14a0998f40e0e41c4e63c46ac  reiser4progs-1.0.6.tar.gz
083e08e930202b45eff46745f5c707c5  grub-0.97-libaal-1.0.5-reiser4progs-1.0.5.patch.bz2

12b211e1a2eb3e395a70fb1b7d981fb7  libaal-1.0.5.tar.bz2
e601074ed1b285ae17de58f196e2602d  reiser4progs-1.0.5.tar.bz2
183ad6cd34ee6a137838849673aca90e  reiser4progs-1.0.6.tar.bz2
ff73edc9951761a733754eb7c9bbf215  reiser4-for-2.6.20.patch.bz2
b27bcea7f7beaffa31f65992edc9931f  reiser4-for-2.6.21.patch.bz2
9f0e07e8381b3e5bff3798c104322b12  reiser4-for-2.6.22.patch.bz2
cfa76cc31f8756165c6ea9a5cf14fb23  reiser4-for-2.6.23.patch.bz2