× NETGEAR will be terminating ReadyCLOUD service by July 1st, 2023. For more details click here.
Orbi WiFi 7 RBE973
Reply

How to cCheck Size of a share/folder?

AndreasKa
Tutor

How to cCheck Size of a share/folder?

I may be missing something very simple here but I can't seem to view the size of a share or any folder via the web admin -> shares menu.
When using the list view, there are 4 columns;Name, Type, Size and Date. From a top level view, 'Size and 'Date' are blank for all my shares.

Going one level down i.e. click on a share name, the size is still blank but the date field is now populated.

What am i missing?
Message 1 of 17
mdgm-ntgr
NETGEAR Employee Retired

Re: How to cCheck Size of a share/folder?

This is not possible in the current firmware.

We will certainly consider if there is a way to implement this in a future release.
Message 2 of 17
AndreasKa
Tutor

Re: How to cCheck Size of a share/folder?

Thanks for the response.
Seems a bit strange that the field is there is the list view when it will never be populated in the current firmware version.

Do i need to post this request in the feature request section?
Message 3 of 17
StephenB
Guru

Re: How to cCheck Size of a share/folder?

It's been requested before, so I don't think you need to post it again. Though you can if you like of course.

This sounds simple, but with btrfs file systems it actually isn't. With CoW, data blocks are shared between multiple folders. The way the NAS is structured that is limited to folders and their snapshots, but the file system isn't limited to only that structure. So even defining what the folder size means isn't that simple for btrfs generally.

For the normal OS6 share structure, the feature can be provided, but it relies on the btrfs quota package - last time I heard that was still viewed as experimental. Hopefully Netgear will add it as soon as it is fully stable.
Message 4 of 17
AndreasKa
Tutor

Re: How to cCheck Size of a share/folder?

Interesting insight
Message 5 of 17
Hephaestus1
Aspirant

Re: How to cCheck Size of a share/folder?

Bumping this old thread just to indicate that there is still interest in having some sort of indicator, even if not very accurate. While I understand StephenB explanation, clearly there is a way to implement simple bar style indicator, as proved by the fact that it was done for full volume, and shows very nicely "data" -- as a bar, pie chart or numeric values. I am not certain why it was possible to do it for full volume, yet it is supposedly so difficult to have similar indicators next to each share/folder. This is pretty basic functionality - and is still sadly missing.
Message 6 of 17
StephenB
Guru

Re: How to cCheck Size of a share/folder?

Hephaestus wrote:
I am not certain why it was possible to do it for full volume, yet it is supposedly so difficult to have similar indicators next to each share/folder. This is pretty basic functionality - and is still sadly missing.
It's simple for the entire volume because the file system does know how many data blocks are used in total. Without the quota feature I mentioned above, btrfs doesn't have an easy way to track how many data blocks are uniquely used in each folder when snapshots are enabled.

Some of the other proposed features (in particular using --reflink by default when moving files between shares) make this problem more complicated, since it extends CoW across share boundaries. That is, moving a file that way will result in the data blocks being shared between the new share, the new share's snapshots and the old share's snapshots.

I also want the feature (along with some better tools to manage snapshots generally). But there are cases where such indicators will be confusing - for instance when CoW is extended across shares, the sum of the space used in each share won't add up to the total space used in the volume.
Message 7 of 17
Hephaestus1
Aspirant

Re: How to cCheck Size of a share/folder?

Yes, of course, I forgot that this is btrfs... a bit embarassing, really. Thanks for clarifying!
Message 8 of 17
Hephaestus1
Aspirant

Re: How to cCheck Size of a share/folder?

Something still does not add up (pun intended). If the explanation given reflects the mechanism correctly, it should also be impossible (or: not that easy) to show size of a single file. Yet under "browse" sizes of all single files are listed. Regardless of btrfs mechanism I fail to see why one can have, say, 20 files in a folder, each one showing, say 1GB size... yet supposedly there is no easy way to show the folder size being in total 20GB. Just calculate from the bottom up, add, rather straightforward I would say.

Yes, I am aware that interpratation of what the folder really is and how the data blocks are distributed is not easy, but for the purpose of showing how much space on the disk is consumed by a folder this is irrelevant. It becomes a bit mystical if we copy 100GB of data to NAS, to physicall disks, and from now on we are unable to say how much of this physical disk the data (and snapshots, if enabled) consume.
Message 9 of 17
StephenB
Guru

Re: How to cCheck Size of a share/folder?

Each file size includes shared and unshared data blocks. To get the actual disk usage for the share you can't double-count (or triple count) the shared blocks.

