How-to for dmraid OS drive(s)?
weichuan.lin at intel.com
Tue Aug 23 00:57:32 UTC 2005
>From: ataraid-list-bounces at redhat.com [mailto:ataraid-list-
>bounces at redhat.com] On Behalf Of Steve S.
>Sent: Monday, August 22, 2005 10:06 PM
>To: ataraid-list at redhat.com
>Subject: How-to for dmraid OS drive(s)?
>Can anyone point me to a step-by-step guide to putting the OS (Fedora
>Core 4 in my case) on a dmraid mirror? I currently have the OS on a
>pair of failing ATA drives and dmraid sees the new drives no problem.
>Specifically, I've seen references on this list and elsewhere to having
>to customize init scripts and (potentially) patching grub to make this
>Ah, and if anyone can point me to a best-practice guide to migrating
>the data incl. the OS from the old drives to the new, that would be
>too. I'm sure I could fumble my way through it on my own, but I'd
>rather do it the "right" way.
>Is lvm with dmraid an impossibility? My apologies if these questions
>have been answered already -- but I have done a lot of searching on
>(through this list, google searches, etc.) with very little results.
On my SIL 3114 chip, I have successfully migrated a system to raid, here
is the operation step:
Steps to port an existed system to SATA RAID:
1. Prepare an auxiliary hard disk with a system installed, for
2. Make Stripe (RAID 0) with the help of utility of Silicon Image at
the stage right after Power on self test and before the start of grub.
3. Boot up the EL4 host on the auxiliary hard disk.
4. Active the RAID with the help of dmraid, and the new device called
/dev/dm-0 can be seen.
5. Use fdisk or parted to slice hard disk partitions on device of
/dev/dm-0. Typically one for /boot, the other on for swap, and the last
one for /, don't forget to active boot flag of the partition for /boot.
After doing that, device called /dev/dm-1, /dev/dm-2 and /dev/dm-3 can
be seen, also device mapper under /dev/mapper appears. For controller of
SIL 3114 CTU, there are sil_afageidcdibjb and sil_afageidcdibjb1 etc.
6. Make file system on /dev/dm-1 and /dev/dm-3 with the utility of
7. Mount /dev/dm-1 foo and mount /dev/dm-3 bar.
8. Copy all files under /boot to foo and files under / to bar, with
cp -au, like cp -au /boot foo. For the copying of /, the top level
directories need to be copied separately to exclude the mount point of
/dev/dm-1 and mount point of /dev/dm-3.
9. manually install GRUB to the device of dm-0, like:
9.1 Call grub --device=/dev/null to enter grub shell.
9.2 Grub>device /dev/mapper/sil_afageidcdibjb (hd0) [Caution: can't
use /dev/dm-0 here]
9.3 Grub>geometry (hd0) [check if the right device is mapped to
(hd0), if it is right, you can see that there are three partitions]
9.4 Grub>root (hd0,0) [successfully execution, grub can recognize
the file system on /dev/dm-1]
9.5 Grub>setup (hd0) [install the grub to /dev/dm-0, ie.
/dev/mapper/sil_afageidcdibjb , every stage should be successful]
Note: before install the grub, the grub.conf may be kept as simple as
possible. It is better to comment some options like splashimage and
hiddenmenu to ensure the successfully display of the grub menu after
10. Copy the dmraid.static to /sbin. This utility is the static link
version of dmraid and is needed at intird stage. It is not included in
the distribution of EL4, but it can be found at the distribution of
Fedora4, just copy it.
11. Path the mkinird, see the end.
12. make initrd with mkinitrd, like mkinitrd initrd.new `uname -r`
13. copy the initrd.new to foo.
14. edit the foo/grub/grub.conf to provide entry of current kernel and
the new initrd.img. Like:
title SATA RAID
kernel /vmlinuz-2.6.9-5...... root=/dev/dm-3 ....
15. Edit the bar/ect/fstab to change the device of root file system,
/dev/dm-3 / ext3 defaults 1 1
/dev/dm-1 /boot ext2 defaults 1 2
/dev/dm-2 swap swap defaults 0 0
16. halt -p to stop the current system.
17. Detach the auxiliary hard disk. And re-power on the machine. Enjoy
patch for /sbin/mkinitrd
--- mkinitrd 2004-10-25 06:01:52.000000000 +0800
+++ mkinitrd.new 2005-07-01 07:12:33.000000000 +0800
@@ -733,6 +733,18 @@ elif [ -n "$root_lvm" ]; then
+#add to active dmraid
+if [ -x /sbin/dmraid.static -a -x /sbin/dmsetup -a -e
/dev/mapper/control ]; then
+ dmout=$(/sbin/dmsetup ls 2>/dev/null)
+ if [ "$dmout" != "No devices found" -a "$dmout" != "" ]; then
+ inst /sbin/dmraid.static $MNTIMAGE/sbin/dmraid
+ echo "echo Making device-mapper control node" >> $RCFILE
+ echo "mkdmnod" >>$RCFILE
+ echo "echo Running dmraid to active reid" >>$RCFILE
+ echo "/sbin/dmraid -ay" >>$RCFILE
echo "echo Creating root device" >> $RCFILE
echo "mkrootdev /dev/root" >> $RCFILE
More information about the Ataraid-list