Simply instruction on how I managed to install gentoo onto a reiser4 partiton.
This is not for beginers! I will assume you have a good understanding of linux, and are capable of more advanced things, such as patching, configureing, compiling and installing a kernel from source without much (if any) instruction.
Currently, no install CD's support the reiser4 fileing system, so we have to do some interesting juggling.
This will describe how i did this with the GNU distro "Gentoo" but there is no reason wh yit could not be performed on any other linux distro.
but first.. a disclaimer..
Notice from qwijibow:
I take no responcibility for any data lost.
You follow this instruction at your own risk
You follow this instruction at your own risk
~~~~~~~~~~~~~~~~~~~~~~~~~~~
PART1:
~~~~~~~~~~~~~~~~~~~~~~~~~~~
The partiton table. we will need to following partitons.
1) OPTIONAL: dual boot partiton (with windowsXP installed ?)
2) boot partiton (100 mb)
3) root partiton (big as possable, minus windows partiton and installer/home partiton sizes)
4) installer_partiton (must be at least 1.5 gig)
5) swap partiton (between 256 mb and 1 gig)
the installer partiton will be used to install the linux that we will use to install linux to the main root partiton.
Think of the installer partiton as a custom made install CD, that supports reiser4.
After the install is complete, we will use this install partiton as a /home/ partiton, so the space is not wasted.
if you keep alot of data in your home partiton, you may want to make it bigger than the minimal 1.5 GIG.
Follow your normal install procedure for your fave distro, select a MINIMAL INSTALL, do not install anything you dont need, no not install X, or KDE, or GNOME, or anything, all you need is a bootable partiton and a compiler ! (gcc must be installed, but NOT KERNEL SOURCE CODE)
When you get to the part of the installer where you must setup the disk, DO NOT use automatic partitons, selct custom partiton, and partiton as described a the start of PART 1.
select the installer partiton as the root partiton for this install, make sure the boot partiton is selected for use, and mount points are all correct.
~~~~~~~~~~~~~~~~~~~~~~~~~~~
PART2:
~~~~~~~~~~~~~~~~~~~~~~~~~~~
by now, you have installed a minmial linux distro (with gcc compiler) to your smaller 1.5 gig installer partiton, and you have sucessfully booted it.
In this Section, we will patch the kernel, and install reiser4 utilities.
Thus allowing us to start using the reiser4 file system.
now, goto kernel.org and download the latest 2.6 vanilla kernel, and the -mm patch set.
unpack the source code to /usr/src/
rename the source directory from linux-2.6.X to linux-2.6.x-mm.
cd into the directory and apply the patch.
CODE
gzcat /path/to/mm-patch | patch --dry-run -p1 &&
gzcat /path/to/mm-patch | patch -p1
if the above command fails to patch the kernel, try with -p0 instead of -p1.
if that doesnt help, you are trying to patch in-ocmpatable versions.. the versions MUST match !
compile the newly patched kernel, somthing like
CODE
cp /boot/Config-X ./.config
make oldconfig
make menuconfig
# (at this point, select file-systems --> and select Reiser4 as '*' (not M or blank)
make
make modules_install
cp ./arch/x86_64/boot/bzImage /boot/bzImage-mm
edit /boot/grub/menu.lst to boot bzImage-mm instead of whatever your distro placed by default.
REBOOT !
now install "reiser4progs" package for your distro, gentoo users "emerge reiser4progs".
for different distro's, google for a pre-compiled package, or get thesource code and compile yourself from http://www.namesys.com/v4/v4.html
~~~~~~~~~~~~~~~~~~~~~~~~~~~
PART3:
~~~~~~~~~~~~~~~~~~~~~~~~~~~
Now we are in a reiser4 enabled linux distro, all we need to do now is to place it on a reiser4 partition.
format our main root as reiser4.
CODE
mkfs.reiser4 /dev/hdaX
replace X with the partiton number of the main root.
now there is a split, Gentoo users have a choice, all other distro's must go with PART-3A.
In Part 3A, we will simply copy our current root onto the reiser4 partiton.
This is quick, but can be tricky, and will cause 1 or 2 small problems on the first boot, for example lock files that need to be deleted.
The alternative for Gentoo users, is to folow a fresh install on the reiser4 partiton, this is more simple, and problem free, but will take a little longer.
~~~~~~~~~~~~~~~~~~~~~~~~~~~
PART-3A:
~~~~~~~~~~~~~~~~~~~~~~~~~~~
Move our current distro, onto the reiser4 partiton.
make 2 new directory's.
CODE
mkdir /reiser4_root
mkdir /source_root
mount the current root to source, and the reiser4 partiton to reiser4 root.
CODE
mount /dev/hdaX /reiser4_root
mount /dev/hdaY /source_root
perform the copy.
CODE
cp -a /source_root/* /reiser4_root/
~~~~~~~~~~~~~~~~~~~~~~~~~~~
PART-3B:
~~~~~~~~~~~~~~~~~~~~~~~~~~~
start a new install on the reiser4 partiton.
Folow normal gentoo installation except for the part about the kernel install and configure.
when it comes to this, simply copy over the source code, and kernel modules from the installer-partiton.
no need to copy the kernel itself, because we are using a seperate boot partiton remember !
CODE
cp -a /lib/modules /mnt/gentoo/lib/
cp -a /usr/src/linux-X-mm /mnt/gentoo/usr/src/
~~~~~~~~~~~~~~~~~~~~~~~~~~~
PART-4:
~~~~~~~~~~~~~~~~~~~~~~~~~~~
make the new root partiton bootable.
you will now need to update the partiton numbers to the new root in /boot/brub/menu.lst
make sure to also alter the root=/dev/hdaX parameter on the kernel line !!!
Modify the /reiser4_root/etc/fstab to make the reiser4 partiton root, and make the old root /home/
REBOOT.
format the installer root as reiser4, and edit sftab to make its new mount point /home/.
mount it or reboot before you start to add non-root users.
FINISHED !!!
If you chose option Part 3A, you will expeciance problems dureing the first boot,
this is because of certain lock files which are created, but never deleted, as a bi-product of making a copy of a currently running root partiton.
you will need to hunt these files down, and manually delete them.
ENJOY !
post any qustions you may have here, i will try to anywer them the best i can.

