Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I'm a packager, so I often need to use cowbuilder or pbuilder to build packages either for my own use or when I'm sponsoring somebody elses' work.

On my laptop, my disk isn't the fastest in the world, so I'm considering using tmpfs for the build area, /var/cache/pbuilder/build, to speed up the build process. Files in there can get fairly large, for example right now I've 2.2GB of data in that folder. In addition, cowbuilder works by making shallow COW copies (using hardlinks I think).

Would it be feasible to mount the build directory under tmpfs?

I'm on Ubuntu 10.04 Lucid Lynx, but will be moving shortly to the prerelease of Maverick Meerkat. My machine has 4GB of RAM.

share|improve this question
    
How much RAM do you have in your machine? –  Marco Ceppi Aug 21 '10 at 15:11
    
I have 4GB. (well, free -m reports 3961M total, but I assume some's just reserved for the BIOS or video) –  lfaraone Aug 21 '10 at 15:34
    
I was thinking about this too - pbuilder is quite slow on my machine... unfortunately, I only have 2GB of RAM. Would that work for small projects? –  Nathan Osman Aug 21 '10 at 18:28
    
@George Over the course of an Ubuntu development cycle, I must do ~200 build in pbuilder between my Ubuntu, Debian, PPA, and personal stuff. I only have 2GB of RAM. Maybe I'm just extremely patient... –  andrewsomething Oct 11 '10 at 2:40
add comment

closed as too localized by Luis Alvarado Mar 14 '13 at 17:05

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.

2 Answers

I've used a tmpfs for pbuilder before, and done some benchmarks against ext4. With 4GB of ram it ended up being between 30%-100% faster on the tmpfs for most packages, up to packages as big as Xorg.

You'll want to bind-mount /var/cache/apt/archives in order to get your package cache available in the chroot.

You can get a more efficient build with sbuild and an aufs union mount, where the base chroot won't be copied to ram.

share|improve this answer
    
Thank you for the hint about bind mount of the apt cache. Just setting APTCACHE does not help, if building on tmpfs. By bind mounting it, we save the complete deb space. Thank you. –  user110838 Nov 26 '12 at 15:13
add comment

Keep in mind that hardlinks can't work across filesystems. I think using tmpfs would be bad.

share|improve this answer
add comment

Not the answer you're looking for? Browse other questions tagged or ask your own question.