Full disk is never fun, neither on the personal computer, neither on the remote server. It’s a great classic:

  • you want to install a new game, or you need a new docker image, but your harddrive is full. What do you do?
  • your server does not respond anymore. You check the stats: hard-drive is full, and you can’t do anything (it’s really hard just to login). What do you do?

So here is a strategy that works very well: delete staff. Or get a bigger disk. As the latin say tertium non datur

One great way to save space is to offload some of the documents somewhere else.

For example I have data in google cloud, and I actually pay the service for having additional space to save my files.

For my medical records, and the one of my family, I actually use https://ippocra.com/, which, on top of providing encrypting data, and auto-categorization per type and per person for the documents, has the smart search, which is a saviour.

In particular, I know my stuff is there and I do not need to worry anymore.

Small caveat: I’ve built Ippocra, because there was nothing even close to that.

How to delete files from the console in linux

So the first thing to do is to understand where we start: df gives you a good idea where you stand.

mattions@ares:~$ df -h
Filesystem      Size  Used Avail Use% Mounted on
tmpfs           1.6G  2.8M  1.6G   1% /run
/dev/nvme0n1p2  468G  255G  190G  58% /
tmpfs           7.7G  513M  7.2G   7% /dev/shm
tmpfs           5.0M  8.0K  5.0M   1% /run/lock
efivarfs        246K   60K  182K  25% /sys/firmware/efi/efivars
/dev/nvme0n1p1  1.1G  6.3M  1.1G   1% /boot/efi
tmpfs           1.6G  132K  1.6G   1% /run/user/1000

Now that you have an idea, you’ve got to find the big files:

find . -size +1000M -ls

After you find them, you can delete them. Or offload them somewhere else, or buy a new disk.

P.S.: I suggest also to look into du as command, that can give you an idea of how much space for each directory.

Let me take also a moment to say Happy New Year to everyone!