Skip to content

Instantly share code, notes, and snippets.

@giwa
Last active August 29, 2015 14:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save giwa/3f7ea380b3469e680a63 to your computer and use it in GitHub Desktop.
Save giwa/3f7ea380b3469e680a63 to your computer and use it in GitHub Desktop.
add LVM and extend existed volume
Personal memo for extend LVM voule
Disk /dev/vda: 317.1 GB, 317085921280 bytes
255 heads, 63 sectors/track, 38550 cylinders, total 619308440 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x0009c06d
Device Boot Start End Blocks Id System
/dev/vda1 * 63 1028159 514048+ 83 Linux
/dev/vda2 1028160 409593239 204282540 8e Linux LVM
# sync
# shutdown
Resize a qemu image
# qemu-resize filename +100G
Boot VM
# fdisk /dev/vda
n
3
p
return
return
t
3
8e
w
# sync
# reboot
# pvcreate /dev/vda3
# vgextend system /dev/vda3
# lvextend -l +100%FREE
# resize2fs /dev/system/var
Disk /dev/vda: 317.1 GB, 317085921280 bytes
255 heads, 63 sectors/track, 38550 cylinders, total 619308440 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x0009c06d
Device Boot Start End Blocks Id System
/dev/vda1 * 63 1028159 514048+ 83 Linux
/dev/vda2 1028160 409593239 204282540 8e Linux LVM
/dev/vda3 409593240 619308439 104857600 8e Linux LVM
refs
http://se-suganuma.blogspot.jp/2009/04/centoslvmvmwarehdd.html
http://j-caw.co.jp/blog/?p=991
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment