[PLUG] Rebuilding software RAID after disk failure

Matt Alexander lowbassman at gmail.com
Tue Jan 4 21:43:25 UTC 2005


I have a RedHat 7.2 server with two disks that was setup with software
RAID level 1.  One of the disks failed and was replaced.  There are
three partitions, root, data, and the swap partition.  Now I'm trying
to rebuild the array.  Using the info in /etc/raidtab, I tried to
rebuild the md0 array with this command:

raidhotadd /dev/md0 /dev/sdb2
/dev/md0: can not hot-add disk: invalid argument.

This is a new disk so /dev/sdb2 doesn't exist yet.  So I assume that I
need to partition it first and then run raidhotadd?  If so, how do I
give the new disk the same parition info as the other disk?

Out of curiosity, I ran the following command and it worked, but
/proc/mdstat shows that the entire new disk was used for md0:

raidhotadd /dev/md0 /dev/sdb

But when I try to remove sdb with raidhotremove /dev/md0 /dev/sdb, I get:

/dev/md0: can not hot-remove disk: disk busy!

Here's my /etc/raidtab:

raiddev             /dev/md1
raid-level                  1
nr-raid-disks               2
chunk-size                  64k
persistent-superblock       1
nr-spare-disks              0
    device          /dev/sda1
    raid-disk     0
    device          /dev/sdb1
    raid-disk     1
raiddev             /dev/md0
raid-level                  1
nr-raid-disks               2
chunk-size                  64k
persistent-superblock       1
nr-spare-disks              0
    device          /dev/sda2
    raid-disk     0
    device          /dev/sdb2
    raid-disk     1
raiddev             /dev/md2
raid-level                  1
nr-raid-disks               2
chunk-size                  64k
persistent-superblock       1
nr-spare-disks              0
    device          /dev/sda3
    raid-disk     0
    device          /dev/sdb3
    raid-disk     1

Thanks,
~M

-- 
Get Firefox!
http://getfirefox.com/



More information about the PLUG mailing list