optimize Gentoo with tmpfs

Today has been a very rewarding day for finding interesting articles. Apart from the articles that I will mentioned in my next article here is one for my readers who runs the Gentoo operating system.

http://apcmag.com/6636/Gentoo tip for the love of tmpfs

Basically the idea is to mount a virtual file-system over the directory that stores temporary files used during compilation of new software (/var/tmp/portage). As most you you might know, Gentoo includes a system that automatically compile and install software for you. The great part is that it is very easy to use, the down part however is that it sometimes takes hours to install a certain software. The Hard Drive being the slowest part in the equation has just to be removed.

To try it out simply add this line to your /etc/fstab file and mount it as root or reboot.

none /var/tmp/portage tmpfs size=212M,nr_inodes=1M 0 0

You might also want to kill the content for the directory before, as it most probably contains lost of useless data which would then be hidden behind the mount.

rm -fr /var/tmp/portage ; mkdir /var/tmp/portage

Now the guy in the article use a 1412M sized tmpfs virtual partition on a 2G of RAM system. I really wonder how this would work on a 512MB RAM system. It might just swap all the time removing the whole idea. So I'm not sure this tricks helps people who really needs help. (the people with regular hardware)

What I really would like to understand is how the tmpfs kernel module know when to delete or not a file from the memory. I'd be afraid that it kills some .o out of the memory before the full compilation comes to an end. Or that it keeps all these temporary files in memory for hours after the compilation is done. I'd like to understand the magic.

For more Linux related article, checkout their Kernel Knowledge page

Update: Then later I found in the comment it is useless to add an extra tmpfs as Gentoo always have one enabled.

And I Quote .... "You can always do this by using the existing tmpfs, /dev/shm. /dev/shm will allocate up to 1/2 of your system RAM for tmpfs and it should already exist. To use it change/add the following three lines to your gentoo /etc/make.conf file:"


Good luck in your trials. And please post comments on your experimentations.

Tags , , , , , , ,

