0

Okay so, I've got Ubuntu 16 running in a virtual machine (on a Windows 10 host but I don't think that is relevant). Right now my partition looks like that :

Current partition state

What I want to do is shrink my /dev/sda1 partition because my virtual image takes up 50GB of my host's space and that's much more than what I need. Problem is, when I try to, GParted won't let me shrink it below around 46GB, although it looks perfectly aware that only 25GB are used atm. I even tried deleting /dev/sda2 to have unallocated space on the right but it doesn't work.

Cannot shrink /dev/sda1

I tried to use google but all I can find are problems where GParted thinks that a partition is full while it's not, which is obviously not the case here.

Thanks for your help !

PS : I start GParted using "sudo gparted" in my terminal if that is of any help.

TheOdd
  • 3,012
Kishlin
  • 103
  • 3

1 Answers1

0

Assuming that you are using Virtualbox,

Since your goal is to actually shrink the .vdi file on the host system, if you selected Dynamic when you created it, nothing you do on the guest system will work. A virtualbox dynamic volume only expands dynamically. Even if you delete all the partitions on your guest system, the .vdi file will not shrink. It will remain the same.

Additional information

Check these instructions over here if you like, on how a .vdi file shrinking can be accomplished. The parameter you need is --compact. It can be done in a completely different way.

Stormlord
  • 6,807