You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users-cn@cloudstack.apache.org by Ningning Li <li...@wandoujia.com> on 2013/06/28 12:49:41 UTC

如何挂载qcow2 镜像文件中的的 lvm 分区

一个qcow2格式的文件vm07.qcow2 ,里面有lVM分区,如果挂载呢?

# modprobe nbd max_part=16

# qemu-nbd -c /dev/nbd0 vm07.qcow2

# partprobe /dev/nbd0

# fdisk -ul /dev/nbd0

Disk /dev/nbd0: 180.4 GB, 180388626432 bytes

255 heads, 63 sectors/track, 21931 cylinders, total 352321536 sectors

Units = sectors of 1 * 512 = 512 bytes

Sector size (logical/physical): 512 bytes / 512 bytes

I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk identifier: 0x0007e2d5


     Device Boot      Start         End      Blocks   Id  System

/dev/nbd0p1   *        2048     1050623      524288   83  Linux

Partition 1 does not end on cylinder boundary.

/dev/nbd0p2         1050624     9439231     4194304   82  Linux swap /
Solaris

Partition 2 does not end on cylinder boundary.

/dev/nbd0p3         9439232    37748735    14154752   8e  Linux LVM


求教,thx.






-- 
Ningning Li | wateer
sa | Wandou Labs
qq 468032221
tel 186 1220 6308

Re: 如何挂载qcow2 镜像文件中的的 lvm 分区

Posted by Jijun <ji...@gmail.com>.
On 06/28/2013 06:49 PM, Ningning Li wrote:
> 一个qcow2格式的文件vm07.qcow2 ,里面有lVM分区,如果挂载呢?
>
> # modprobe nbd max_part=16
>
> # qemu-nbd -c /dev/nbd0 vm07.qcow2
>
> # partprobe /dev/nbd0
>
> # fdisk -ul /dev/nbd0
>
> Disk /dev/nbd0: 180.4 GB, 180388626432 bytes
>
> 255 heads, 63 sectors/track, 21931 cylinders, total 352321536 sectors
>
> Units = sectors of 1 * 512 = 512 bytes
>
> Sector size (logical/physical): 512 bytes / 512 bytes
>
> I/O size (minimum/optimal): 512 bytes / 512 bytes
>
> Disk identifier: 0x0007e2d5
>
>
>      Device Boot      Start         End      Blocks   Id  System
>
> /dev/nbd0p1   *        2048     1050623      524288   83  Linux
>
> Partition 1 does not end on cylinder boundary.
>
> /dev/nbd0p2         1050624     9439231     4194304   82  Linux swap /
> Solaris
>
> Partition 2 does not end on cylinder boundary.
>
> /dev/nbd0p3         9439232    37748735    14154752   8e  Linux LVM
>

你可以先active
lvchange -ay /dev/VolGroup/lv_root
然后在执行挂载:
mount /dev/VolGroup/lv_root /mnt



-- 
Thanks,
Jijun