13

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.

enter image description here

Related: What's /System/Volumes/Data?

3
  • Does this answer your question? What's /System/Volumes/Data?
    – SPRBRN
    Aug 15, 2020 at 10:55
  • ncdu is probably incorrectly using or interpreting a system folder that should be ignored. The thing is that you already linked to the question explaining how it works.
    – SPRBRN
    Aug 15, 2020 at 10:57
  • Just as a follow up on this (from a long time later) -- if I remember right, some part of the issue I saw turned out to be related to Docker data (images, etc.). This was related, I think, to the unexplained size at least, and certainly were taking up a lot of space. Maybe a small clue that can help someone down the road.
    – irbanana
    Feb 4, 2021 at 2:19

3 Answers 3

11

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.

8

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.

1

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.

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.

Select a tool that knows about hard, sym and firm links and you should be set.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .