2.2 步驟
實現此案例需要按照如下步驟進行。
步驟一:創建一個新的鏡像盤文件
qemu-img命令格式:qemu-img 命令 參數 塊文件名稱 大小
[root@room9pc01 ~]# qemu-img create -f qcow2 disk.img 50G //qcow2爲創建的格式
Formatting 'disk.img', fmt=qcow2 size=53687091200 encryption=off cluster_size=65536 lazy_refcounts=off
2)使用後端模板文件創建一個新的鏡像盤文件
備註:-b使用後端模板文件
[root@room9pc01 ~]# qemu-img create -b disk.img -f qcow2 disk1.img
Formatting 'disk1.img', fmt=qcow2 size=53687091200 backing_file='disk.img' encryption=off cluster_size=65536 lazy_refcounts=off
3)使用後端模板文件創建一個16G的鏡像盤文件
[root@room9pc01 ~]# qemu-img create -b disk.img -f qcow2 disk2.img 16G
Formatting 'disk1.img', fmt=qcow2 size=53687091200 backing_file='disk.img' encryption=off cluster_size=65536 lazy_refcounts=off
步驟二:查看鏡像文件的信息
[root@room9pc01 ~]# qemu-img info disk1.img
image: disk.img
file format: qcow2
virtual size: 50G (53687091200 bytes)
disk size: 196K
cluster_size: 65536
Format specific information:
compat: 1.1
lazy refcounts: false | help_topic |
| innodb_index_stats |
| innodb_table_stats |
| ndb_binlog_index |
| plugin |
| proc |
| procs_priv |
| proxies_priv |
| server_cost |
| servers |
| slave_master_info |