Categories: Opinion

Ubuntu Linux VM on Hyper-V – Expand Virtual disk to full size

Ubuntu initial setup does not do expand the virtual disk image to it’s full size. You should to this after setting up Ubuntu or when expanding the size of the VHD file.

First off, check where is ubuntu located (/dev/sdxY) and the actual drive space available with:

sudo lsblk -o NAME,FSTYPE,SIZE,MOUNTPOINT,LABEL

To expand, run:

sudo pvs

Resize with:

sudo pvresize /dev/sda1

Get mapper for drive with:

df -h

Expand the filesystem with:

sudo lvextend -r -l +100%FREE /dev/mapper/ubuntu--vg-root

Run the inital command again and check if it’s done.

sete

Recent Posts

Synology – Modify public link metadata (site description and keywords)

If you have a Synology DiskStation and you have shared your public NAS link on…

4 years ago

Synology DSM 7 Docker error – Container crashes on boot – Solution / Fix

A common issue that appeared with DSM 7 is that some well known containers started…

4 years ago

Windows Sandbox – How to install Windows Store apps

The Windows Sandbox image is useful for many test setups, but it lacks much of…

5 years ago

Windows 10 Snip & Sketch app fails – “Failed to open the file” error fix

If you're used to Snip & Sketch for adding some scribbles placed over desktop screenshots,…

6 years ago

How to solve “Contacting the server for information” in Microsoft / Office 365 apps

On some occasions Microsoft 365 Office applications might open a popup with "Contacting server for…

6 years ago

Here are Chocolatey’s common commands – Windows command line Package Manager

You might have already heard about Chocolatey, a package manager similar to apt-get in linux…

6 years ago