LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   /usr/local partition (https://www.linuxquestions.org/questions/linux-newbie-8/usr-local-partition-490190/)

hank43 10-06-2006 10:10 PM

/usr/local partition
 
i've noticed most of the programs i install go under /usr/local. i've been paritioning my hd to have a partition for /usr.

seeing how most of my apps i build (like apache) go under /usr/local, should i adjust the way i do partitions in the future and create the partition for /usr/local instead of /usr. Would that make OS upgrades easier and give me many other good things?

weibullguy 10-06-2006 10:19 PM

Do it like this
Code:

./configure --prefix=/usr
and then they'll go to /usr rather than /usr/local.

You also might want to take a peek at this if you haven't before.

cs-cam 10-07-2006 03:07 AM

What distrobution are you using? Building from source is generally a good learning experience but if your distro has a capable package manager then you're much better off using it.

jlliagre 10-07-2006 04:01 AM

/usr/local is an unfortunate FHS design mistake as it clashes with Unix standards.
Under Unix, /usr is designed to hold files belonging to the O/S and are shareable between machines, FHS advertise that too, but /usr/local is neither.

I would suggest to use /opt/local instead (./configure --prefix=/opt/local), or have a different filesystem mounted to /usr/local if you still want the default installation PATH most Open Source freewares use.

haertig 10-07-2006 01:33 PM

Here's what I do. /opt is a seperate mountpoint, /usr/local symlinks to /opt.
Code:

$ pwd
/usr
$ ls -l | grep local
lrwxrwxrwx  1 root root    4 2005-12-30 10:09 local -> /opt
$


rnturn 01-03-2007 09:12 PM

Quote:

Originally Posted by haertig
Here's what I do. /opt is a seperate mountpoint, /usr/local symlinks to /opt.

I've been used to doing that -- using /opt, that is -- ever since, oh, the early '90s. Of course, just for good measure, I had /usr/local/ a separate filesystem as well. Both would be unmounted during upgrades for safekeeping. Then SUSE started stashing the Gnome and KDE directory trees under /opt. This seems like a violation of the FHS to me since it's nearly impossible to build a Linux system any more without either Gnome or KDE being required. So much for /opt being reserved for "optional" software. (And don't even get me started on their newly adopted practice of moving all the X11 binaries under /usr/bin. :/ )

Seeing how the main Linux distributions seem happy to thumb their noses at the FHS, anyone got a good suggestion for an alternative to using /opt, /var/opt, and /etc/opt for added software? (/usr/local/opt, /usr/local/var, and /usr/local/etc? Yuk!)

As a side question: What distribution does the best job of adhering to the FHS?

TIA...

--
rt

Electro 01-03-2007 09:49 PM

IMHO, neither are wrong and correct. You are the user where do you think they should go. After you setup your standard way and document it. However, keep in mind where .pc files are located when compiling libraries.

You can try Gentoo and forget this problem ever occurring. Every program is compiled. Gentoo 2006.1 installation comes with gcc version 4.1 that might break some programs. Though I have not run into a snag when doing a test installation in VMware.

rnturn 01-03-2007 10:30 PM

Quote:

Originally Posted by Electro
IMHO, neither are wrong and correct. You are the user where do you think they should go. After you setup your standard way and document it.

Coward (kidding, kidding :-) )

My current standard is/was to keep the source trees under /usr/local/src and when running "configure" supply "/opt" as the target. SUSE's rather ruined that in that I can no longer use /opt in accordance with the FHS the way I used to.

Quote:

You can try Gentoo and forget this problem ever occurring. Every program is compiled. Gentoo 2006.1 installation comes with gcc version 4.1 that might break some programs. Though I have not run into a snag when doing a test installation in VMware.
Gentoo? (cringe) Yah, that'd work though I may as well go back to a generic-as-possible Slackware load (be just a tad easier, I suspect) and build apps on top of that.

I suspect I'll have to start using using something like /opt/app, /var/opt/app, and /etc/opt/app as mount points. Hopefully that'll keep my binaries out of the vendor's way. For a while.

Later...

--
rt

PatrickNew 01-04-2007 01:24 AM

Perhaps I misunderstood, but I think he just meant to ask if we thought it was a good idea to give /usr/local a separate hard drive partition, making /usr/local another mount point. I think that how you partition your hard drive is up to you. You look at the amount of space taken by different directories and do what's right for you. If you think you could benefit from that, and it's worth the trouble, then go ahead.

pixellany 01-04-2007 07:39 AM

All OP asked was how to do this....
Quote:

create the partition for /usr/local instead of /usr
You can mount (connect) a partition to a mount point anywhere on the tree. Just change the fstab entry for partition XYZ from /usr to /usr/local and reboot.

CAUTION: Whenever you mount to an existing file system, you will hide files already stored under the mount point. In this case, something a bit different will happen. If you take the partition holding all of /usr and then mount it to /usr/local, you won't hide anything, but everything that was in /usr will now be in /usr/local and the sytem will get lost trying to find things. So--after changing the mounting, you will need to move all the directories EXCEPT the new /usr/local


All times are GMT -5. The time now is 09:28 PM.