Server Fault is a question and answer site for system and network administrators. 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 thought I would install a perfect system by mounting /usr/local to a seperate partition so that I can keep all my 'local' stuffs like upgraded version of Java, nightly builds of SSH and so on in that director which would not be effected by an OS upgarde or distro change. Is this possible? Thanks

share|improve this question

Yes. I don't know what else to say to bring my word count to the minimum. It's definitely possible. I've done it many times.

Though your desire to build a software repository which is unaffected by local OS upgrades might not work as well as you think; it's likely that the stuff you build will have linkage dependencies against standard system libraries, and when these go away or change version number in the upgrade the executables will fail at runtime.

share|improve this answer
+1 just for the fun – mailq Aug 11 '11 at 12:34
  1. Repartition your disk and/or use LVM.
  2. Allocate a partition for /usr/local
  3. Copy your stuff to this partition
  4. Add it to your /etc/fstab
  5. If you upgrade your OS or change distro, don't format that partition.
  6. Profit!*


  1. Buy another hard drive.
  2. Create filesystem in it.
  3. Mount it as /usr/local.
  4. During OS upgrades / distro switches do not format that drive.
  5. Profit!*

*) After major upgrades or distro switches profit might change to loss as your old programs stops working due library incompabilities and other fun stuff.

share|improve this answer
Menu (1) also has a problem in step 4 as once you mount the new /usr/local/ all the old data will still be there, invisible under the mount point, but still taking up space. If you can do without /usr/local/ for a few seconds, step 4a should probably be mv /usr/local /usr/local- ; mkdir /usr/local ; mount /usr/local and then you can clean the old stuff out of /usr/local- once you're sure the migration went well. Ditto at 3a in menu 2. But +1 for also warning about library-related breakage! – MadHatter Aug 11 '11 at 14:52

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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