Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Is there a secure procedure to move the macports directory strucutre on a non-root partition or disk?

share|improve this question

1 Answer 1

Use a symbolic link...

A symlink is basically like a file or folder shortcut but it's different in that that it acts as though it is the location it's linking to. To the operating system, a symlink and the actual location are no different.

What you'd do is copy the contents of /opt/local to the new location (including hidden files) then, from the /opt/ folder create a symlink.

The format for symlinks is:

ln -s target link_name

So, the link would be something like:

ln -s /new/opt/local/location/ local

Since you want to put it on another disk/partition you have to make sure it mounts on boot. If mac doesn't automatically mount the drive/partition in question on boot you'll have to manually edit fstab.

Here's the wikipedia article on symlinks.

Here's a link describing how to move the '~/' or 'Home' folder in linux using a symlink. It should work relative the same in OSX since they are both POSIX

Here's a link describing how to edit fstab on Mac.

SideNote: I heart symlinks. They make some things sooooo much easier.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.