Running out of storage, but VM has lots of room free

I got an alert that I was running out of disk space (less than 1GB available), but the Virtual Machine reports I have ~21 GB of unused space on the disk:

I just deleted a bunch of old backups, so am okay for now – but this was perplexing and a bit concerning. Any ideas what is going on here?

Home Assistant OS 9.5 in VirtualBox on a MacPro
Home Assistant Core 2023.2.5

After a few weeks of regular backups I’m again getting the alert that I’m running out of disk space. VirtualBox reports a Virtual Size of the disk as 32 GB, but Actual Size of ~11 GB:

My understanding is the disk should expand as necessary (up to the 32 GB max), but this doesn’t seem to be working as I keep getting warnings that I’m running out of disk space.

I’d be happy to just make the Actual Size the full Virtual Size (I have plenty of disk space on this machine), but I have no idea how to do that either.

Any ideas?

Could it be this ?

See Windows - Home Assistant

@Rofo Thanks for the reply, and apologies for taking so long to respond (I never saw a notification about your reply :woozy_face:).

--discard looks like it’d do the opposite of what I want:

Enables the auto-discard feature for a virtual hard disks. This specifies that a VDI image will be shrunk in response to the trim command from the guest OS.

The problem seems to be that virtual disk won’t expand when needed? I’m happy to have VirtualBox take the full allocated size for that disk (32 GB) so Home Assistant has plenty of disk space. But keep in mind I know nothing about this stuff. But I just ran that command you suggested to apply the --discard option to the VDI (seems like a good thing to have on regardless).

I just checked the size of the virtual disk in VirtualBox and it’s the same value as back in March (11.01 GB), which seems oddly similar if it’s supposed to be expanding and contracting. And Home Assistant says 91.2% of the disk space is being used. I got another notification recently that I was running out of disk space and had to manually delete some backups, so whatever is happening seems to have persisted.

I tried increasing the size of the virtual disk via the VBoxManage modifymedium command, as detailed here, but Home Assistant still shows 91.2% of disk space used.

Hmm… really odd. What version of VirtualBox are you running ?
I’m using the windows version and the only difference I can see is in the type of storage you’ve enabled. This is my storage screenshot:

You have ‘differencing storage’ which I’m not familiar with.

Also the size on disk and the virtual size don’t have an obvious correlation to free space.

You’d think my free space was 48 - 36.75 or 11.25 GB
But in my HA install it says:

What does your HA install say you have when you go to system → storage ? Whats the used and total ?

And did you fully restart the VM when you resized the disk ?

I’m running VirtualBox 7.0.10, on a Mac (just updated to 7.0.10, but generally keep it fairly up to date).

Yeah, I’m not entirely sure what “differencing storage” is either.

The other thing I’ve noticed while poking around with this is that my HD controller is IDE, whereas yours (and a lot of examples I’m seeing) are SATA. According to this SATA is basically newer and better. Not sure if this matters here, but it’s one of the only things I can see that is different.

What does your HA install say you have when you go to system → storage ? Whats the used and total ?

It just says Used Space: 90.9% – doesn’t show me a total:

And did you fully restart the VM when you resized the disk ?

Yep. I had the VM shut down when I re-sized. VirtualBox correctly reports the new size:

But Home Assistant doesn’t seem to see that extra space… I doubled the size of the disk and Home Assistant still says it’s using ~91% of available space.

At this point my best bet might be to create a new SATA disk in VirtualBox, install HAOS fresh and restore my current Home Assistant to that from a backup. :confused:

In case anyone else comes across this:

  • I tried creating a new SATA disk controller and attaching the existing .vdi to that instead of the IDE one. Home Assistant stopped automatically booting – trying to start the VM brought up a UEFI shell.
  • I rolled that back and tried creating an entirely new SATA controller that I installed a fresh copy of HAOS on to, then I did a restore of a recent Home Assistant backup (which took forever and had no indication of if it was still progressing or not). Again, it wouldn’t auto-boot.
  • Finally ended up creating a new VM in VirtualBox with the same settings – it created a SATA controller automatically this time – and used the existing .vdi for the new VM.

Seems to be working now:

My suggestion: if you’re having a similar issue with an IDE disk controller than won’t expand, try creating a new VM in VirtualBox with similar settings, making sure the new VM is using a SATA controller for the hard drive, and select your existing .vdi file when you set up the new VM.