[lug] Migration from raw partitoins to LVM2 (hopefully)

Hugh Brown hugh at math.byu.edu
Fri Jan 26 15:39:11 MST 2007



On Fri, 26 Jan 2007, D. Frye wrote:

>
> All,
>
> I'm upgrading my dual boot laptop to a larger hard drive where there is
> currently no LVM in place. So far, I haven't found any FAQ or HOWTO that
> addresses this and I'm looking for someone with either experience or
> more information that I currently have to complete this.
>
> Basic steps include leaving /boot, the XP, and common FAT partitions on
> raw disk slices, and then create a single physical volume on the last
> partition with the rest of the available disk. Then the plan is to use
> SystemRescueCd and partimage to restore the partition images to the new
> LVM logical volumes before mucking around with initrd and grub.
>
> Odds are pretty good that I can fumble through this on my own, but I'd
> prefer to avoid the frustration if I can find a source that has
> performed this work already.
>
> Any information or other suggestions for such a migration would be
> greatly appreciated.
>
> Thanks,
> David


A third system (or the ability to have both disks connected) would be
useful.

Before starting, I'd run the windows defrag on the NTFS partitions (if
any).

Next, boot knoppix with both disks connected.  Create the partition table
on new disk to match for /boot, XP, FAT and the final one for LVM

then I'd use dd to write from /dev/hda1 to /dev/hdb1 (assuming /boot from
old to new) and the same for the XP and FAT.

Then do a pvcreate on /dev/hdb4 and a vgcreate.  Create the lv's to match
the size of the partitions that they are replacing and use dd to copy from
/dev/hda5,6,7 to /dev/<vgname>/<lvname>

Run fsck on all of the lv's and then make sure they mount.  If they do,
then use lvextend/ext2online to extend the partitions as needed.

That's the approach I'd take if I wanted mirror images.

If I were just doing it myself, I'd make the /boot partition, dd the xp
partition, create the fat partitions, create the lvm partition and then do
a fresh linux install, rsync'ing as necessary after doing the fresh
install.

Hugh



More information about the LUG mailing list