Re: Loopback mount a disk image with lvm

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

 



On Mon, Jun 9, 2008 at 8:23 AM, Girish V <girish.xen@gmail.com> wrote:
> Hello,
>
> I have a disk.img (a disk image file, raw format) with the following "fdisk -l"
>
>    Device Boot      Start         End      Blocks   Id  System
> disk.img1   *           1          13      104391   83  Linux
> disk.img2              14        2491    19904535   8e  Linux LVM
>
> Now I can loopback mount the first bartition using
> "mount -o loop,offset=32256 disk.img /mnt".
>
> I need to mount the second partition. If the secoond partition had
> been an ext3 partition, I would have loopback mounted it as
> "mount -o loop,offset=$((255*63*512*13) disk.img /mnt", but when I try
> that, I get
> mount: unknown filesystem type 'LVM2_member'
>
> Any help is greatly appreciated.

losetup /dev/loop0 disk.img
kpartx -a /dev/loop0

Then to mount the first partition:

mount /dev/mapper/loop0p1 /mnt

Or to activate the volume group then mount the logical volume:

vgscan
vgchange -ay vg
mount /dev/vg/lv /mnt

Hope that helps.

--Dave

_______________________________________________
linux-lvm mailing list
linux-lvm@redhat.com
https://www.redhat.com/mailman/listinfo/linux-lvm
read the LVM HOW-TO at http://tldp.org/HOWTO/LVM-HOWTO/

[Index of Archives]     [Gluster Users]     [Kernel Development]     [Linux Clusters]     [Device Mapper]     [Security]     [Bugtraq]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]

  Powered by Linux