storage display error

alex.wu

Cadet
Joined
Sep 27, 2022
Messages
6
Dear All

i have a questions, i can see home folders used size in pool is 27TB, but when i enter to check details usage, i can see the totally useage is 2TB around.
i am new to truenas. hopefully i can have answer in here.

1664342281628.png

1664342431974.png
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,702
You're correct that the first 6 lines (which are the bulk of the data it seems) adds to something around 2.5TB and there's maybe enough to account for about 3TB all up.

The first question I would ask you is, "are you using snapshots?"
 

alex.wu

Cadet
Joined
Sep 27, 2022
Messages
6
You're correct that the first 6 lines (which are the bulk of the data it seems) adds to something around 2.5TB and there's maybe enough to account for about 3TB all up.

The first question I would ask you is, "are you using snapshots?"
hi Sretalla, thanks for your answer, i am do using snapshots. but i dont see a large snapshot in there, please have a look! thanks
1664361779297.png
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,702
Have a look at the "referenced" column... the snapshot itself is tiny, but it points at (and reserves) blocks to the value of the "referenced" size.

If a block is referenced in a snapshot, it can't be shown as free space.
 

alex.wu

Cadet
Joined
Sep 27, 2022
Messages
6
Have a look at the "referenced" column... the snapshot itself is tiny, but it points at (and reserves) blocks to the value of the "referenced" size.

If a block is referenced in a snapshot, it can't be shown as free space.
thanks for the answer. i dont know what you mean. can you explain me more? as my experience snapshot won't occupy the same size as the original file
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,702
thanks for the answer. i dont know what you mean. can you explain me more? as my experience snapshot won't occupy the same size as the original file
OK, let's do a simple example...

Empty pool to start, 10 TB free...

Add 2TB worth of files, 8TB free.

Take a snapshot (snapshot size 50KB, won't really make a difference to free/used space when measuring in TB). Snapshot referenced size is 2TB.

Delete the 2TB of files, 8TB free... (what?... I hear you saying... where are my 2TB back after deleting the files?)

The snapshot is just a set of pointers/addresses to all the blocks that were in use at the time it was taken (which is how 2TB can be "captured" in a snapshot of only 50KB size).

When a file is deleted in ZFS, the pointers to the blocks of that file in the live filesystem are removed, but in calculating free space, all blocks "used" are calculated by adding all blocks in the current filesystem AND all blocks referenced by snapshots, since you can't use them if you want the snapshot to remain valid. ZFS also takes this into account when allocating new blocks for writing to.

So, delete the snapshot, 10TB free.

Of course that's a simple example and doesn't take into account things like the same blocks being part of many snapshots, but also doesn't account for large deletions in between any or all of the many snapshots, which can mean each snapshot can be a different percentage of its referenced size.

Also, I notice that the screenshot you're sharing isn't really looking at filesystem sizes, rather quotas, so that can also have some impact here.
 

alex.wu

Cadet
Joined
Sep 27, 2022
Messages
6
OK, let's do a simple example...

Empty pool to start, 10 TB free...

Add 2TB worth of files, 8TB free.

Take a snapshot (snapshot size 50KB, won't really make a difference to free/used space when measuring in TB). Snapshot referenced size is 2TB.

Delete the 2TB of files, 8TB free... (what?... I hear you saying... where are my 2TB back after deleting the files?)

The snapshot is just a set of pointers/addresses to all the blocks that were in use at the time it was taken (which is how 2TB can be "captured" in a snapshot of only 50KB size).

When a file is deleted in ZFS, the pointers to the blocks of that file in the live filesystem are removed, but in calculating free space, all blocks "used" are calculated by adding all blocks in the current filesystem AND all blocks referenced by snapshots, since you can't use them if you want the snapshot to remain valid. ZFS also takes this into account when allocating new blocks for writing to.

So, delete the snapshot, 10TB free.

Of course that's a simple example and doesn't take into account things like the same blocks being part of many snapshots, but also doesn't account for large deletions in between any or all of the many snapshots, which can mean each snapshot can be a different percentage of its referenced size.

Also, I notice that the screenshot you're sharing isn't really looking at filesystem sizes, rather quotas, so that can also have some impact here.
very appreciate your answer. thanks!!!
 

joeschmuck

Old Man
Moderator
Joined
May 28, 2011
Messages
10,972
Of course that's a simple example and doesn't take into account things like the same blocks being part of many snapshots, but also doesn't account for large deletions in between any or all of the many snapshots, which can mean each snapshot can be a different percentage of its referenced size.
That is an excellent example/answer and would do fine for 98% of the people asking that same type of question. Simple is good!
 
Top