[linux-lvm] dealing with a failing drive (esp pvmove)

Richard Shaw hobbes1069 at gmail.com
Wed Dec 22 20:38:53 UTC 2010


On Wed, Dec 22, 2010 at 1:55 PM, Ross Boylan <ross at biostat.ucsf.edu> wrote:
> I have a volume group made from 3 partitions on 2 different physical
> disks.  One of the disks is failing.  I have a new disk connected via
> USB; it is large but a bit slow (5400RPM, though the USB might be
> temporary).  It is large enough to hold the entire contents of the
> existing VG.
>
> I am looking for suggestions about how to  approach this.  The pvmove
> command looks promising, but the docs warn that things are in a delicate
> state during the migration (and advise backups).  Since it seems almost
> certain there will be I/O errors on the old drive, I'm not sure if
> pvmove is a good idea.  Is it?

I can't find consistent information but I think you're on the right
path. It will try to copy all the data. I'm not sure how it deals with
errors. If you can get it to continue through errors you should get
all the files/extents possible.You'll definitely need to fsck it
afterwards.

Using this link[1] as a guide, I think the general process would be
something like this:
vgextend /dev/<new_disk>
pvmove /dev/<old_disk>
vgreduce <vol_group> /dev/<old_disk>


> Alternately, I could do a file system level rsync, but I would probably
> need to boot into an alternate system for the last step and there are
> quite a few LVs.

This would keep the existing data on the old drive so you could get
more than one go at it, but I think that's about it.

The only other option I can think of would be to do a clone of your
old drive/partition (i.e. Clonezilla or similar). I haven't used it
though so I don't know if it can resize a LV on restore or not.

I'm not sure how LVM will handle that though. The disk UUID will be
different but the partition (PV) UUID will be the same as the old PV.
I'm not sure if LVM uses both or just the partition UUID.


> BTW, any advice on partitioning the new drive?  I know I could just use
> the whole physical device, but I'm concerned that if I want to boot
> using the disk, or install another (non-Linux) OS that I'll need more
> traditional partitions on the drive.  My first cut was to create a GPT
> partitioning scheme with a 1G blank paritition and partition 2 holding
> the rest of the 2TB for LVM.  Linux is my primary OS.

That should be fine as long as everything you plan to use with it
supports GPT partitions. Also keep in mind that if you use GPT w/ dos
compatibility you're limited to 4 partitions total.

Richard




More information about the linux-lvm mailing list