Skip to content

Instantly share code, notes, and snippets.

View bartgee's full-sized avatar

Bart Grzybicki bartgee

  • private
  • Poland
  • 10:48 (UTC +02:00)
View GitHub Profile
@bartgee
bartgee / gist:8f8e182386b2157df5b5f100ff67cc0e
Created September 12, 2016 14:06
Resizing a filesystem using qemu-img and fdisk

Occasionally we will deploy a virtual instance into our KVM infrastructure and realize after the fact that we need more local disk space available. This is the process we use to expand the disk image. This process assumes the following:

  • You're using legacy disk partitions. The process for LVM is similar and I will describe that in another post.
  • The partition you need to resize is the last partition on the disk.

This process will work with either a qcow2 or raw disk image. For