LVM: pvmove weird behaviour... is it normal?

Lennart Sorensen lsorense-1wCw9BSqJbv44Nm34jS7GywD8/FfD2ys at public.gmane.org
Mon Jun 12 16:47:17 UTC 2006


On Mon, Jun 12, 2006 at 10:48:05AM -0400, Paul Mora wrote:
> Hi.
> 
> I'm having what I think is some trouble with Linux LVM, and wanted to
> see if anyone else has experienced the same sort of thing.
> 
> Background:  My machine is running Fedora Core 5, with all the latest
> fixes.  System has a 20Gb IDE disk in it, with /boot as a normal
> primary partition, and all the rest (/, /usr, swap, /tmp, /home) in
> LVM.  I want to migrate to a new 40Gb disk.
> 
> My steps are as follows:
> 
> 1. Add disk to system (as hdb)
> 2. Partition hda the same as hdb
> 3. Copy contents of /dev/hda1 to /dev/hdb1 (this is /boot)
> 4. Run pvcreate on /dev/hdb2 to make it a PV, and add it to the volume group
> 5. Run "pvmove" to migrate PEs from hda2 to hdb2
> 6. Go have some breakfast while it runs
> 7. Put GRUB in MBR on /dev/hdb
> 8. Shutdown, remove hda, make hdb hda, and boot up
> 
> So when I do this, everything goes well until step 5.  When I run the
> pvmove command (the exact command is "pvmove -v -b /dev/hda2
> /dev/hdb2) , it looks like it should be working, but nothing happens.
> I expect to see some disk activity as things are being moved, but the
> drive light is off.  After about 1 minute, the system becomes
> unresponsive.  When I run any command, it just hangs.  The system
> hasn't crashed as far as I can tell, but I cannot CTRL-C, I cannot ssh
> in, nor can I switch to any other virtual consoles.
> 
> Eventually I gave up and just hit the reset button.  The system
> reboots, mounts the filesystems, then tries to activate swap and hangs
> up.  Booting in single user mode hangs at the command prompt in a
> similar fashion.  Again, no drive activity is going on to speak of.
> 
> Finally, booting into emergency single user gives me a useable prompt.
> I can mount all the filesystems up, but when I try and run pvmove to
> look at status, again, it hangs.
> 
> Has anyone else experienced this behaviour?  Is this normal for moving
> PEs from one disk to another?  Something tells me that it is not.  I
> had similar issues doing a similar migration on my MythTV box, but
> after the initial command hang, after I rebooted, the pvmove completed
> successfully.
> 
> Any comments would be greatly appreciated.

If a pvmove fails, you have to restore the LVM to a known good config
before pvmove will run again it seems.  I managed to botch this myself a
while ago.  The lvmrestore command allowed me to restore to a backed up
config (I copied the backup config that looked like it was from before
the pvmove in place, and ran the restore command).  I had to modify the
lvm script to NOT active any LVMs at boot, but to have the tools run
directly on the block devices.  Until then, nothing worked.  After the
restore, I put it back, my LVMs came back up, and the next pvmove
command worked perfectly first time without making the system slow an
unresponsive or anything.  I still don't know what went wrong the first
time, other than perhaps doing it while the raid was still syncing the
new raid1 volume was the problem.  My second attempt I moved one LV at a
time off the old PV rather than moving everything.

Len Sorensen
--
The Toronto Linux Users Group.      Meetings: http://tlug.ss.org
TLUG requests: Linux topics, No HTML, wrap text below 80 columns
How to UNSUBSCRIBE: http://tlug.ss.org/subscribe.shtml





More information about the Legacy mailing list