![]() |
From: Collins Richey <erichey2@home.com>
I'm having a blast using reiserfs. Now at least I can quit from the gui without danger of destroying the filesystem.
==================
If you, like I, have wanted to experiment with reiserfs - the hot new journaling filesystem - and you don't want to wait for a distribution that allows reiserfs as an install option, here's your chance.
The following has been tested on Sibyl (Caldera OpenLinux Workstation Beta 3.1) with the 2.4.3 kernel, but you could achieve similar results on a different platform - just get the appropriate patches for your kernel.
The procedure below will create a clone of your current system on a reiserfs partition or partitions. It really works. I took a powerfail after creating my new reiserfs directories. My ex2fs system took 10 minutes to fsck, but the reiserfs partition mounted with no delays and no data loss.
Preparation
-----------
1. A little bedtime reading. www.namesys.com (the official
reiserfs site)
(you'll need this one for the downloads)
Also you may want to review www.gentoo.org (a barebones
distro that uses reiserfs)
There is some useful material. I actually created this system,
but it's too raw for my use.
2. Find a spare partition (or two in my case). note your partitions here ____________________________________
change my /dev/hdd1 (optional) and /dev/hdd7 references below to match yours
3. Download the 2.4.3 kernel source (your favorite site)
4. Download the linux-2.4.3-knfsd-6.g.patch.gz (recommended
for 2.4.3) (from
www.namesys.com
)
5. Download the latest reiserfsprogs (3.x.oj) (from
www.namesys.com)
6. Allow yourself 1-2 hours for the procedure (includes two
reboots)
First get reiserfs properly installed
-------------------------------------
I chose not to rely on the standard Sibyl kernel;YMMV.
1) su
2) unpack the kernel sources in your home directory, ie
bzcat KERNELSOURCE.bz2 | tar xvf
3) rename the kernel source
mv linux linux-2.4.3
4) copy the reiserfs patch to the linux-2.4.3 directory
5) to be safe
mv /lib/modules/2.4.2 /lib/modules/old-2.4.2 (ore whatever
version you have)
rm /lib/modules/2.4.3 (if you've done 2.4.3 before, or rename
it if you like)
there are now no module libraries to confuse the kernel build
6) apply the patch
cd linux-2.4.3
gzip -d linux-2.4.3-knfsd-6.g.patch.gz | patch -p0
7) build the kernel
make mrproper
xxxconfig (be sure to select reiserfs support!!!)
make dep && make clean && make install
&& make modules && make
modules_install
cp arch/i386/boot/bzImage /boot/yourname (use anything you
want)
8) update your grub menu.lst (you're on your own with lilo) add a new boot sequence just like your current, but use yourname for the kernel (as named above)
9) unpack the reiserfsprogs in your home directory amd
install cd /home/collins
tar xvfz reiserfsprogs-3.x.0j.tar.gz
cd reiserfsprogs-3.x.0j
./configure
make
make install
10) put back the 2.4.2 modules info (in case things go bang)
mv /lib/modules/old-2.4.2 /lib/modules/2.4.2
the kernel build already created /lib/modules/2.4.3
11) reboot now
12) fix any kernel compile problems and redo if necessary (I
didn't have any
problems)
Clone your system to a reiserfs partiton (or partitions)
--------------------------------------------------------
Now running from 2.4.3 kernel with reiserfs support compiled in!!!
1) select an unused partition (or partitions) (at least as
large as the used
space in your current system.
I used
/dev/hdd1 for /boot (omit if not using a /boot partition)
/dev/hdd7 for /
2) su
3) make the new filesystems (surprise - reiser will prompt
you for overwrite)
mkreiserfs /dev/hdd7
mkreiserfs /dev/hdd1
(omit if not using boot partition)
4) mount the reiserfs root partition (you may need a new
mount point
directory)
mount -t reiserfs /dev/hdd7 /mnt/hdd7
5) create the directory structure in your new root partition
cd /mnt/hdd7
execute the following script (these are the root directories
for Sibyl, yours
may vary).
#!/bin/bash
mkdir auto
mkdir bin
mkdir boot
mkdir dev
mkdir etc
mkdir export
mkdir home
mkdir initrd
mkdir install
mkdir lib
mkdir man
mkdir mnt
mkdir opt
mkdir proc
mkdir root
mkdir sbin
mkdir srv
mkdir temp
chmod 1777 temp
mkdir tftpboot
mkdir tmp
chmod 1777 tmp
mkdir usr
mkdir var
6) mount your boot partition now (omit if not using)
mount -t reiserfs /dev/hdd1 /mnt/hdd7/boot -o notail
(the notail option is important, but I don't know all the
details.)
7) copy your stuff to the new reiserfs (note /proc must be
omitted).
I used the following script.
Expect errors for empty directories
#!/bin/bash
cp -a /bin/* /mnt/hdd7/bin
cp -a /boot/* /mnt/hdd7/boot
cp -a /dev/* /mnt/hdd7/dev
cp -a /etc/* /mnt/hdd7/etc
cp -a /home/* /mnt/hdd7/home
cp -a /initrd/* /mnt/hdd7/initrd
cp -a /install/* /mnt/hdd7/install
cp -a /lib/* /mnt/hdd7/lib
cp -a /man/* /mnt/hdd7/man
cp -a /opt/* /mnt/hdd7/opt
cp -a /root/* /mnt/hdd7/root
cp -a /sbin/* /mnt/hdd7/sbin
cp -a /srv/* /mnt/hdd7/srv
cp -a /tftpboot/* /mnt/hdd7/tftpboot
cp -a /usr/* /mnt/hdd7/usr
cp -a /var/* /mnt/hdd7/var
8) Fix /etc/fstab in the new filelsystem. You need to remove
the line(s) for
your old root (and boot) partitions and add the new
one(s).
cd /mnt/hdd7/etc
vi fstab
put in this entry (these entries)
/dev/hdd7 / reiserfs defaults 1 1
/dev/hdd1 /boot reiserfs defaults,notail 0 0
(omit this if you don't use a /boot partition)
:wq
9) unmount the reiserfs partition(s)
umount /mnt/hdda7/boot
(omit if not using a boot partition)
umount /mnt/hdd7
10) update your grub menu.lst (you're on your own with
lilo)
add a new boot sequence for your new partition(s) using
yourname (as named
above) for the kernel
there isn't anything unique about booting from reiserfs in the
menu.lst
11) reboot and enjoy
======================
--
Collins Richey
Denver Area
Sybil test system (reiserfs)