[TriLUG] Taking apart software RAID

Tobias Crawley tcrawley at gmail.com
Thu Aug 26 21:22:21 EDT 2004


Hi all,

I have a FC2 box that is running software RAID1 (via md) across two
drives, and I'd like to dismantle the RAID without a reinstall. I just
want to drop to one disk, then use the second disk as additional
space. I've done this before with a RH8 machine a while back, but it
was secondary drives in the machine, and not the root/boot drive. I
also don't remember what I did then.

Here is my setup:

/etc/raidtab:

raiddev             /dev/md0
raid-level                  1
nr-raid-disks               2
chunk-size                  256
persistent-superblock       1
nr-spare-disks              0
    device          /dev/hdc1
    raid-disk     0
    device          /dev/hdd1
    raid-disk     1
raiddev             /dev/md1
raid-level                  1
nr-raid-disks               2
chunk-size                  256
persistent-superblock       1
nr-spare-disks              0
    device          /dev/hdc3
    raid-disk     0
    device          /dev/hdd3
    raid-disk     1

/etc/fstab:

/dev/md0                /                       ext3    defaults        1 1
none                    /dev/pts                devpts  gid=5,mode=620  0 0
none                    /dev/shm                tmpfs   defaults        0 0
/dev/md1                /home                   ext3    defaults        1 2
none                    /proc                   proc    defaults        0 0
none                    /sys                    sysfs   defaults        0 0
/dev/hdd2               swap                    swap    defaults        0 0
/dev/hdc2               swap                    swap    defaults        0 0
/dev/cdrom              /mnt/cdrom              udf,iso9660
noauto,owner,kudzu,ro 0 0
/dev/fd0                /mnt/floppy             auto    noauto,owner,kudzu 0 0

/etc/grub.conf:

default=0
timeout=10
splashimage=(hd0,0)/boot/grub/splash.xpm.gz
title Fedora Core (2.6.5-1.358)
        root (hd0,0)
        kernel /boot/vmlinuz-2.6.5-1.358 ro root=/dev/md0 rhgb quiet
        initrd /boot/initrd-2.6.5-1.358.img

and lastly, the partition table from fdisk /dev/hdc:

Disk /dev/hdc: 40.0 GB, 40020664320 bytes
16 heads, 63 sectors/track, 77545 cylinders
Units = cylinders of 1008 * 512 = 516096 bytes
 
   Device Boot      Start         End      Blocks   Id  System
/dev/hdc1   *           1       20318    10240240+  fd  Linux raid autodetect
/dev/hdc2           20319       21358      524160   82  Linux swap
/dev/hdc3           21359       77545    28318248   fd  Linux raid autodetect

My thinking is that I can change root= in grub.conf to point to
/dev/hdc1,  change fstab to refer to /dev/hdc1 for / and /dev/hdc3 for
/home, and change the partition type on /dec/hdc[1,3] to 83. Will that
work, or will that be a major mistake?

Thanks,
Tobias



More information about the TriLUG mailing list