qcow2 转 lv (kvm)

一、查看qcow2真实大小

     首先检查qcow2文件原始大小为多少  

 #qemu-img info centos6.6.qcow2 
image: centos6.6.qcow2
file format: qcow2
virtual size: 44G (47603253248 bytes)
disk size: 1.9G
cluster_size: 65536
Format specific information:
    compat: 0.10

   从上看出磁盘真实大小为47603253248 bytes

二、创建lv

   本文环境中sda6大小为100G

   分别创建pv vg lv

   注意: lv的大小为上文qcow2镜像的真实大小 单位为b

# pvcreate /dev/sda6
  Physical volume "/dev/sda6" successfully created
# vgcreate lvm_pool /dev/sda6
  Volume group "lvm_pool" successfully created
# lvcreate -L 47603253248b -n centos6.6 lvm_pool
  Rounding up size to full physical extent 44.34 GiB
  Logical volume "centos6.6" created.

  本文创建的lv 为  /dev/lvm_pool/centos6.6

三、将qcow2数据同步至lv

# qemu-img convert -p -O raw centos6.6.qcow2 /dev/lvm_pool/centos6.6

   等待完成后即可进入下一步

四、使用创建好的lv创建虚拟机

步骤如图所示:

164534_jnpX_1436224.png

164534_nHxt_1436224.png

164535_TMJe_1436224.png

164535_2UNw_1436224.png

164535_2CYx_1436224.png


转载于:https://my.oschina.net/firxiao/blog/467390

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值