KVM을 이용해 가상화를 구현하였을 경우 디스크 사이즈 확장하는 방법
:: 본문서는 / 파티션 1개만 사용하였을 경우이며 여러개로 나눌경우 각 파티션마다의 섹터값을 계산해줘서 넣어야 합니다.
VM
=>> -l 옵션으로 보여지는 값은 cylinders
:: 디스크 사이즈 변환을 위해 셧다운
# shutdown
HOST
:: 기존 100G 디스크를 60G 확장
# qemu-img resize ${이미지명} +60G Image resized.
VM
:: HOST에서 늘려준 디스크 사이즈가 확장은 되었으나 실제 VM에 적용전이다.

fdisk 혹은 parted 명령어를 통해 파티션 확장 (Sector 값 주의 / cylinders 아님)
※ fdisk -u[=unit] When listing partition tables, show sizes in 'sectors' or in 'cylinders'. The default is to show sizes in sectors. For backward compatibility, it is possible to use the option without the <units> argument -- then the default is used. Note that the optional <unit> argument cannot be separated from the -u option by a space, the correct form is for example '-u=cylinders'.
|
# reboot
# resize2fs /dev/sda1
※ OpenStack 에서는 Flavor 를 선택하게 되면 디스크가 자동으로 리사이즈 되기에 HOST에서 하는 작업은 건너띄면 됩니다.