[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-users] Questions on qcow, qcow2 versus LVM



Matthew Law wrote:
On Tue, December 29, 2009 10:04 pm, Fajar A. Nugraha wrote:
Another way to is to investigate why your earlier setup has problems.
To eliminate partition problems, you can map the disk to dom0  like
this:

modprobe xenblk
xm block-attach 0 phy:/dev/vg_name/lv_name xvda w
### do your stuff here. fdisk xvda, mkfs, ta, whatever. Use fdisk
instead of parted.
### don't forget to umount afterwards
xm block-list 0
xm block-detach 0 51712 <== 51712 is the devid for xvda

If that works, then it's 100% confirmed the problem is with
parted/kpartx. Repeat the test, but this time using parted instead of
fdisk, and you get the idea :D

Thanks, Fajar! Using this method I could create a single partition on the
LV with fdisk, format it as ext3, mount it and untar a vm image on it and
boot the vm with pvgrub as before.  I then xm destroyed the domU and
removed the LV with no problems - result!

After this I set about trying to find which of the previous operations was
holding the LV in the open state, so I started again with a clean lv and
incrementally performed each operation on it and tried to remove it.  The
error occurs after running:

parted /dev/VolGroupVM/testvm mkpartfs primary ext2 0 10240

So, parted is the culprit (or at least the first one to cause the
problem).  Is there perhaps another, scriptable way to create the
partitions on the LV?
You can use fdisk and play with unix standar input, for example:

echo "d
n
p
1

+10000M
n
p
2


a
1
w
" | fdisk /dev/sdx

:) consider the blank lines to accept fdisk defaults for fist and last cilinder.

of course you can use a onliner:

printf 'n\np\n1\n\n+100M\nt\nfd\na\nn\np\n2\n\n\nt\n2\nfd\np\nw\n' | fdisk 
/dev/sdx
fdisk /dev/sda

Best regards.
Matt.


_______________________________________________
Xen-users mailing list
Xen-users@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-users


_______________________________________________
Xen-users mailing list
Xen-users@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-users


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.