[svlug] How to un-raid an raid/mirror?

Drew Bertola drew at drewb.com
Mon Apr 28 16:16:14 PDT 2003


On Sat, 2003-04-26 at 21:55, Gary Lin wrote:
> Hi,
>     I have a server which uses Linux's mirror-raid.  Is there a way to 
> disable the raid without reformating everything (because I decide not to 
> use mirroring and would like to free up one of the HD).  Or, is there a 
> way I could duplicate the entire Linux system onto an empty disk which 
> doesn't use the mdX partition?


First do 'fdisk -l /dev/sda'  (sdb, hda, hdb, etc. as appropriate).

Print these out or write them down verbatim.  If things don't work out,
these might be critical to easily restoring your data.

Since a drive, say, /dev/hda, can have partitions that are part of a
raid partition and partitions that are not, all the partitions need to
be accounted for and understood.  (You could post the above info to the
list for help with your particular case.)

Print out and review /etc/raidtab and /etc/fstab.

Power down, yank the mirror drive (call it /dev/hdb) and reboot.  All
should be fine.  Any missing partitions are probably non-raid partitions
on hdb.  The array will run in this degraded mode, providing nothing
goes wrong with the single remaining drive.

You could stop there or you could start playing with re-partitioning
(changing the partition type to "83 Linux" or whatever is suitable).  I
haven't done this and don't know what to expect.  If the two drives are
exact mirrors of each other, you could run one while playing with the
other. To do that, you have to move the drive to /dev/hdc so that Linux
RAID won't mount it.  Check /etc/raidtab for info on this.

Watch out if your mbr is on one of the two mirror drives.  This can
cause you to lose your lilo/grub boot capability.


-- 
+---------------------- T h e C o o p . n e t ----------------------+
| Drew Bertola         Hosting - Colocation      Tel:  408-738-8337 |
| TheCoop.net      Programming - Administration  Mob:  408-480-7654 |
| drew at thecoop.net    Open Source Specialists    http://thecoop.net |
+-------------------------------------------------------------------+







More information about the svlug mailing list