Link to home
Start Free TrialLog in
Avatar of Don Smith
Don Smith

asked on

How to expand existing partitions for a hyper-v (vhd) image that has been installed but the partitions are too small for our needs

I am in the process of standing up a Ubuntu Linux server from a .vhd file.
The existing partitions are too small to handle the backup file thus I need to add extra partition space to the system.
This is a hyper-V hosted system.
I've never done this before. Can someone give me some guidance on what I will need to do?
Initially I was building a new server with 2 Tb of disk space but we decided to use a existing secured version of a .ova file which I converted over to a .vhd file.
Can anyone help me understand what I need to do?
We have more space available, the vhd was set to more than what the original image was configured for.
How can I expand the relevant partitions to take account of this extra available space?
Which partitions should get the extra space?  Opt is where the backups are stored via the main application so that one definitely needs to be expanded.
Filesystem                        Size  Used Avail Use% Mounted on
udev                               16G     0   16G   0% /dev
tmpfs                             3.1G  8.7M  3.1G   1% /run
/dev/mapper/vg00-root              19G  1.4G   17G   8% /
tmpfs                              16G  4.0K   16G   1% /dev/shm
tmpfs                             5.0M     0  5.0M   0% /run/lock
tmpfs                              16G     0   16G   0% /sys/fs/cgroup
/dev/sda1                         464M   58M  382M  14% /boot
/dev/mapper/vg00-opt               76G   76G     0 100% /opt
tmpfs                             3.1G     0  3.1G   0% /run/user/1000
tmpfs                             3.1G     0  3.1G   0% /run/user/1001
Avatar of Philip Elder
Philip Elder
Flag of Canada image

I'm not sure Ubuntu supports online expansion.

In Hyper-V Manager click EDIT under the Disk menu on the right, select the VHDX, and Expand. Once complete, use Ubuntu's disk manager to extend the existing partition. This may be able to be done while the VM is online.
LVM supports online expansion

Make sure to backup.
You would need to expand the vhd size
The host needs to allocate more space
Pvdisplay
Vgextend
Lvresize ......
This question needs an answer!
Become an EE member today
7 DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform.
View membership options
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.