libvirt/HDD拡張 をテンプレートにして作成
[
トップ
] [
新規
|
一覧
|
検索
|
最終更新
|
ヘルプ
|
ログイン
]
開始行:
qemuもVMwareと同じで途中でHDDの拡張が必要なときはある。こ...
現状確認
#code(nonumber){{
[root@c3 ~]# df
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/vda3 6707736 872856 5494144 14% /
tmpfs 510200 0 510200 0% /dev/shm
/dev/vda1 516040 60644 429184 13% /boot
[root@c3 ~]#
}}
qemuサーバからc3マシンの停止
#code(nonumber){{
[root@s ~]# virsh shutdown c3
強制停止が必要なら
[root@s ~]# virsh destroy c3
}}
HDDイメージファイルの確認とそのサイズ拡張
#code(nonumber){{
[root@s ~]# qemu-img info /qemu/c3.img
image: /qemu/c3.img
file format: qcow2
virtual size: 8.0G (8589934592 bytes)
disk size: 1.4G
cluster_size: 65536
Format specific information:
compat: 0.10
[root@s ~]#
[root@s ~]# qemu-img resize /qemu/c3.img 16G
Image resized.
[root@s ~]#
[root@s ~]# qemu-img info /qemu/c3.img
image: /qemu/c3.img
file format: qcow2
virtual size: 16G (17179869184 bytes)
disk size: 1.4G
cluster_size: 65536
Format specific information:
compat: 0.10
[root@s ~]#
}}
これで拡張は済んだが、パーティションも移動させないと意味...
#code(nonumber){{
[root@s ~]# virsh edit c3
- <disk type='block' device='cdrom'>
+ <disk type='file' device='cdrom'>
<driver name='qemu' type='raw'/>
+ <source file='/export/gparted-live-0.15.0-1-i486.is...
<target dev='hdc' bus='ide'/>
<readonly/>
<address type='drive' controller='0' bus='1' target...
</disk>
[root@s ~]#
[root@s ~]# virsh start c3
}}
と修正を加えて起動させる。あとは前と同じように
&ref(2014y04m29d_120417519.png,nolink);
を
&ref(2014y04m29d_120425510.png,nolink);
として調整完了。完了したら一度shutdownして、再度virsh edi...
#code(nonumber){{
[root@s ~]# virsh edit c3
+ <disk type='block' device='cdrom'>
- <disk type='file' device='cdrom'>
<driver name='qemu' type='raw'/>
- <source file='/export/gparted-live-0.15.0-1-i486.is...
<target dev='hdc' bus='ide'/>
<readonly/>
<address type='drive' controller='0' bus='1' target...
</disk>
[root@s ~]#
[root@s ~]# virsh start c3
}}
っで確認
#code(nonumber){{
[root@c3 ~]# df
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/vda3 14964752 874548 13330040 7% /
tmpfs 510200 0 510200 0% /dev/shm
/dev/vda1 516040 60644 429184 13% /boot
[root@c3 ~]#
}}
終了行:
qemuもVMwareと同じで途中でHDDの拡張が必要なときはある。こ...
現状確認
#code(nonumber){{
[root@c3 ~]# df
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/vda3 6707736 872856 5494144 14% /
tmpfs 510200 0 510200 0% /dev/shm
/dev/vda1 516040 60644 429184 13% /boot
[root@c3 ~]#
}}
qemuサーバからc3マシンの停止
#code(nonumber){{
[root@s ~]# virsh shutdown c3
強制停止が必要なら
[root@s ~]# virsh destroy c3
}}
HDDイメージファイルの確認とそのサイズ拡張
#code(nonumber){{
[root@s ~]# qemu-img info /qemu/c3.img
image: /qemu/c3.img
file format: qcow2
virtual size: 8.0G (8589934592 bytes)
disk size: 1.4G
cluster_size: 65536
Format specific information:
compat: 0.10
[root@s ~]#
[root@s ~]# qemu-img resize /qemu/c3.img 16G
Image resized.
[root@s ~]#
[root@s ~]# qemu-img info /qemu/c3.img
image: /qemu/c3.img
file format: qcow2
virtual size: 16G (17179869184 bytes)
disk size: 1.4G
cluster_size: 65536
Format specific information:
compat: 0.10
[root@s ~]#
}}
これで拡張は済んだが、パーティションも移動させないと意味...
#code(nonumber){{
[root@s ~]# virsh edit c3
- <disk type='block' device='cdrom'>
+ <disk type='file' device='cdrom'>
<driver name='qemu' type='raw'/>
+ <source file='/export/gparted-live-0.15.0-1-i486.is...
<target dev='hdc' bus='ide'/>
<readonly/>
<address type='drive' controller='0' bus='1' target...
</disk>
[root@s ~]#
[root@s ~]# virsh start c3
}}
と修正を加えて起動させる。あとは前と同じように
&ref(2014y04m29d_120417519.png,nolink);
を
&ref(2014y04m29d_120425510.png,nolink);
として調整完了。完了したら一度shutdownして、再度virsh edi...
#code(nonumber){{
[root@s ~]# virsh edit c3
+ <disk type='block' device='cdrom'>
- <disk type='file' device='cdrom'>
<driver name='qemu' type='raw'/>
- <source file='/export/gparted-live-0.15.0-1-i486.is...
<target dev='hdc' bus='ide'/>
<readonly/>
<address type='drive' controller='0' bus='1' target...
</disk>
[root@s ~]#
[root@s ~]# virsh start c3
}}
っで確認
#code(nonumber){{
[root@c3 ~]# df
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/vda3 14964752 874548 13330040 7% /
tmpfs 510200 0 510200 0% /dev/shm
/dev/vda1 516040 60644 429184 13% /boot
[root@c3 ~]#
}}
ページ名:
1