2

While playing around with find in Terminal I came across this odd behavior: There seems to be an infinite loop in the Mac File System like so:

/Volumes/Macintosh HD/Volumes/Macintosh HD/

...and so on.

Apparently it is possible to access Volumes and Macintosh HD over and over again.

How is this possible? Should this not confuse any process digging recursively through the File System?

3
  • You said, "While playing around with find...", please add the exact find command, to your post, you were using to cause this loop. Commented Nov 17, 2016 at 16:20
  • This has nothing to do with the specific command. I'm simply startled by the fact that pwd can produce the following output: /Volumes/Macintosh HD/Volumes/Macintosh HD/Volumes/Macintosh HD/Volumes/Macintosh HD/Volumes/Macintosh HD/Volumes/
    – michaelh
    Commented Nov 17, 2016 at 16:47
  • find just pointed me to this because I tried to search only on my Macintosh HD and then realized that I got output from other volumes as well.
    – michaelh
    Commented Nov 17, 2016 at 16:52

1 Answer 1

1

/Volumes/<startup> is simply a symlink, and there's no rules against where you can link.

$ ls -la /Volumes/Macintosh\ HD
lrwxr-xr-x  1 root  wheel     1B 22 Feb 15:40 /Volumes/Macintosh HD -> /

It's not an actual infinite loop, only a loop of links; once followed, you're put back up the path.

1
  • Thanks! I guess what confused me was the output of pwd. It would make sense if that shortened the path.
    – michaelh
    Commented Mar 14, 2017 at 10:19

You must log in to answer this question.

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