If I needed to remove a disc from a software mirror for a quick backup before a test, how can I remove it cleanly so that it has a good copy of the OS on it? If I use mdadm to fail then remove it, this would be done while CentOS is running (It's a mirror of the system disc) and I suspect the data on it would not be in a clean state?
Is there a way to say have it not involved in the mirror after the next boot for instance?
Thanks! jlc
On Feb 5, 2008 5:12 PM, Joseph L. Casale jcasale@activenetwerx.com wrote:
If I needed to remove a disc from a software mirror for a quick backup before a test, how can I remove it cleanly so that it has a good copy of the OS on it? If I use mdadm to fail then remove it, this would be done while CentOS is running (It's a mirror of the system disc) and I suspect the data on it would not be in a clean state?
Don't "fail" the disk, just remove it physicaly or in the BIOS, that way it will be clean.
Then if your test is successful, your disk will be re-syncronized as soon as you put it back.
If your test fail you need to make your "saved" disk the good one. I things "md" choose the disk with the last time stamp as the "master" to replicate on the second one. Then boot on the "saved" one, before to reboot and sync both.
You could also try to change the partition system ID of your partition(s) to something else than 8e, using fdisk.
Regards
will update the time stamp, and then will make the new
Is there a way to say have it not involved in the mirror after the next boot for instance?
Thanks! jlc _______________________________________________ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
Alain Spineux wrote:
If I needed to remove a disc from a software mirror for a quick backup before a test, how can I remove it cleanly so that it has a good copy of the OS on it? If I use mdadm to fail then remove it, this would be done while CentOS is running (It's a mirror of the system disc) and I suspect the data on it would not be in a clean state?
Don't "fail" the disk, just remove it physicaly or in the BIOS, that way it will be clean.
The way to make a filesystem clean is to unmount it while it is still running. If it contains / or any filesystem containing open files, you'll have to shut down. If you are able to unmount, you can fail/remove with the mdadm command and if the drive is a hot-swappable type you don't have to shut down.
Then if your test is successful, your disk will be re-syncronized as soon as you put it back.
You may not want that. It's easy enough to "mdadm --add ..." to put it back if you can figure out the underlying device name.
If your test fail you need to make your "saved" disk the good one. I things "md" choose the disk with the last time stamp as the "master" to replicate on the second one. Then boot on the "saved" one, before to reboot and sync both.
I'm not sure if this is a timestamp or a count of clean shutdowns. Does anyone know?
You could also try to change the partition system ID of your partition(s) to something else than 8e, using fdisk.
FD is the 'raid autodetect' type. Setting the drive you don't want to be the master to something else during boot, then later adding it with "mdadm --add ..." should work. Or if it is a hot-swappable type, boot without it, plug it in, then add it back.
I'm not sure if this is a timestamp or a count of clean shutdowns. Does anyone know?
Well, the setup wasn't mission critical or I would have imaged it out safely so I proceeded to shutdown the machine and unplug the secondary drive. I then booted and saw the array obviously had a missing component. I did my reconfiguration and it was good. I shutdown, plugged the secondary back in and then booted. The arrays didn't automatically re-establish the pair(?), so I # mdadm /dev/md0 -a /dev/sdb1 and # mdadm /dev/md1 -a /dev/sdb2 as md0 is the /boot partition and md1 is the LVM pv that holds swap and /. It all went well as I had # watch -n1 'cat /proc/mdstat' running.
Not as slick as the higher end machines with hardware raid and hot swappable back planes but it saved me either waiting for a painfully slow dd of the disc or a re-install if what I did failed.
Thanks everyone! jlc