ZFS Deleting files doesn’t free up space

So I have a proxmox server on which I run a few VM’s and the other day it completely ran out of space. This was because of overprovisioning through thin volumes.

After much head scratching and metaphorically banging my head against a wall, here are the things I learnt.

Empty Trash

Local Trash

Make sure that have emptied the trash on the VM’s .Ubuntu has this issue and so might other distributions

Network Trash

If you have SAMBA enabled on your VM’s make sure that the Recycle Bin is not enabled. I have openmediavault running on a VM and I had to go through and disable the Recycling Bin. Make sure that the Recycle bin is emptied. They are hidden folders in the root of your shares.

Correct Driver & Settings

  • When setting up the hard drive for your VM, make sure you use virtio-scsi (or just scsi on the web interface).
    • If you disk is already set up using IDE or VirtIO,
      • Delete it. Don’t worry, it’s only deleting the link. The disk itself will show up in the interface afterwards
      • Double click on the unattached disk and select SCSI and Discard
      • You might have to fix the references to the drive in the OS
  • On the Device Screen, make sure discard is selected.

TRIM

Configure the OS to send TRIM commands to the drive

Linux

On Mount

You can pass the parameter discard to any mountpoint and the correct TRIM commands will be sent to the disk. HOWEVER, this is apparently a big performance hit.

To do the actual trim, run

$ fstrim /

OR to run fstrimĀ on all supported drives

$ fstrim -a

Digital Ocean has a detailed post about setting TRIM and setting up a schedule etc.

Windows

My deepest apologies! Also, I don’t run Windows on any of my VM’s so I have no experience with it.

Proprietary FSF

I have always a big fan and proponent of the FSF and having recently been interested in researching for a project came across a document covering Why you shouldn’t use the Lesser GPL for your next library

What the document basically suggests is to limit what proprietary software developers can do by licensing libraries as GPL instead of LGPL.

This is no longer free(as in speech, not beer) software. Why?

Freedom means the ability to use something without restriction. If I cannot use a library in a proprietary product, that is removing an important freedom.

This attitude is likely to alienate the “commercial” or proprietary developers further from FSF/GNU.

In fact, doing this is just not fair and not in line with how I view is the concept behind the FSF. The point is to write software / libraries and share that with the world so others may build upon what you have done. Stand on the shoulders of giants in a way…

It makes perfect sense for software to be GPL since you don’t want somebody to pick up a GPL software, build something on top, and sell it without source.

However, if libraries are released under the GPL instead of LGPL, it means that I can not link against that library to write a non-GPL compatible application.

The GNU Website states

“Free software is a matter of the users’ freedom to run, copy, distribute, study, change and improve”

Additionally, the Quick Guide to GPLv3 states that

Nobody should be restricted by the software they use. There are four freedoms that every user should have:

  • the freedom to use the software for any purpose,
  • the freedom to change the software to suit your needs,
  • the freedom to share the software with your friends and neighbors, and
  • the freedom to share the changes you make.

This has always been my impressing of the purpose of GPL. Now, how does this work with Libraries? A little differently… šŸ˜¦

From my perspective, if I have the freedom to use the [library] for any purpose, that means that I can write an application that uses that library without having to worry about licensing issue.

However, this is not the case. There is a clause that states that the software cannot be used in a larger software project that has a license incompatible with the GPL. This includes linking the library into another software application.

Therefore, I do not have the freedom to use the software for any purpose.

Freedom cannot be uni-directional. If GNU/FSF are trying to muscle out developers of proprietary software, all they are doing is alienating themselves further…

I run a technology firm that uses a heck of a lot of open source software. In fact, I am posting this from an ubuntu desktop running firefox from a VServer. I am probably using a dozen open source applications to do this simple straightforward act.

There is in fact, not a simple closed source application at any point through this.

The main problem that I see with this is that it makes Open Source so much more zealot(ous) and FSF, GNU and OSS becomes fundamentalists. The attitude is not one of freedom and inclusion but of exclusivity and marginalisation.

The worst part is the price that is asked of developers who want to use an Open Source library. The price is the acceptance and propogation of an idea (Freedom or else).

Compared to the cost of conversion to another idealogy (Free Software Idealogy), the cost of a few hundred, thousand, or even millions of dollars / pounds for a piece of software seems dirt cheap.

I understand that each developer has the freedom to choose which license to use for their products/libraries. My question is how can an organisation that claims to be a proponent of freedom encourage the removal of freedoms?

I would like to ask how this shift is any different from religious fanatics who tell you that their god is the one true god and there is nothing else.