pvcreate to raid1 fails

Benjamin Scott dragonhawk at gmail.com
Thu Mar 4 11:23:21 EST 2010


On Thu, Mar 4, 2010 at 7:34 AM, Jerry Feldman <gaf at blu.org> wrote:
> On 03/03/2010 09:53 PM, Benjamin Scott wrote:
>>   md1 (currently only on sdc2) is bigger than sda2.  You will not be
>> able to mirror md1 back on to sda2 without repartitioning sda, which
>> will mean removing sda1 from md0.
>>
> That is intentional. /dev/SDA is a Seagate and /dev/sdc is a WD.

  Interesting.  According to the fdisk output, they're identical in
size, down to the block.  Usually I don't get that lucky, I've found.
:)

> This way I reduce the chance of a simultaneous failure, like we had at the
> BLU last year where all of our drives were the same MFR and lot #.

  Hmmm, that's a good idea.

> Actually, somehow Fedora partitioner set up /dev/sda1 to end not on a
> cylinder boundary.

  Good job Fedora.  See previous about PC partitioning being a crock.  ;-)

> If I start from scratch, they will be the same exact size.

  One option would be:

A1. Get the unable-to-create-PV problem fixed first, of course
A2. Move the LVM PEs (Physical Extents) currently on sda2 to sdc2 (as
described previously)
A3. Remove sda2 from the VG (as described previously)
A4. Remove sda1 from md0 (breaking the mirror), leaving just sdc1 in the mirror
A5. Nuke the partition table on sda
A6. Copy the partition table from sdc to sda, so the two disks have an
identical partition layout
A7. Re-mirror md0 and md1 on to the new sda1 and sda2 (respectively)
A8. Reinstall the boot loader on to md0 and/or sda

  To nuke a partition table (WARNING: destroys data!):

	dd if=/dev/zero of=/dev/sda bs=512 count=1
	sfdisk -R /dev/sda

  (WARNING: The above destroys data!)

  Then you can copy with:

	sfdisk -d /dev/sdc | sed s/sdc/sda/ | sfdisk /dev/sda

On Thu, Mar 4, 2010 at 11:09 AM, Jerry Feldman <gaf at blu.org> wrote:
> Since virtually everything on my system is backed up I think that rather
> than fighting with what I perceive as a bug in LVM2, I will build my
> system from scratch.

  That's a viable option, too.  :-)

-- Ben



More information about the gnhlug-discuss mailing list