Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > Linux Forums > Technical

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Thread Tools Display Modes
Old 25th August 2010, 02:25
DantePasquale DantePasquale is offline
Senior Member
Join Date: Feb 2007
Location: Lakewood, OH US
Posts: 108
Thanks: 10
Thanked 3 Times in 3 Posts
Send a message via AIM to DantePasquale
Default RHEL5u5 Software Mirroring /boot post install

If you have a moment can you look over this procedure and let me know if
it will work OK. The problem I'm trying to solve is that during the RH5
install, it let's you build software mirrors, but let's you only have
one /boot ! We didn't leave an empty partition on the 2nd disk for /boot so the partition tables are out of sync.


I think the best way to do this is to destroy the mirror, repartition,
add to the array and install grub onto the 2nd disk. The reason for this
is that /boot has to be the first partition on a disk and we don't have
a partition already reserved.

Fail the mirror disk:

mdadm --manage /dev/md0 --fail /dev/sdb1
mdadm --manage /dev/md1 --fail /dev/sdb2
(continue for all raid devices)
Remove the mirror disk:

mdadm --manage /dev/md0 --remove /dev/sdb1
mdadm --manage /dev/md1 --remove /dev/sdb2
(Continue for all raid devices)
Verify that /dev/sdb is removed:

cat /proc/mdstat

Now we need to destroy the information mdadm puts in each device that it

mdadm --zero-superblock /dev/sdb1
mdadm --zero-superblock /dev/sdb2
(Continue for all raid devices)
Now, let's repartion /dev/sdb so that it looks like /dev/sda at least
for the partitions we are interested in mirroring. NOTE: /boot has to be
the first partition!

Copy the partition table from sda to sdb

sfdisk -d /dev/sda | sfdisk /dev/sdb
Verify that it has the correct partition table

fdisk -l /dev/sdb

Use fdisk interactively to set partition types to 0xfd Linux Raid Autodetect

cat /proc/mdstat to verify that /dev/sda is still there.

Check that /etc/mdadm.conf is accurate and shows that /dev/sdb has been

cat /etc/mdadm.conf

if /etc/mdadm.conf is not accurate:

mdadm --examine --scan > /etc/mdadm.con
Prepare Grub on the 2nd drive /dev/sdb; NOTE: grub calls the drives
hd0,hd1,hd2 etc.

enter grub interactive:

grub > root (hd1,0)
grub > setup (hd1)
grub > quit
Now add /dev/sdb back into the raid devices using the new partitions:

  mdadm --add /dev/md0 /dev/sda1
  mdadm --add /dev/md1 /dev/sdb2
  mdadm --add /dev/md2 /dev/sdb2
Verify Mirroring is in Process:

cat /proc/mdstat

Then update /etc/mdadm.conf to reflect the newly partitioned /dev/sdb

mdadm --examine --scan  > /etc/mdadm.conf
Update /boot/grub/menu.lst or /etc/grub.conf in order to have an entry
to boot from the 2nd drive:

add a stanza for /dev/sdb1 booting:

copy current stanza and change hd0 to hd1. keep both so that you can
boot off either if a drive fails.

Then update the ramdisk:

mv /boot/initrd-`uname -r`.img /boot/initrd-`uname -r`.img_orig2
mkinitrd /boot/initrd-`uname -r`.img `uname -r
Reboot and test each stanza. Remove a drive and reboot off the remaining
Add that drive back and check mirroring to finish via: cat /proc/mdstat
Reply With Quote
Sponsored Links


mdadm, raid, redhat 5

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
HowTo install ISPConfig on a STRATO-Server with Debian 3.1 TobiasTM Tips/Tricks/Mods 12 15th July 2008 11:08
problem install perl modules Cirox Installation/Configuration 10 16th May 2007 17:04
Newby - General Software Install Procedure Suse 10 spiritsofadventure Installation/Configuration 2 16th April 2006 15:48
WebMail choices. Can you install other webmail software? elies Installation/Configuration 2 23rd February 2006 12:54
Mandriva 10.2 Perfect Setup Install Problems... ctroyp Installation/Configuration 12 30th December 2005 17:04

All times are GMT +2. The time now is 12:55.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.