[CentOS] Removing a disc from a software mirror

Les Mikesell lesmikesell at gmail.com
Tue Feb 5 18:19:38 UTC 2008


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.


-- 
   Les Mikesell
    lesmikesell at gmail.com



More information about the CentOS mailing list