Linux Archive

Linux Archive (http://www.linux-archive.org/)
-   Ubuntu Server Development (http://www.linux-archive.org/ubuntu-server-development/)
-   -   mounting partitions in a logical volume used as a physical disk for a virtual machine (http://www.linux-archive.org/ubuntu-server-development/257682-mounting-partitions-logical-volume-used-physical-disk-virtual-machine.html)

James Dinkel 03-05-2009 04:11 PM

mounting partitions in a logical volume used as a physical disk for a virtual machine
 
On Wed, Mar 4, 2009 at 6:18 PM, Kees Cook <kees@ubuntu.com> wrote:




If I'm understanding correctly, you have a host LV serving as a full drive

for a guest, and you want to mount the partitions that are stored within

that LV?



You probably want "kpartx", which will build a dm device for each

partition, based on the partition table it finds:



set up the dm slices:

sudo kpartx -a /dev/storagevg/drivelv

ls -l /dev/mapper/loop0p*



and to mount partition 2:

sudo mount /dev/mapper/loop0p2 /mnt/folder .....



after you're done:

sudo kpartx -d /dev/storagevg/drivelv





e.g. I've used this tool when converting KVM images:

http://www.outflux.net/blog/archives/2008/09/03/kvm-disk-image-filesystem-growth-notes/



--

Kees Cook

Ubuntu Security Team


Thank you.* I will try that out.

James

--
ubuntu-server mailing list
ubuntu-server@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-server
More info: https://wiki.ubuntu.com/ServerTeam


All times are GMT. The time now is 01:03 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.