root disk mirroring using mdadm

Herta Van den Eynde herta.vandeneynde at gmail.com
Tue Jul 17 19:25:38 UTC 2007


On 17/07/07, Bipin Baghele <BaghelB at wyeth.com> wrote:
> Hi All,
> We have several HP Proliant servers (DL series as well as blade with no
> SMART Array RAID controller) running Redhat 3 & 4 Ent version as well
> SLES 9. I am planning to mirror the root disk to another disk on same
> server using "mdadm" command feature in Linux. I compiled all the steps
> but not yet tested. Waiting for hardware availability.
> Meanwhile, wanted to check the feedback on mdadm from this list...
> like
> 1. How is the process?. So far looks simple....
> 2. generally how long it takes to mirror say 72gb drive, approximate
> figure.
> 3. How reliable is the software mirroring in actual use in
> dev/qa/test/prod env.
> 4. Any potential issues.
> 5. Do I need to be in single user mode or rescue more or multiuser mode
> is perfect?
> 6. Any issues, dealing with one disk failure? like online replacement
> etc...
> *------command-----------------
> # mdadm -C /dev/md0 --level=raid1 --raid-devices=2 /dev/hda1 /dev/hdb1
> (to configure mirroring)
> # mdadm --detail /dev/md0 (to check the status)
> *----------------------------------
> Will appreciate your feedback.

As far as Red Hat is concerned (I have no experience with SuSE in this
respect), I found it to be quite stable for both production and test
environments.  I never tried mirroring the root disk after the
installation, but it's pretty straightforward to do it as part of the
installation, so if that's an option, it'll probably make your life
easier.

Post installation, I found that I needed to modify the /etc/rc.sysinit
script as the device special files have not been created yet when the
fsck starts at boot.  Edit rc.sysinit and add a check at (or near)
line 684:

# cp -p /etc/rc.d/rc.sysinit /etc/rc.d/rc.sysinit.`date +%Y%m%d`
# vi /etc/rc.d/rc.sysinit
(...)
# Check filesystems
IF [ -z "$fastboot" ]; then
#+
# device special files may not be created yet at this point
# verify that they are present before fsck tries to use them
#_
grep '^/dev/dm-' /etc/fstab | awk '{print $1}' | while read DSF REST
do
  while [ ! -b $DSF ]
  do
    sleep 2
  done
done
(...)

Also remember to add your email address to /etc/mdadm.conf, so you get
notified when a disk fails.

FWIIW, forget multipathing with mdadm.  It's broken in RHEL AS 4.  (At
least it was last I looked at it somewhere second half of 2007.)
multipath works fine, though.

Kind regards,

Herta




More information about the redhat-list mailing list