Avoiding the multiple-counting for the shared blocks is the problem.
Message 10 of 17
Hephaestus1
Aspirant

Re: How to cCheck Size of a share/folder?

Hypothetically, if a file system consisted of one file only, the file being 1GB, this file consumes 1GB of physical disk space.
If a file system consists of more files (usually the case), the same file does not consume 1GB of physical disk space (shared blocks).

Thus "size of a single file" really means: the size when the file is copied outside of ReadyNAS OS environment. Adding all files sizes within a folder, and showing the result as folder/share size would simply follow already adopted logic: this is the size of the folder when it is copied outside of ReadyNAS OS environment. Showing size of files and not showing the size of folders is logically inconsistent.
Message 11 of 17
StephenB
Guru

Re: How to cCheck Size of a share/folder?

Hephaestus wrote:
Hypothetically, if a file system consisted of one file only, the file being 1GB, this file consumes 1GB of physical disk space.
If a file system consists of more files (usually the case), the same file does not consume 1GB of physical disk space (shared blocks).

Thus "size of a single file" really means: the size when the file is copied outside of ReadyNAS OS environment. Adding all files sizes within a folder, and showing the result as folder/share size would simply follow already adopted logic: this is the size of the folder when it is copied outside of ReadyNAS OS environment. Showing size of files and not showing the size of folders is logically inconsistent.
Thought experiment (a): Let's say you have a share with a single 1 GB MP4 file in it. You take 1 snapshot.

The folder+snapshot will be reported as 2 GB total space by btrfs, but the actual disk space used is only 1 GB.

Now let's change the thought experiment.

Thought experiment (b): Now you add a tag to that MP4 file which rewrites all the data in the file (shifting it a little bit). BTRFS will again report the folder+snapshot as taking 2 GB. And now it will actually take 2 GB of space.

So btrfs (without the quota option enabled) can't tell you how much actual disk space is used by the folder and its associated snapshots.


Now there is some use for simply knowing the total file space in the main share - ignoring the snapshots and CoW and simply summing up the sizes of the files as you say. That number is readily available in ssh (the normal du command will give it to you). And it could be easily added to the GUI.

But I am interested in knowing the actual disk space used by the folder+snapshots too - because I can use that to tell me where I need to delete snapshots as the disk fills.
Message 12 of 17
Hephaestus1
Aspirant

Re: How to cCheck Size of a share/folder?

Yes, agree. I guess my angle was: data on NAS is often moved out to different environments; to copy folders to external computer, to backup selected folders from NAS to external drive, etc. I have extensive knowledge of other file systems architecture, but only very basic knowledge of BTRFS. With my limited BTRFS understanding it appears to me that changing what is understood here by "folder size" is necessary. My initial impression is that some conceptual problems could be solved by saying: "[in BTRFS] we can only say that a folder size is 10GB when it is copied outside of BTRFS environment. Within the BTRFS environment concept of "folder size" is different, and saying that it is 10GB is meaningless". Perhaps even changing naming convention within BTRFS could also help, to something like: "Ext Size" for "exported" or "external" size. With that paradigm change in place knowing "Ext Size" would be very helpful for users. I need to think about it more in my spare time.
Message 13 of 17
AndreasKa
Tutor

Re: How to cCheck Size of a share/folder?

Now there is some use for simply knowing the total file space in the main share - ignoring the snapshots and CoW and simply summing up the sizes of the files as you say


I think that should be added to start with; just about every second post in the forum talks about backing up your data but it would be nice to know how much space is required on the external storage to actually do that backup, and that number would not include snapshots/CoW.

So just add that with a note saying "file space (excluding snapshots & CoW data)".
Message 14 of 17
Hephaestus1
Aspirant

Re: How to cCheck Size of a share/folder?

For solution see: viewtopic.php?f=7&t=81129
Message 15 of 17
bizmate
Tutor

Re: How to cCheck Size of a share/folder?

it looks like this link is dead? is there something that can be enabled to see the folder sizes, if copied to an outside disk that is?

Message 16 of 17
StephenB
Guru

Re: How to cCheck Size of a share/folder?


@bizmate wrote:

it looks like this link is dead? is there something that can be enabled to see the folder sizes,


You can see the,on-disk space by enabling quota on the volume settings page, and then looking at the shares page in the admin web ui.

 

That space includes the space consumed by snapshots.

Message 17 of 17
Top Contributors
Discussion stats
  • 16 replies
  • 7816 views
  • 1 kudo
  • 5 in conversation
Announcements