[libvirt-users] Suggestions on building VM disks from scratch

Dale Amon amon at vnl.com
Sat Mar 31 21:34:31 UTC 2012


Here's how far I've progressed this evening:

$ dd if=/dev/zero of=/recover2.my.net.raw count=20M
$ losetup /dev/loop0 recover2.my.net.raw
$ cfdisk /dev/loop0
	create a 9G bootable linux partition and a 1G swap
$ kpartx -a -v /dev/loop0
$ mkfs.ext4 /dev/mapper/loop0p1 -m 0.01 -L "RecoverTest"
$ mkdir tmp
$ mount /dev/mapper/loop0p1 tmp

>From the backup server:

$ rsync -av tree/ root at vmserver.my.com:/srv/pool/tmp/
$ umount tmp
$ kpartx -d /dev/loop0
$ losetup -d /dev/loop0
$ virsh attach-disk recovery.my.net --source /srv/pool/recover2.my.net.raw --target sdb

But no joy from the running VM itself. It does not show sdb, 
only its own vda1. rescan-scsi-bus.sh fails to bring make /dev/sdb
appear. Is the hotplugging failing perhaps?

Suggestions?




More information about the libvirt-users mailing list