LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices



Reply
 
Search this Thread
Old 10-06-2006, 11:10 PM   #1
hank43
Member
 
Registered: Nov 2003
Distribution: centos 4.4
Posts: 94

Rep: Reputation: 15
Question /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?
 
Old 10-06-2006, 11:19 PM   #2
weibullguy
ReliaFree Maintainer
 
Registered: Aug 2004
Location: Kalamazoo, Michigan
Distribution: Slackware-current, Cross Linux from Scratch, Gentoo
Posts: 2,753
Blog Entries: 1

Rep: Reputation: 238Reputation: 238Reputation: 238
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.
 
Old 10-07-2006, 04:07 AM   #3
cs-cam
Senior Member
 
Registered: May 2004
Location: Australia
Distribution: Gentoo
Posts: 3,544
Blog Entries: 4

Rep: Reputation: 56
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.
 
Old 10-07-2006, 05:01 AM   #4
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris10, Solaris 11, Mint, OL
Posts: 9,523

Rep: Reputation: 365Reputation: 365Reputation: 365Reputation: 365
/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.
 
Old 10-07-2006, 02:33 PM   #5
haertig
Senior Member
 
Registered: Nov 2004
Distribution: Debian, Ubuntu, LinuxMint, Slackware, SysrescueCD
Posts: 2,032

Rep: Reputation: 309Reputation: 309Reputation: 309Reputation: 309
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
$
 
Old 01-03-2007, 10:12 PM   #6
rnturn
Member
 
Registered: Jan 2003
Location: Illinois (Chicago area)
Distribution: Red Hat (8.0), SuSE (10.x, 11.x, 12.2, 13.2), Solaris (8-10), Tru64
Posts: 982

Rep: Reputation: 53
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
 
Old 01-03-2007, 10:49 PM   #7
Electro
Guru
 
Registered: Jan 2002
Posts: 6,042

Rep: Reputation: Disabled
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.
 
Old 01-03-2007, 11:30 PM   #8
rnturn
Member
 
Registered: Jan 2003
Location: Illinois (Chicago area)
Distribution: Red Hat (8.0), SuSE (10.x, 11.x, 12.2, 13.2), Solaris (8-10), Tru64
Posts: 982

Rep: Reputation: 53
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
 
Old 01-04-2007, 02:24 AM   #9
PatrickNew
Senior Member
 
Registered: Jan 2006
Location: Charleston, SC, USA
Distribution: Debian, Gentoo, Ubuntu, RHEL
Posts: 1,148
Blog Entries: 1

Rep: Reputation: 48
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.
 
Old 01-04-2007, 08:39 AM   #10
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 729Reputation: 729Reputation: 729Reputation: 729Reputation: 729Reputation: 729Reputation: 729
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
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
./configure --prefix=/usr [default: /usr/local] why??? stevesk Slackware 14 07-03-2006 07:28 AM
Starting httpd: /usr/sbin/httpd: symbol lookup error: /usr/local/lib/libaprutil-0.so. bijuhpd Linux - Newbie 1 10-30-2005 06:07 PM
/usr vs /usr/local on linuxpackages.net merchtemeagle Slackware 4 10-18-2005 04:09 PM
path in services wrong for clamav updated frm 0.75 to 0.80 usr/bin vs usr/local/bin Emmanuel_uk Linux - Newbie 3 04-22-2005 02:02 AM
Installing software, /usr/lib directory and /usr/local millertime Linux - Software 2 07-10-2004 10:21 AM


All times are GMT -5. The time now is 09:27 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration