0

I want to resize the main partition of my Linux VM.

  1. I added space through ESXi interface
  2. Booted on GParted and resized the partitions

However, the system does recognize the changes on disk increase but not the one on partition increase:

I looked up for a few tutorials but they don't really seems to apply.

Here are some output:

{root@tuc[antoine]}df -h
Filesystem                Size  Used Avail Use% Mounted on
/dev/mapper/tuc--vg-root   31G   28G  1.2G  97% /              ==> 32GB is old size
none                      4.0K     0  4.0K   0% /sys/fs/cgroup
udev                      991M  4.0K  991M   1% /dev
tmpfs                     201M  532K  200M   1% /run
none                      5.0M     0  5.0M   0% /run/lock
none                     1001M     0 1001M   0% /run/shm
none                      100M     0  100M   0% /run/user
/dev/sda1                 236M  215M  8.6M  97% /boot

And with fdisk:

{root@tuc[antoine]}fdisk /dev/sda

Command (m for help): p

Disk /dev/sda: 68.7 GB, 68719476736 bytes                        ===> Here I have the updated size... 
255 heads, 63 sectors/track, 8354 cylinders, total 134217728 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: 0x0006fdd8

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *        2048      499711      248832   83  Linux
/dev/sda2          501758   134217727    66857985    5  Extended
/dev/sda5          501760   134217727    66857984   8e  Linux LVM

And gparted screenshot:

everything looks nice here

How to make it so that ubuntu will expand to the full size available ?

1

Typically the steps are:

  1. Resize the partitions to match the new disk size. You seem to have done that already.

  2. Resize the LVM Volgume group to make the new space in the partition available to the volume manager: vgextend

  3. Resize the Logical Volume with the file-system you want to extend: lvresize note: don't mistake the --size <new capacity> for --size +<additional capacity>

  4. Resize the filesystem: resize2fs

The options needed are well documented.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.