0

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

2 Answers 2

6

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.

0
1
  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!*

Or

  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.

1
  • 1
    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, 2011 at 14:52

You must log in to answer this question.

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