Skip to Content.
Sympa Menu

sm-discuss - [SM-Discuss] Success with raidtools and jfs...

sm-discuss AT lists.ibiblio.org

Subject: Public SourceMage Discussion List

List archive

Chronological Thread  
  • From: "Wyatt Draggoo" <wyatt AT draggoo.com>
  • To: sm-discuss AT lists.ibiblio.org
  • Subject: [SM-Discuss] Success with raidtools and jfs...
  • Date: Sun, 12 Jan 2003 22:14:34 -0800 (PST)

Just thought I'd report in that running jfs over RAID 1 (mirrored) drives
is possible. Took a few steps to get there from the SMGL ISO:

First, I have two identical disks, partitioned exactly the same. I
actually break a lot more out, but to simplify things, let's go for:

hd[ab]1 32MB (/boot)
hd[ab]2 512MB (swap)
hd[ab]3 8.5BG (/)

During your normal install from the ISO, use ext2, and install everything
on hda. I've got the swap partitions on both drives active, for a total of
1GB of swap, which automatically gets striped between the disks.

After you have SMGL installed and booted, and compile the 2.4.20 kernel
with jfs and raid1 added in. Reboot to this kernel. You will also have to
cast raidtools. This spell needs to be updated, but it will work if you
cast popt first (raidtools now depends on popt), and change the version to
20010914, and the download URL to
http://people.redhat.com/mingo/$SPELL-$VERSION.tar.gz and then cast it.

Now, make an ext2 filesystem on hdb1, and a jfs filesystem on hdb3. Make a
temporary mount for the new root (I used /tmp/root), mount hdb3 on it, and
make directories for proc, devices, tmp and boot under that. Mount hdb1 on
/mnt/root/boot. Next, create a file called exclude under /tmp that
contains these three lines:

tmp
devices
proc

Finally, move everything over to the new root with:
# cd /
# tar cpfX - /tmp/exclude . | (cd /tmp/root; tar xpf -)

And wait for a while. (Those who wish to watch can use xpvf on the second
tar...).

Edit the /tmp/root/etc/fstab file, and change disc0 to disc1 for the / and
/boot mounts, change / from ext2 to jfs, and remove the notail option (jfs
doesn't like it). Now, change your /etc/lilo.conf so that the root= line
is part of each entry, as opposed to in the global area. Create a new
entry that points root to /devices/discs/disc1/part3, call it something
like linux-jfs, write it and run lilo to make the changes. Copy this file
to /tmp/root/etc, umount /tmp/root/boot, and then /tmp/root, and reboot.
If everything went smoothly, you should be able to choose linux-jfs, and
have a working system booting from your second hard drive.

Now, take a break. You've earned it.

Next, create a file called /etc/raidtab like this:

raiddev /dev/md3
raid-level 1
nr-raid-disks 2
nr-spare-disks 0
chunk-size 4
persistent-superblock 1
device /dev/sda3
raid-disk 0
device /dev/sdb3
raid-disk 1
failed-disk 1

Note that last failed-disk directive! This tells the RAID system that the
second disk has failed, so don't do anything with it. This creates the
RAID in degraded mode, so it doesn't destroy anything on hdb3, which we're
running off of at the moment.

Now, run mkraid /dev/md3. It should create the device. You can cat
/proc/mdstat to make sure. Next, we have to copy everything back on to
hda. So, create a jfs filesystem on /dev/md3, and mount it as /tmp/root.
Create those same directories you did above, and mount /dev/hda1 as
/tmp/root/boot again. Repeat the above tar command, edit the fstab to
point / to /dev/md3, and edit lilo.conf to do the same---don't forget to
run lilo. Finally, run raidstop /dev/md3 to stop the raid system, run
fdisk on /dev/hda, and change the type for hda3 to fd, which is the linux
RAID autodetect type.

Once again, reboot (this is starting to sound like a Windows install...).
And, once again, if everything worked, you are now running on your degraded
RAID1 system. If a mount shows / mounted from /dev/md3, you're all set!
The only thing left to do is run raidhotadd /dev/md3 /dev/hdb3, to add your
now-unnecessary second boot drive to the mirror, and wait for it to sync
up. Check /proc/mdstat to see how this is progressing.

That's it! Not too bad, eh? The final mounts on my system are:

/dev/hda1 /boot
/dev/hda2 swap
/dev/hdb2 swap
/dev/md3 /
/dev/md5 /var
/dev/md6 /usr
/dev/md7 /export

I like to name the md devices the same as their partitions were. md4 was
skipped because hd[ab]4 are my extended partition on the drives.

For more information on RAID devices, look at the Software-RAID-HOWTO at:
http://www.ibiblio.org/pub/Linux/docs/HOWTO/Software-RAID-HOWTO

Wyatt

--
Wyatt Draggoo




Archive powered by MHonArc 2.6.24.

Top of Page