SLUG Mailing List Archives
Re: [SLUG] clone non-LVM system onto new LVM drive
- To: slug@xxxxxxxxxxx
- Subject: Re: [SLUG] clone non-LVM system onto new LVM drive
- From: Jam <jam@xxxxxxxxx>
- Date: Tue, 14 Jun 2011 11:10:40 +0800
- User-agent: KMail/1.13.6 (Linux/18.104.22.168-1.2-desktop; KDE/4.6.0; x86_64; ; )
On Tuesday, June 14, 2011 10:00:02 AM slug-request@xxxxxxxxxxx wrote:
> * Ubuntu presently installed without LVM.
> * New hard drive formatted with:
> /boot ext3 partition (empty so far)
> LVM group containing ext3 LV
> I want to copy the original root partition onto the new LV so that the
> new hard drive and LV is a bootable clone, and the old physical drive
> can be removed/saved.
> There are three objectives:
> Convert to LVM
> Keep the original as backup
> Upgrade the LVM version and be able to roll back if necessary.
> I'm assuming that I will have to boot into a live CD and dd the original
> root partition onto an LV. How do I persuade this to boot correctly? Do
> I copy the original /boot onto the new boot partition? Do I have to make
> changes to the boot directory? Changes to grub? Then what? (apart from
> any BIOS changes, which are fairly obvious).
> So far I haven't been able to find the right question to ask Google. Any
> help would be appreciated, of if anyone could point me at a howto that
> covers this scenario.
in general avoid dd. It mirrors what you have to what you want and probably
they dont fit. If you are cloning disks then yes dd. (same hw, same format)
boot from a live cd
mount (you may even have /media/oldroot)
mount (likewise new-lvm-root)
find . |cpio -pdv newroot
cpio does a good job of mirroring filesystems eg preserve links, sym links,
wont choke if you have created a /dev/zero, all stuff like that handled nicely