Gentoo: Emerging with RAMFS

Hi

bash_vi asked me to write a short resume about how to emerge programs by using the ramfs for speedup.
Here’s how to do so:

mount -t ramfs -o size=2g ramfs /var/tmp/portage/

  • The “-t ramfs” is obviously self explainatory.
  • The “-o size” tells the ramfs driver how much space of the RAM should be reserved for this specific mount point.
  • “/var/tmp/portage/” is the place where portage usually unpacks the source boundles and begins to compile them.

You can also put it into your /etc/fstab in order to keep it for each reboot with
echo -e "ramfs\t/var/tmp/portage/\tramfs\tsize=2g\t0\t0" >> /etc/fstab

Now you can compile your stuff within RAMFS

Links:

  • http://de.gentoo-wiki.com/wiki/Emerge_beschleunigen
  • http://www.thegeekstuff.com/2008/11/overview-of-ramfs-and-tmpfs-on-linux/

5 thoughts on “Gentoo: Emerging with RAMFS”

  1. @Claude:
    Why would you want to keep the temporary compilation data anyway?
    @Leviathan:
    Solving problems you wouldn’t have without gentoo. :/

  2. “Solving problems you wouldn’t have without gentoo. :/”

    I was just bitched at by some Debian guys because I tried to modify and compile a package a way they didn’t like…

    Also sometimes recompiling the whole system makes perfectly sense, e.g when a binary distro is using a specific glibc which already causes /sbin/init to segfault

  3. “But after reboot, everything’s gone…”

    Which is absolutely ok, because you only wanna compile and install the binaries.
    The working directory can be thrown away anyway 🙂

  4. /var/tmp/portage/ – DAMN! I didn’t mind the “/tmp/” :/

    I was thinking of the whole portage tree… Allright, now it makes perfectly sense of course 🙂

Leave a Reply

Your email address will not be published. Required fields are marked *