Hardlinks in port images

Rainer Müller raimue at macports.org
Thu Dec 13 09:26:18 PST 2012


Hello,

On 2012-12-13 17:10, Enrico Placci wrote:
> I was looking for the images of my installed ports when I stumbled on
> https://trac.macports.org/ticket/13143
> Is there a way to revert to the original behaviour? How is the new
> behaviour different from direct + archived packages?
> It seems to me the best solution would have just been to change the
> default settings (to direct + archived , so to not conflict with that
> broken backup system by default) and leave the choice to the users.
> But maybe it is just me not seeing the full picture here.
> Can somebody please help/ give me some insight?

The new behavior is similar to the old images, with the following changes:

 - an image is not a directory, but a tarball
 - activating an image is done by extracting, not hardlinks

This does not only avoid the problem with Time Machine, but also reduces
the chance that someone would alter the image on disk by directly
editing the hardlinked file. This can be fixed by a deactivate/activate
cycle now.

> I'm just trying to save some space on a very tight 128GB disk, I'll
> move to direct if I must but I really liked the old behaviour (I find
> very useful to have different versions of some of the software I need)
> [...]

There is only a single install mode in base in base since this change
was applied. The old direct mode is no longer available.

Of course you have a valid point there: for the comfort of
activating/deactivating ports with images, you might think MacPorts
really takes up twice the size it actually requires. But keep in mind
that these files are compressed, which greatly reduces their size.

I did a quick check on my system and although I have many ports
installed, the disk usage of the directory with the archives does not
equal the disk usage of files installed by ports.

$ port echo installed |wc -l
     642
$ du -sh /opt/local/var/macports/software
2.6G	/opt/local/var/macports/software
$ port -q contents --size --units B installed |awk 'BEGIN {total = 0}
{total += $1} END {printf "%.1fG\n", total/1024/1024/1024}'
9.1G

I guess you can already save a lot of disk space by removing no longer
required distfiles which were downloaded when installing from source,
check /opt/local/var/macports/distfiles. And of course, uninstall no
longer needed versions of ports with 'sudo port uninstall inactive'.

Rainer


More information about the macports-users mailing list