Repeating /Systems/Volumes/Data/Systems/Volumes/Data
I'm using ncdu
to see where my storage space is going, and noticed a seemingly endless file path it seems to be traversing:
/System/Volumes/Data/System/Volumes/Data/System/Volumes/Data/System/Volumes/Data/System/Volumes...
This file path doesn't actually exist if I try to cd
in there (thank goodness):
$ ls -lshart /System/Volumes/Data/System/
total 0
0 drwxr-xr-x@ 3 root wheel 96B Aug 24 2019 .
0 drwxr-xr-x 9 root wheel 288B Sep 29 2019 Library
0 drwxr-xr-x 26 root wheel 832B Apr 20 02:15 ..
But it does seem that I'm inexplicably using more data than I think I am; ncdu
says I'm using about 40GB under the user space, and I try to keep the machine fairly uncluttered. XCode and Docker are the largest applications of the few I have, by far.
For example, ncdu
is telling me I'm using 487GB (and counting), while the machine has only an 120GB SSD:
Total items: 17767208 size: 484.7 GiB
On Catalina 1.15.4
.
Related: What's /System/Volumes/Data?
I think you want ncdu <path> --exclude-firmlinks
(available in ncdu 1.15.1 on OS X - possibly before, but this is the version I'm using and it has --exclude-firmlinks
available). Like others said, it does have to do with firmlinks, and this will solve the issue.
This is a problem with firmlinks which are used by macOS and not supported by ncdu.
You can use ncdu --exclude /System/Volumes/Data -x /
on macOS Catalina to avoid the problem and scan the whole file system.
This is a common problem with programs that don't handle links well. The tool is stuck in a maze with left hand turns leading it in to a circle - it will never get out until its search algorithm is changed to make better decisions on macOS Catalina and newer.
- https://eclecticlight.co/2020/09/16/boot-volume-layout/
The new variable is firmlinks which merge two different filesystems. You may have to start this tool in a way that it doesn't measure any directory with a firm link in it until it can be updated to work.
I love ncdu
but you may need other tools that work better with the new layouts.
- https://daisydiskapp.com
Select a tool that knows about hard, sym and firm links and you should be set.