How To Set Up Software RAID1 On A Running System (Incl. GRUB Configuration) (Fedora 8) - Page 2
4 Creating Our RAID ArraysNow let's create our RAID arrays /dev/md0, /dev/md1, and /dev/md2. /dev/sdb1 will be added to /dev/md0, /dev/sdb2 to /dev/md1, and /dev/sdb3 to /dev/md2. /dev/sda1, /dev/sda2, and /dev/sda3 can't be added right now (because the system is currently running on them), therefore we use the placeholder missing in the following three commands: mdadm --create /dev/md0 --level=1 --raid-disks=2 missing /dev/sdb1 The command cat /proc/mdstat should now show that you have three degraded RAID arrays ([_U] or [U_] means that an array is degraded while [UU] means that the array is ok): [root@server1 ~]# cat /proc/mdstat Next we create filesystems on our RAID arrays (ext3 on /dev/md0 and /dev/md2 and swap on /dev/md1): mkfs.ext3 /dev/md0 Next we create /etc/mdadm.conf as follows: mdadm --examine --scan > /etc/mdadm.conf Display the contents of the file: cat /etc/mdadm.conf In the file you should now see details about our three (degraded) RAID arrays:
5 Adjusting The System To RAID1Now let's mount /dev/md0 and /dev/md2 (we don't need to mount the swap array /dev/md1): mkdir /mnt/md0 mount /dev/md0 /mnt/md0 You should now find both arrays in the output of mount [root@server1 ~]# mount Next we modify /etc/fstab. Replace LABEL=/boot with /dev/md0, LABEL=SWAP-sda2 with /dev/md1, and LABEL=/ with /dev/md2 so that the file looks as follows: vi /etc/fstab
Next replace LABEL=/boot with /dev/md0 and LABEL=/ with /dev/md2 in /etc/mtab: vi /etc/mtab
Now up to the GRUB boot loader. Open /boot/grub/menu.lst and add fallback=1 right after default=0: vi /boot/grub/menu.lst
This makes that if the first kernel (counting starts with 0, so the first kernel is 0) fails to boot, kernel #2 will be booted. In the same file, go to the bottom where you should find some kernel stanzas. Copy the first of them and paste the stanza before the first existing stanza; replace root=LABEL=/ with root=/dev/md2 and root (hd0,0) with root (hd1,0):
The whole file should look something like this:
root (hd1,0) refers to /dev/sdb which is already part of our RAID arrays. We will reboot the system in a few moments; the system will then try to boot from our (still degraded) RAID arrays; if it fails, it will boot from /dev/sda (-> fallback 1). Next we adjust our ramdisk to the new situation: mv /boot/initrd-`uname -r`.img /boot/initrd-`uname -r`.img_orig Now we copy the contents of /dev/sda1 and /dev/sda3 to /dev/md0 and /dev/md2 (which are mounted on /mnt/md0 and /mnt/md2): cp -dpRx / /mnt/md2 cd /boot
6 Preparing GRUB (Part 1)Afterwards we must install the GRUB bootloader on the second hard drive /dev/sdb: grub On the GRUB shell, type in the following commands: root (hd0,0) grub> root (hd0,0) setup (hd0) grub> setup (hd0) root (hd1,0) grub> root (hd1,0) setup (hd1) grub> setup (hd1) quit Now, back on the normal shell, we reboot the system and hope that it boots ok from our RAID arrays: reboot
|
Join the discussion.
www.seamlessenterprise.com
IP Convergence
Integrate your wireless and wireline networks.
Learn how from the experts at Sprint.
www.seamlessenterprise.com
Wireless & Wireline Integration
Thoughts, strategies and solutions: join the discussion
www.seamlessenterprise.com
Unified Communications 2009
Join the Discussion. Now.
www.seamlessenterprise.com





print: 
Recent comments
3 hours 7 min ago
4 hours 50 min ago
7 hours 15 min ago
7 hours 21 min ago
11 hours 55 min ago
13 hours 56 min ago
17 hours 20 min ago
19 hours 26 min ago
19 hours 37 min ago
22 hours 4 min ago