Minimising MacPorts Internal Disk Usage

Ryan Schmidt ryandesign at macports.org
Wed Aug 14 21:51:58 PDT 2013


On Aug 14, 2013, at 21:21, Bob M wrote:

> Hi all; I have an MB air with internal (smallish) SSD. I need some of
> the programs provided by MacPorts at all times, but I'm happy to do
> all builds while connected to a large-ish external HD. I just hit a
> crisis when the /opt directories hit 27GB. So what I want to do is to
> put as much as possible of the build environment onto the HD, and
> substitute symbolic links on the SSD. I haven't tried to use it yet -
> I'm assuming this is OK so long as nothing hard-links into these
> directories.
> 
> The current status for the large directories in /opt is:
> /opt/local/var/macports
>    build                                    moved to HD

Should be fine. This is only used while building ports, so you won't be able to build ports while this drive is disconnected. Some ports need a *lot* of disk space (like the clangs, which need something like 10GB).

>    distfiles                                    moved to HD

Should be fine. This is used to store source code that's downloaded to be built, so same as above. You can also delete the contents entirely, if you don't mind MacPorts re-fetching files later when needed. MacPorts does not clean up this directory automatically so it will normally just grow bigger. I have a "housekeeping" in my user directory in the repository which you could use to remove older files. I intend to improve the script further eventually.

>    software                                    not sure if this can be moved

When a pre-built package is downloaded from our packages server, or built locally on your machine, it is stored here, and then the port is activated from that. If you move this to another drive that's later disconnected, you'll be able to deactivate a port, but not reactivate it until that drive is reconnected.

I should note that MacPorts expects these directories to exist at all times. No idea what kind of weird error messages you might run into if you perform operations that need these directories and they're symlinks to nonexistent places.

> /opt
>    lib                                        I assume this can't be moved
>    libexec                                    I assume this can't be moved
>    share                                    I assume this can't be moved

Right, anything else in /opt/local (other than /opt/local/var/macports) is fair game for ports to install files that they probably need to survive, so you shouldn't move them if you want your ports to continue working.




More information about the macports-users mailing list