Posted in , , | Posted on 23 Aug 2007 02:38by somekool |


  1. Gary Hunt Says

    It works fine on 512MB memory.

    I allocated 2GB for the tmpfs drive. If it runs out of static memory, it will use swap space.

    In regards to your concern about a file being erased; Files are only erased if you actually erase them, or a program like portage erases them. Portage clears out /var/tmp/portage when it finishes compiling and installing a package. It is literally a super fast hard drive. As long as you have power, it acts just like a hard drive.

    Most programs compile in 512Mb memory, execptions being gcc, kde, xorg-server, etc.

    Actually, I even allocate a tmpfs for /tmp itself and for logs.


  2. someone Says

    tmpfs only uses as much ram, as there is really used. so you can allocate 2 GB tmpfs with having 2GB ram and no swapping will occure, unless you fill up the tmpfs.

    2) deleting from tmpfs works the same as deleting from hdd/ssd. the kernel doesnt manage the deletetion, it dows anything what it does with any other FS. if the script doesnt clean up by itself, files will stay forever, Or till the next reboot.

  3. darmowe krzyzowki Says

    Great read! You might want to follow up to this topic???

  4. darmowe programy Says

    I am not sure where you are getting your information, but great topic

  5. cool articles to read Says

    Its like you read my mind! You seem to know a lot about this, like you wrote the book in it or something. I think that you could do with a few pics to drive the message home a bit, but instead of that, this is magnificent blog. A fantastic read. I'll definitely be back.

  6. Kerry Says

    There is definately a great deal to know about this topic. I like all the points you've made.

  7. lifestyles skyn condoms Says

    Definitely believe that which you said. Your favorite justification seemed to be on the web the simplest thing to be aware of. I say to you, I certainly get annoyed while people consider worries that they just do not know about.

    You managed to hit the nail upon the top as well as defined out the whole thing without having side-effects , people could take a signal. Will likely be back to get more. Thanks

  8. tankinis Says

    Hey! This is kind of off topic but I need some advice from an established blog. Is it difficult to set up your own blog?

    I'm not very techincal but I can figure things out pretty fast. I'm thinking about creating my own but I'm not sure where to begin. Do you have any ideas or suggestions? Appreciate it

  9. Nichole Says

    Greetings! This is my first visit to your blog! We are a group of volunteers and starting a new project in a community in the same niche. Your blog provided us beneficial information to work on. You have done a marvellous job!

  10. social sites Says

    My brother recommended I might like this blog. He was once totally right. This submit truly made my day. You cann't believe simply how a lot time I had spent for this information! Thank you!

  11. acheter stickers islam Says

    I used to be suggested this web site by means of my cousin. I'm no longer sure whether this put up is written by him as nobody else recognise such distinctive about my difficulty. You are wonderful! Thanks!

  12. logitech webcam Says

    Hello There. I found your blog using msn. This is a very well written article. I will be sure to bookmark it and return to read more of your useful info. Thanks for the post. I will certainly comeback.

  13. Deklaracje PITY 2013 Says

    Thank you for the auspicious writeup. It in reality was a leisure account it. Glance advanced to more delivered agreeable from you! However, how can we be in contact?

  14. Tonia Says

    Thanks on your marvelous posting! I definitely enjoyed reading it, you are a great author. I will make certain to bookmark your blog and definitely will come back at some point. I want to encourage that you continue your great work, have a nice day!

  15. sites.google.com Says

    Appreciating the dedication you put into your website and detailed information you present. It's great to come across a blog every once in a while that isn't the same old rehashed information. Great read! I've bookmarked your site and I'm including your RSS feeds to my Google account.

  16. sites.google.com Says

    Appreciating the dedication you put into your website and detailed information you present. It's great to come across a blog every once in a while that isn't the same old rehashed information.

    Great read! I've bookmarked your site and I'm including your RSS feeds to my Google account.

  17. Pity 2012 Says

    Hi there, I discovered your site via Google at the same time as searching for a related topic, your site got here up, it seems to be good. I've bookmarked it in my google bookmarks.

  18. Edgardo Says

    I drop a comment each time I like a post on a website or I have something to valuable to contribute to the conversation. It is triggered by the passion communicated in the post I looked at. And after this post optimize Gentoo with tmpfs.

    I was excited enough to post a commenta response : -) I actually do have a couple of questions for you if you do not mind. Is it only me or do a few of these remarks look as if they are left by brain dead people? :-P And, if you are writing at additional sites, I'd like to follow anything new you have to post. Could you list all of your community sites like your linkedin profile, Facebook page or twitter feed?

  19. Cialis Says

    Howdy! Would you mind if I share your blog with my myspace group? There's a lot of folks that I think would really enjoy your content. Please let me know. Cheers

  20. forum Says

    Hello there, You've done an excellent job. I will certainly digg it and personally suggest to my friends. I'm confident they will be benefited from this website.

  21. tattoo removal Says

    I do not know if it's just me or if perhaps everybody else encountering issues with your blog. It seems like some of the text within your content are running off the screen. Can someone else please provide feedback and let me know if this is happening to them too? This might be a issue with my internet browser because I've had this happen before. Kudos

  22. free websites Says

    I do not comment, however I browsed some of the remarks here optimize Gentoo with tmpfs. I actually do have a few questions for you if it's allright. Could it be just me or do some of these responses appear as if they are coming from brain dead visitors? :-P And, if you are posting at other online social sites, I'd like to keep up with everything fresh you have to post. Would you make a list of the complete urls of your social sites like your twitter feed, Facebook page or linkedin profile?

  23. www.minren.cn Says

    Hurrah, that's what I was seeking for, what a material! present here at this weblog, thanks admin of this web page.

  24. engagement rings Says

    Hi there! Do you use Twitter? I'd like to follow you if that would be ok. I'm definitely enjoying your blog and look forward to new updates.

  25. sex tape Says

    ӏ have een surfing online more thɑn three hourѕ todɑy, yet I never found anny interesting article like yours. It's pretty worth enough ffor me. In my view, if all website owners and bloggers made gooԁ conttent ass you did, thе net will be a lot more useful than ever before.


my last twitter posts

Personal Links




my Xbox 360 gamertag

Copyright © Mathieu Jobin's Life and Thoughts