0

I have 1TB drive running zfs on root using ubuntu 21.04. I was using less than 70GB for my system. I have created (truncated) an image file using 600GB. I used this image file for a different zfs dataset. Then I destroyed the pool and the image file dataset. I have also truncated the image file to 0. I was able to recover about 200GB. I am missing more than 400GB of disc space. zfs reports that I am using 673GB. I do not see more than 70GB used. I do not see any snapshots using so much disk space.

#zfs list -o space -r rpool show that rpool/ROOT/ubuntu_ycu6f2 uses 636GB for snapshots. I cannot find these snapshots.

 NAME AVAIL USED USEDSNAP USEDDS USEDREFRESERV USEDCHILD rpool 241G 673G 0B 96K 0B 673G rpool/ROOT 241G 647G 0B 96K 0B 647G rpool/ROOT/ubuntu_ycu6f2 241G 647G 636G 3.83G 0B 6.56G .... 

zfs list -t snapshot rpool/ROOT/ubuntu_ycu6f2

NAME USED AVAIL REFER MOUNTPOINT rpool/ROOT/ubuntu_ycu6f2@autozsys_14wuai 245M - 637G - rpool/ROOT/ubuntu_ycu6f2@autozsys_edz0lw 122M - 637G - rpool/ROOT/ubuntu_ycu6f2@autozsys_m7el6f 201M - 637G - rpool/ROOT/ubuntu_ycu6f2@autozsys_4fi5he 167M - 4.14G - rpool/ROOT/ubuntu_ycu6f2@autozsys_3af8r6 130M - 4.35G - 

How can I find where is the missing disk space and how I can recover it.

1 Answer 1

1

Look at the REFER column in the zfs list output. Notice that the first three snapshots reference 637G. The last two snapshots reference only 4.14G and 4.35G, respectively. It would appear then, that the file(s) you truncated are still referenced in the first three snapshots, but not in the last two.

To reclaim the space, you need to delete the snapshots that predate the moment when you truncated the file(s):

sudo zfs destroy -v rpool/ROOT/ubuntu_ycu6f2@autozsys_14wuai sudo zfs destroy -v rpool/ROOT/ubuntu_ycu6f2@autozsys_edz0lw sudo zfs destroy -v rpool/ROOT/ubuntu_ycu6f2@autozsys_m7el6f 

Adding the -v option to the zfs destroy command line will show you how much space is being freed by each command. Once you have destroyed those snapshots, you should regain about 633G of free space.

1
  • Yes that was the issue. I still do not understand why "zfs list -t snapshot" did not list these "hidden" snapshots. Commented Sep 18, 2021 at 18:38

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.