gdu icon indicating copy to clipboard operation
gdu copied to clipboard

Windows version includes files synced from OneDrive/Sharepoint in space calculations

Open theonetruetom opened this issue 2 years ago • 8 comments

I use this to do disk space analysis on client workstations without disturbing their work (our remote access tool has a PowerShell that runs as SYSTEM, so I can do this without having to remote in physically to each machine), but lately it seems like gdu is including space consumed by files that exist in SharePoint or OneDrive, which throws off my investigation considerably.

Is there any way to make the app ignore files that don't exist locally and are only cloud synced?

theonetruetom avatar Jul 19 '23 14:07 theonetruetom

I have this same exact issue. @dundee Please advise. This is the best utility I've found for remote storage investigations but the SharePoint/OneDrive issue is incredibly problematic.

isv-one avatar Aug 28 '24 14:08 isv-one

I am not sure if I we are able to detect whether the file is local or "virtual" and placed in cloud.

Can you use -i or -I options to ignore the paths?

dundee avatar Aug 29 '24 11:08 dundee

That's problematic because the intent is to see how much local space is being occupied by locally downloaded SharePoint/OneDrive files.

Consider the following scenario (incredibly common with my client environments, and I imagine many others):

  • A workstation contains a 512GB disk.
  • The Windows system and installed applications occupy 75GB of storage on the disk.
  • The user has a OneDrive account logged in and synced, with 40GB of total files in their cloud storage for OneDrive, and 10GB of those downloaded locally.
  • The user also has a company SharePoint library synced locally, being 300GB total, with 50GB of that downloaded locally.

gdu should detect a total of 135GB/512GB storage used (75GB + 10GB + 50GB) on the disk. Currently, this does not work, and gdu will detect as 415GB/512GB (75GB + 40GB + 300GB). Omitting the OneDrive/SharePoint directories defeats the purpose of using a disk scanning utility.

isv-one avatar Sep 06 '24 15:09 isv-one

The more extreme examples of this are where a 2TB SharePoint is synced with the machine with the same 512GB disk, and it becomes very confusing to do space usage analysis.

theonetruetom avatar Sep 08 '24 23:09 theonetruetom

I will try to check if there are some possibilities to detect this.

dundee avatar Sep 11 '24 08:09 dundee

It looks like there are Windows filesystem attributes, specifically "RecallOnAccess" and "Unpinned" that, if set, appears to indicate that files are not stored locally. I don't know how hard it would be to programmatically check for this, but it's a thought.

theonetruetom avatar Oct 16 '24 04:10 theonetruetom

I'd like to second (3rd) this feature request.

EntropicNinja avatar Oct 24 '24 17:10 EntropicNinja

Can you use -i or -I options to ignore the paths?

No, whether it's -i or -I, C:/Users/name/OneDrive or C:\Users\name\OneDrive or C:\\Users\\name\\OneDrive, with "" or ''

ErrorPower2001 avatar Nov 27 '25 05:11 ErrorPower2001