Richard G
Verified User
I must be honest to say that I never build or rebuild a software raid before. We had a defective disk /dev/sda and a good disk /dev/sdb running in raid 1.
The datacenter has replace the defective disk, we had to rebuild it ourselves, so I used this manual:
Ik moet eerlijk zeggen nog nooit een software raid gerebuild te hebben. Er was een schijf /dev/sda stuk. De /dev/sdb was verder nog in orde.
Het datacentrum heeft de schijf vervangen, rebuilden moesten we zelf doen dus daar heb ik deze handleiding voor gebruikt:
http://www.howtoforge.com/replacing_hard_disks_in_a_raid1_array
At least... starting at "adding new harddisk" because a new disk was already present.
In the beginning I had to use the sfdisk with --force because it complaint otherwise, and /dev/sda was defective before so I adjusted the commands, like this:
Then i used these commands:
And it started rebuilding. It looked as if things went fine, it also took a couple of hours. But maybe I had to use /dev/sda2 and /dev/sda3 here instead of /dev/sda1.
Because after rebuilding "cat /proc/mdstat" gives the following output:
So there is clearly a difference in blocks, which should not be there.
You can also see that with the output of "fdisk -l".
Question is.... what do I have to do to get this fixed? Because as i believe /dev/md1 should be 491,6 GB too, shouldn't it?
The datacenter has replace the defective disk, we had to rebuild it ourselves, so I used this manual:
Ik moet eerlijk zeggen nog nooit een software raid gerebuild te hebben. Er was een schijf /dev/sda stuk. De /dev/sdb was verder nog in orde.
Het datacentrum heeft de schijf vervangen, rebuilden moesten we zelf doen dus daar heb ik deze handleiding voor gebruikt:
http://www.howtoforge.com/replacing_hard_disks_in_a_raid1_array
At least... starting at "adding new harddisk" because a new disk was already present.
In the beginning I had to use the sfdisk with --force because it complaint otherwise, and /dev/sda was defective before so I adjusted the commands, like this:
Code:
sfdisk -d /dev/sdb | sfdisk /dev/sda --force.
Then i used these commands:
Code:
mdadm --manage /dev/md1 --add /dev/sda1 en
mdadm --manage /dev/md2 --add /dev/sda2
And it started rebuilding. It looked as if things went fine, it also took a couple of hours. But maybe I had to use /dev/sda2 and /dev/sda3 here instead of /dev/sda1.
Because after rebuilding "cat /proc/mdstat" gives the following output:
Code:
Personalities : [linear] [raid0] [raid1] [raid10] [raid6] [raid5] [raid4] [multipath] [faulty]
md1 : active raid1 sdb1[1] sda1[0]
101312 blocks [2/2] [UU]
md2 : active raid1 sdb2[1] sda2[0]
480088000 blocks [2/2] [UU]
unused devices: <none>
So there is clearly a difference in blocks, which should not be there.
You can also see that with the output of "fdisk -l".
Disk /dev/sda: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x00000000
Device Boot Start End Blocks Id System
/dev/sda1 * 1 13 101376 fd Linux raid autodetect
Partition 1 does not end on cylinder boundary.
/dev/sda2 13 59782 480088064 fd Linux raid autodetect
/dev/sda3 59782 60801 8190976 82 Linux swap / Solaris
Disk /dev/sdb: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x0004219e
Device Boot Start End Blocks Id System
/dev/sdb1 * 1 13 101376 fd Linux raid autodetect
Partition 1 does not end on cylinder boundary.
/dev/sdb2 13 59782 480088064 fd Linux raid autodetect
/dev/sdb3 59782 60801 8190976 82 Linux swap / Solaris
Disk /dev/md2: 491.6 GB, 491610112000 bytes
2 heads, 4 sectors/track, 120022000 cylinders
Units = cylinders of 8 * 512 = 4096 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x00000000
Disk /dev/md1: 103 MB, 103743488 bytes
2 heads, 4 sectors/track, 25328 cylinders
Units = cylinders of 8 * 512 = 4096 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x00000000
Question is.... what do I have to do to get this fixed? Because as i believe /dev/md1 should be 491,6 GB too, shouldn't it?