RAID-1 in RHEL 6; can’t get partitioning on identical devices to look identical

fdiskpartitioningrhel-6software-raid

I have a RHEL 6 fileserver. It contains two identical 2TB SATA drives. Both are supposed to contain one partition that takes up all the space on the drive (and this used to be the case). When I had set up the system, this meant I had a /dev/sda1 and a /dev/sdb1 that constituted the two active members of my raid array. Both partitions, at that time, spanned all the cylinders on the drive. /dev/md0 maps to /. (There are no separate partitions for /boot or anything else.)

sda got removed from the raid recently due to an lba addressing failure, and – after verifying the drive – I mindlessly added /dev/sda to the raid instead of /dev/sda1. When I realized my mistake, I set /dev/sda to faulty, removed it from the raid, and decided to recreate /dev/sda1 as a single partition that covers the whole drive and re-add that to the raid.

I'm failing in this mission because I can't get the /dev/sda1 partition to match the size of the /dev/sdb1 partition.

Both drives are identical, as previously stated, and so they have the same number of cylinders. Let's say this number is X. fdisk will let me create a /dev/sda1 partition that goes from cylinder 1 to cylinder X. Great. But md won't let me add that to the array, because it says the sizes aren't the same. So I looked at /dev/sdb1 via fdisk, and here's the thing: it goes from cylinder 1 to cylinder X+1! Huh?

Can someone explain what's going on to me and tell me how to fix this?

Best Answer

You may be encountering a rounding error when selecting the final cylinder. Try specifying a slightly smaller partition size and let the partition software round up for you.

Related Question