Transferring ports

Sean C. Farley scf at
Thu Mar 13 14:51:27 UTC 2008

On Thu, 13 Mar 2008, Ivan Voras wrote:


> The details: imagine there are two or more full FreeBSD installation
> trees in the file system (e.g. complete jails). The utility would
> transfer (installed) packages from one tree to the other. The easy,
> brute-force way would be to generate package files (tbz) from the
> installed tree and then install them to the other tree, but I can't do
> that because of performance and disk space reasons.

I do not know of any such scripts but a possible solution is to use
nullfs.  I personally install all needed ports into the base system and
use nullfs read-only to pull everything into the jails.  Almost
everything, files from /usr/local/etc are manually copied as needed into
each jail.  It lowers the disk usage and reduces risk due to most files
(even system) being read-only.

You just need individual /etc/fstab.<jailname> files like this:

/bin    /usr/local/jails/<jaildir>/bin        nullfs  ro      0       0

And similar lines for these (at least all that you require):
/boot /lib /libexec /sbin /usr/bin /usr/games /usr/include /usr/lib
/usr/libdata /usr/libexec /usr/local/bin /usr/local/cyrus
/usr/local/etc/periodic /usr/local/etc/php /usr/local/etc/rc.d
/usr/local/info /usr/local/lib /usr/local/libdata /usr/local/libexec
/usr/local/man /usr/local/sbin /usr/local/share /usr/sbin /usr/share

A basic jail runs about 9MB (mainly /etc and /usr/local/etc).  Does this

scf at

More information about the freebsd-hackers mailing list