Resize KVM hard drive on a non LVM partition

asmar

Renowned Member
Nov 15, 2014
108
0
81
Hi all,

I've got a VM with initially about 100GB disk space which I want to enlarge.
I've changed the disk size through the GUI rebooted but drive is not getting bigger.

Code:
[root@dionysos ~]# df -kh
Filesystem      Size  Used Avail Use% Mounted on
/dev/sda2       115G   65G   44G  60% /
tmpfs           7.8G     0  7.8G   0% /dev/shm
/usr/tmpDSK     4.0G  140M  3.7G   4% /tmp

With fdisk however it reports the proper size that I want to have:
Code:
[root@dionysos ~]# fdisk -l

Disk /dev/loop0: 4294 MB, 4294967296 bytes
255 heads, 63 sectors/track, 522 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000


Disk /dev/sda: 343.6 GB, 343597383680 bytes
255 heads, 63 sectors/track, 41773 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000dcb4e

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1               1         511     4096000   82  Linux swap / Solaris
Partition 1 does not end on cylinder boundary.
/dev/sda2   *         511       15666   121732096   83  Linux

Any idea how I can make this drive to work with the new size?
All the docs I found online are relatively to LVM paritions.

Thanks