problem: clone ntfs disk to lvm

m.ardito

Active Member
Feb 17, 2010
1,473
16
38
Torino, Italy
Hi, i've read the migration wiki page, but have some doubt left.

i would like to clone a ntfs disk (phisical machine) to a LVM LV and then use that disk to boot a windows server.

i can't use the
dd if=/dev/sda | ssh root@proxmox dd of=/var/lib/vz/images/100/test.raw

because i want the vm to have LVM based disks, and have not enough space left on proxmox disks, too. So, i created a (sufficient) LV, say

/dev/pve_vm_disks/vm-106-disk-1

and did

dd if=/dev/sda | ssh root@proxmox dd of=/dev/pve_vm_disks/vm-106-disk-1

but
1) i cant' see that LV disk on pve web gui to add it
2) i can add it to the 106.conf manually and boot the machine but gparted says something wrong with that disk. the same happened using netcat approach...

it seems that copying /dev/sda in either way creates a /dev/vda in the vm and gpared says that vda1 is missing there, and there will be troubles...

what am i doing wrong?

more, ideally, i would like to clone that ntfs disk on a smaller LV disk, and also looked at

fsarchiver
that should be able to do that, and knows also ntfs.

anybody has ideas or experiences to share, helpfully?

Marco
 
Hi, i've read the migration wiki page, but have some doubt left.

i would like to clone a ntfs disk (phisical machine) to a LVM LV and then use that disk to boot a windows server.

i can't use the
dd if=/dev/sda | ssh root@proxmox dd of=/var/lib/vz/images/100/test.raw

because i want the vm to have LVM based disks, and have not enough space left on proxmox disks, too. So, i created a (sufficient) LV, say

/dev/pve_vm_disks/vm-106-disk-1

and did

dd if=/dev/sda | ssh root@proxmox dd of=/dev/pve_vm_disks/vm-106-disk-1

but
1) i cant' see that LV disk on pve web gui to add it
2) i can add it to the 106.conf manually and boot the machine but gparted says something wrong with that disk. the same happened using netcat approach...
Hi,
proxmox use lvm-tags to map the LVs to the VMs. The easy way is to use the gui the create a new disk on a lvm and write to them with dd.

If you have enough space on the external volumegroup, create a logical volume, make a filesystem on top, mount this to /var/lib/vz/images/106, create a local disk (e.g. qcow2) and try with selfimages - if this works, you can transfer this to a "real" lvm-disk. Of course you can also use netcat with raw for this.

Udo
 
Thanks, Udo, as always your posts are illuminating...

i didn't know about lvm tags, now i've put the right tag and the disks are available throug the pve gui (through lvchange)
now i can see that the "netcatted" clone is done right and gparted doesn't complain about it. Thanks.

I will try also with fsarchiver.org (i'm learning pv2 techniques, before go to production), as it should be able to restore to a different sized disk.

I'll report here and if it works, add another "guide" to the wiki migration section.

Marco
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!