[aklug] Re: Raid 1 Disk failure - Rebuild question

From: barsalou <barjunk@attglobal.net>
Date: Tue Apr 15 2008 - 08:53:06 AKDT

Quoting Ryan <carbonfreeze@gmail.com>:

> On Mon April 14 2008, William D. McKinney wrote:
>> I have a software raid 1 system with a failed disk. I will be ordering a
>> new disk and wondered if rebuilding the mirror is simple in nature. The
>> raidtab looks like this:
>>
>>
>
> Assuming that sdb is the failed disk. If the disk is not already marked as
> faulty/failed by mdadm --detail /dev/md*, then you will need to mark them =
as
> such:
>
> mdadm --fail /dev/md0 /dev/sdb1
> ...
>
> Remove the failed partitions from the md device(s):
>
> mdadm --remove /dev/md0 /dev/sdb1
> ...
>
> Install your replacement hard disk and create partitions with fdisk:
>
> 1). Get the cylinder information for your current raid hard disk via fdisk=
.
> This is the 3rd and 4th columns of fdisk -l /dev/sda output. An example
> below:
>
> Device Boot Start End Blocks Id System
> /dev/sda1 * 1 12 96358+ fd Linux raid autodet=
ect
> /dev/sda2 13 3051 24410767+ fd Linux raid autodet=
ect
> /dev/sda3 3052 3537 3903795 fd Linux raid autodet=
ect
> /dev/sda4 3538 48641 362297880 5 Extended
> /dev/sda5 3538 48641 362297848+ fd Linux raid autodet=
ect
>
> 2). Partition the new hard disk, make sure that each new partition has an
> equal number of cylinders (or slightly greater) to the partitions which
> contain the md0-2 devices. If the size of the new partitions is smaller th=
an
> the md partitions, mdadm will refuse to add them to the array. fdisk can b=
e
> used to partition the new drive. In this case, I will use the above partit=
ion
> layout as an example for creating a new partition table on the new hard di=
sk:
>
> fdisk /dev/sdb
> n=09=09(new partition)
> p=09=09(create primary partition)
> 1=09=09(select partition number)
> enter=09(use default start cylinder value)
> 12=09=09(select end cylinder for the partition. This should be the same =
=20
> as the end
> for /dev/sda1).
> n=09=09(new partition)
> p=09=09(create primary partition)
> 2=09=09(select partition number)
> enter=09(use default start cylinder value)
> 13=09=09(select end cylinder for the partition. This should be the same =
=20
> as the end
> for /dev/sda2).
>
> *** and so on for each additional partition ***
>
> Before exiting fdisk, verify that the partitions are set as type fd (linux
> raid). If they are not, it is recommended that you do so at this time. In
> fdisk:
> t=09=09(set partition type)
> 1=09=09(select partition)
> fd=09=09(partition type)
>
> Additionally, if the md device is mounted as /boot, it should have the
> bootable flag set. If there is no /boot partition, then /root should be se=
t
> as active/bootable (This ofcourse, depends on your bootloader configuratio=
n).
> In fdisk:
> a=09=09(set bootable flag)
> 1=09=09(select partition)
>
> After you have finished mucking about in fdisk, write changes to disk:
> w=09=09(write & sync changes to disk)
>
>
> 3). Add the newly created partitions to the md device:
>
> mdadm --add /dev/md0 /dev/sdb1
> mdadm --add /dev/md1 /dev/sdb2
> ...
>
> Depending on the size of the array, rebuild could take some time. You can
> check the progress of the rebuild, and of the rest of the arrays:
>
> cat /proc/mdstat
>
>
> The above directions assume that the replacement disk is of equal or great=
er
> size to the failed disk. If you don't want to muck about on the command li=
ne,
> you can use the YAST partition/disk management module to do this with a GU=
I.
> ---------
> To unsubscribe, send email to <aklug-request@aklug.org>
> with 'unsubscribe' in the message body.
>

WOW.

Thanks for chiming in here Ryan. I appreciate you making the effort. =20
The detail on this answer is perfect.

Glad your with us.

Mike B.

----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.

---------
To unsubscribe, send email to <aklug-request@aklug.org>
with 'unsubscribe' in the message body.
Received on Tue Apr 15 09:08:16 2008

This archive was generated by hypermail 2.1.8 : Tue Apr 15 2008 - 09:08:17 AKDT