Important: You are required to change your passwords used for Gentoo services and set an email address for your Wiki account if you haven't done so. See the full announcement and Wiki email policy change for more information.

Portage TMPDIR on tmpfs

From Gentoo Wiki
Jump to: navigation, search

During emerge, you can build packages in tmpfs. Instead of having large build files in hdd. This speeds up emerge times and reduces hdd/ssd wearing.

fstab

You can mount Portage TMPDIR to tmpfs with following config:

File/etc/fstab

tmpfs		/var/tmp/portage	tmpfs	uid=portage,gid=portage,mode=0775,size=2048M,noatime	0 0

Then mount Portage TMPDIR:

root # mount /var/tmp/portage

Considering tmpfs size

Tmpfs should be big enough. When it gets full, emerge fails at that point. Most packages dont need much space but there are few very large packages. For example: app-office/openoffice: 10G or so. www-client/chromium: More than 2GB.

Per package choise for TMPFS / HDD

You can configure emerge to build large packages outside of the tmpfs drive.

Create the file to tell portage where to place the temporary files directory.

File/etc/portage/env/notmpfs.conf

PORTAGE_TMPDIR="/var/tmp/notmpfs"

Create the temporary files directory.

root # mkdir /var/tmp/notmpfs

Create the file in which you will list all the packages that need some special environment variable settings.

File/etc/portage/package.env

app-office/libreoffice notmpfs.conf
mail-client/mozilla-thunderbird notmpfs.conf
www-client/chromium notmpfs.conf