[H-GEN] Moving LVM partitions

Matthew Brecknell humbug at brecknell.org
Thu Dec 7 15:38:54 EST 2006


gavin duley:
> My plan is to move the lvm volumes (plus /boot, which is not an lvm  
> partition) to another, larger drive. A friend suggested that I could  
> do so by creating new "physical lvm partitions on your new drive and  
> move the lvm partitions across", but couldn't remember how. I think  
> parted might be able to do the job, but I'm not really certain.

Parted might work, and would be one of the quicker methods, though I've
never tried it. You may even find that dd(1) does the job.

Here's one approach:

http://tldp.org/HOWTO/LVM-HOWTO/removeadisk.html

Before you dive into the "Prepare the disk" section, you'll need to
partition the disk into a small boot partition and a large LVM
partition. Then, use pvcreate(8) on the LVM partition, not the whole
disk.

Another approach would be to create new partitions (as above), a new
volume group, logical volumes and filesystems on the new disk, and then
copy your data across using tar(1). This approach may be quicker than
pvmove(8), because pvmove does considerable book-keeping work.

If you use pvmove(8) for your LVM data, you'll still need to manually
create your new boot filesystem and copy it's data across. I'm not
familiar with how Linux boots on a Sun Ultra 5, but you may also need to
do something to make the new disk bootable.





More information about the General mailing list