I need to upgrade a redhat server to RHEL 5.4 however it has a software raid mirror on it which I have never encountered before. The drives are /dev/sda and /dev/sdb and the mirror is /dev/md0. What I want to do is break the mirror, pull sdb for a backup if things go wrong, upgrade RHEL, test and if all is sweet put sdb back in to start mirroring again.
Here is what I was going to do:
1. Shutdown server
2. Pull sdb
3. Boot server
4. Upgrade RHEL (without touching partitions or filesystems)
5. Test
6. Drop server
7. Replug sdb
8. Boot server
9. Run raidhotadd /dev/md0 /dev/sdb
Will that work? Will the drive start mirroring the new system?
Similarly will I be able to swap sda with sdb if things go pear shaped to rollback?
Cheers :)
You should set the drive as faulty and remove it with mdadm before pulling it out, it's probably okay to just pull it, but it's better to put the drive to sleep before plugging it off IMO.
now you can pull it out, do your upgrades, reboot etc.
After adding the drive, you must re-add it to the array to initiate resync. Since you marked sdb as faulty, it will be overwritten with data from sda after replugging.
You can check resync status in real time with
I'm not sure about switching the drives, you might have to destroy raid metadata on the drive that you want to become the source of resync
halt the array, remove sda, insert sdb into sda slot, rebuild array setting drive 2 (previous sda, future sdb) as missing, after that - insert second drive and resync.
Good luck.