hard disk free space not increase after delete files from ZFS file system(Ubuntu 20.04.2 LTS)

Solution 1:

Some of the data may be tied up in snapshots. You can list them in the terminal with the following command:

zfs list -t snapshot

If there is one that is particularly large, you can remove it like this:

sudo zfs destroy rpool/USERDATA/MHT@FRIDAY04-30-21

Be careful when issuing zfs destroy commands, because there is no undo. You will not destroy your file system, but you will not be able to rollback to a point in time if you need to.

Solution 2:

Possibly this is not related to zfs.

There are two cases where deleting a file in unix only deletes the name, not the actual data.

Those two cases are:

  • hard linked files, where the file is not deleted until the last hardlink is deleted
  • open files, where the file is not deleted until the last program with the file open closes it or exists (and all hardlinks are deleted)

You can check for hardlinks with the ls -l command (but if you've already deleted it, that's no help).

If you know what might have had large files open, you can try closing or killing those programs. Or just reboot.

Note that if you reboot, make sure it is a clean shutdown and reboot, otherwise the files will still not be deleted without a fsck, and the fsck may just relocate them to LOST+FOUND.