MacOS – Why are Finder shortcuts to Ext HDD removed whenever it’s not connected? Workarounds

findermacossymlink

I have a lot of files on an external drive to my new MBP and there's too many of them for the internal 500GB SSD (and no second drive bay to make a fusion drive or have a second drive in latest MBP which is completely crap BTW Apple).

So I need to have my usual Finder shortcuts to directories deep within the data tree. Problem is if my ext drive is ever switched off or disconnected why my MBP is on the shortcuts get removed by Finder and don't come back when drive is reconnected. My usual method of making these shortcuts is just to drag a directory from the Finder file list into the Finder window sidebar. I'm not sure what this actually prompts behind the curtain of OS X as it's opaque (to me at least) as to whether aliases are stored somewhere or symlinks or so other class of object to track the location.

I'm wondering if I can create shortcuts to symlink files on my internal SSD that link to directories on my ext HDD as a work around to this very frustrating obstacle.

Best Answer

You don't say how you created the "shortcuts". If you used Finder to make Alias OS X creates a complex (and very large) file. These are probably OK, if you want that kind of thing, but OS X has functionality to locate files if they move, and presumably doesn't show them if not present. (I can't verify this as I don't use Alias, except for software testing, and never to external drives.)

I suggest you create symlinks, which are much smaller,and hang around, even if the target disappears. Unfortunately the only way to create symlinks is with a command, although I have created a Service to run this in Finder.

The following is an script, which I run as an Automator workflow.

for f in "$@"
do
 fileSuffix="link"
 fileExists=`ls -d "$f $fileSuffix"`
 fileNumber=0

 until [ $fileExists=="" ]; do
  let fileNumber+=1
  fileSuffix="link $fileNumber"
  fileExists=`ls -d "$f $fileSuffix"`
 done

 echo "$f $fileSuffix"
 ln -s "$f" "$f $fileSuffix"
done

Automator workflow