[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: mdadm -homehost problem [SOLVED]



On Tue, 2012-09-04 at 11:45 -0700, Ross Boylan wrote:
> Summary: mdadm on squeeze rewrites the UUID I give it with the
> localhost, even if I do not specify localhost.  I am trying to repair a
> RAID for use on lenny with an existing UUID.  Is there a way to avoid
> the rewrite?  Other solutions?
> 
> Details
> 
> A lenny host has two virtual machines, VM1 (lenny) and VM2 (squeeze).
> There are two virtual disks, VD0 and VD1, whose 3rd partition forms
> RAID1 (md1), intended for VM1.  That same partition was in a RAID
> before, but I grew it and so there is no RAID superblock near the end
> anymore. I need to recreate the superblock without zapping the good data
> on the partition.
> 
> >From VM2:
> # mdadm --create /dev/md1 --uuid=6f05ff4e:b4d49c1f:7fa21d88:ad0c50a9
> --metadata=0.90 --level=mirror --raid-devices=2 /dev/sdb3 missing
> mdadm: array /dev/md1 started.
> # mdadm --examine /dev/sdb3
> /dev/sdb3:
>           Magic : a92b4efc
>         Version : 0.90.00
>            UUID : 6f05ff4e:b4d49c1f:f1c4dd81:d9ca9b38 (local to host
> squeeze00)
> 
> The man appears to say the UUID specified on the command line should
> govern(*), but it doesn't.
> 
> Some possible fixes:
[snip]
> 4) Find an appropriate rescue system image for lenny, start it in a VM,
> and run mdadm from there.  I wonder if stopping VM1's startup while it's
> still in the initrd would be enough.
The last option worked, with some work.
I booted into the lenny VM specifying break=mount.  At the prompt I had
to do "modprobe md" to get things to work; then mdadm --create wrote the
new superblock.  Because the underlying partitions were out of sync, I
created raid1 with only 1 of the partitions, and then added in the
other.  After it synced I restarted the VM and the newly expanded md1
was there.

For the record, md1 was a physical volume for LVM.  So the complete
sequence was to then
pvresize /dev/md1  # makes the PV fill the whole md1
lvextend -L+1G myvg/usr  # grow an LV that needed more room
resize2fs /dev/myvg/usr  # online resize of filesystem

Although mdadm has some commands for --grow'ing the size of the md, I
did not need to use any of them.  Possibly that's because I used RAID1.

Ross


Reply to: