-- Leo's gemini proxy

-- Connecting to nuacht.flounder.online:1965...

-- Connected

-- Sending request

-- Meta line: 20 text/gemini; charset=utf-8

shrink a Virtual Box disk image (dynamic)


In the Virtual machine itself

sudo apt install zerofree

boot into emergency mode with GRUB by pressing 'e' and appending the line beginning with 'linux' with the text

systemd.unit=emergency.target

F10 to boot. Log in as root and then run:

mount -o remount,ro / #makes the partition read-only, which zerofree requires

Then run:

zerofree -v /dev/sda1 #(or whatever you want to target)

Exit. Shutdown the VM and open a terminal in the host OS.


In the host OS terminal


$ vboxmanage list hdds #see all virtual disks and identify the one you want
$ vboxmanage modifymedium disk ./VirtualBox/MyDebian/MyDebian.vdi --compact #substituting the path for the disk you want to target

Done.

-- Response ended

-- Page fetched on Tue May 21 09:46:29 2024