LVM and cloning HDs
Posted
by
jcea
on Super User
See other posts from Super User
or by jcea
Published on 2011-03-11T02:22:05Z
Indexed on
2011/03/11
8:12 UTC
Read the original article
Hit count: 327
Using Linux, I have several backup levels. One of them is a periodical sector by sector copy (using dd
) of my laptop harddisk to an external USB disk. Yes, I have other backups too, like remote rsync.
This approach (the disk dd
) is OK when cloning a HDD with no LVM volumes, since I can plug the external disk anytime and mount the partitions simply mounting /dev/sdb*
instead of /dev/sda*
. Trivial and handy.
Today I moved ALL my harddisk (including the /boot
) to LVM. Everything works fine. I will stress it for a couple of days, and then I will do a sector by sector copy to my external harddisk.
Now I have a problem, I guess.
If in the future I plug the external USB HDD to recover any file, the OS will detect a duplicate LVM configuration, with the same name and the same UUID. Even doing a vgrename
(which LVM would be renamed, the internal HDD or the external HDD?), the cloned UUID will not change. Is there any command to change name and UUID? Ideally I would clone the HDD and then change the LVM group name and its UUID, but I don't know how to do it.
Another related issue would be...
In the past I have booted my laptop using the external disk, using the BIOS boot menu and changing GRUB entries manually to boot from /dev/sdb
instead of /dev/sda
. But now my current GRUB configuration boots directly from a LVM logical volume, something like: set root='(LVM-root)'
in my grub.cfg
. So... What is going to happen with duplicated volumes?
Any suggestion?
I guess I could repartition my external harddisk and change backup strategy from dd
to rsync
, but this disk has windows installed too, and I really would like to have a physical "real" copy.
© Super User or respective owner