1

I'm trying to extend my Virtual Machine's hard drive, on Ubuntu 16.04 server and have shut down the VM and increased the HDD size and I can see that /dev/sda is now 500GB in total from the previous 349GB.

Filesystem                    1K-blocks      Used Available Use% Mounted on
udev                            4067536         0   4067536   0% /dev
tmpfs                            817544      8956    808588   2% /run
/dev/mapper/owncloud--vg-root 352357500 275943948  58491712  83% /
tmpfs                           4087708         0   4087708   0% /dev/shm
tmpfs                              5120         0      5120   0% /run/lock
tmpfs                           4087708         0   4087708   0% /sys/fs/cgroup
/dev/sda1                        482922     58606    399382  13% /boot
tmpfs                            817544         0    817544   0% /run/user/1000



Disk /dev/sda: 500 GiB, 536870912000 bytes, 1048576000 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
Disklabel type: dos
Disk identifier: 0x72ffcef4

Device     Boot   Start       End   Sectors   Size Id Type
/dev/sda1  *       2048    999423    997376   487M 83 Linux
/dev/sda2       1001470 734001151 732999682 349.5G  5 Extended
/dev/sda5       1001472 734001151 732999680 349.5G 8e Linux LVM

What should I do next?

2
  • Welcome to Ubuntu! :-) What's your actual question? It looks like everything is hunky-dory from an Ubuntu perspective... – Fabby Apr 19 '18 at 10:09
  • 1
    Hi! Well basically i can see the /dev/sda is seeing 500GB, but the usage is still 83%, so it seems the OS is still configured on a 350GB hdd? I need to extend it to use the new space available on the /dev/sda.. This is what worries me /dev/mapper/owncloud--vg-root 352357500 275943948 58491712 83% / – Lee Ryan Padovani Ginies Apr 19 '18 at 10:26
1

What you did was extend the disk itself which is possible in a virtual environment, but not possible in real life as you cannot add more disk platters to an existing disk so the space is there, but it's not allocated to any partitions/volumes yet so boot the VM, ensure all services that need the Logical Volume you want to extend are stopped and do a:

fsadm --ext-offline --yes resize /dev/mapper/owncloud--vg-root 800G

to extend the Logical Volume itself: you're confusing LVMs and partitions: they are fundamentally different, have a look here on TLDP.

1
  • So from my understanding, 800G would have to be 500G in my scenario, and regarding the stopping of all services, there's quite alot of services running. So would this best be done from some kind of shell mode where nothing is running? Perhaps recovery mode? – Lee Ryan Padovani Ginies Apr 23 '18 at 9:47

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.