Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I use a Gentoo Linux, and I'm currently moving my /usr/portage (portage's database, containing thousands of small ebuild files), /var/tmp/portage (portage's compiling directory), and /var/tmp/ccache (compiler cache directory) to reiserfs. These directories are performance sensitive and thousands of small files are accessed and written when portage is calculating package dependencies and compiling packages.

What is the fastest way of redirecting the directories into the new filesystem? Is there a huge performance loss from using a symlink since the system parse a symlink as a text? Is mount bind going to be better?

share|improve this question
I cannot help you with this, but I'm wondering, is reiserfs still relevant? – fideli Oct 7 '10 at 4:14
Good point fideli. I think XFS or EXT4 would be a better option. – Matt H Oct 20 '10 at 10:20
I have heard that using tar to back up then untar to restore is quicker and safer than using cp -R. Can anyone verify that? – Matt H Oct 20 '10 at 10:22
up vote 0 down vote accepted

Mount --bind should be faster then symbolic link.

If you mount -B /mnt/portage /usr/portage reading /usr/portage will give you i-node of /mnt/portage and it should work as fast as normal directory.

Resolving symbolic link speed will depend on number of components in the linked path, so for /usr/portage linked to /mnt/portage it will be three additional i-node reads and two directory searches.

I doubt you will notice any difference between these methods, unless you are really using these file systems a lot.

share|improve this answer
Doesn't mount --bind just make the mount point appear in two places but the files will still be written on the old filesystem, not the new? – Matt H Oct 20 '10 at 10:24
Files will be written to the new filesystem unless some process opened them from the old one before mount. In that case process needs to be restarted. – Paweł Nadolski Oct 20 '10 at 11:39

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .