Last active
December 29, 2015 23:39
-
-
Save tkuchiki/7744641 to your computer and use it in GitHub Desktop.
KVM disk 拡張
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sleep を挟みながら、1G くらいずつ足していく | |
# よくない方法 | |
# 10G 追加 | |
dd if=/dev/zero of=./add_disk.img bs=1G count=10 | |
cat add_disk.img >> disk.img | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
cd /var/lib/libvirt/images | |
# sparse | |
qemu-img create -f raw add-disk.img 1G | |
# non sparse | |
#dd if=/dev/zero of=./add_disk.img bs=1G count=10 | |
for i in `seq 1 20`; do | |
cat add-disk.img >> ./vm-disk.img | |
echo $i | |
sleep 60 | |
done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fdisk /dev/xxx などで、末尾のパーティションを削除。 | |
削除した後に、パーティションを切り直す。 | |
その後に VM reboot。 | |
最後に resize2fs で完了。 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment