Linked by Thom Holwerda on Sat 23rd Aug 2008 15:37 UTC
Editorial Earlier this week, we ran a story on GoboLinux, and the distribution's effort to replace the Filesystem Hierarchy Standard with a more pleasant, human-readable, and logical design. A lot of people liked the idea of modernising/replacing the FHS, but just as many people were against doing so. Valid arguments were presented both ways, but in this article, I would like to focus on a common sentiment that came forward in that discussion: normal users shouldn't see the FHS, and advanced users are smart enough to figure out how the FHS works.
Permalink for comment 327777
To read all comments associated with this story, please click here.
RE[2]: what is wrong with FHS?
by Doc Pain on Sun 24th Aug 2008 00:52 UTC in reply to "RE: what is wrong with FHS?"
Doc Pain
Member since:

You're bringing up valid questions.

Configuration goes in /etc/. Which files go in /etc/ and which go in their own subdirectory of /etc/? If /etc/ is for settings, why does /etc/init.d/ contain scripts? (Set aside for a moment a debate about the fine line between a config file and a script.) Under what circumstances is configuration stored in /usr/lib/appname/ and/or /opt/appname/etc?

This is really something (along with the lib/ problem) that I find a bit strange in Linux. In BSD, there's a differnce between "the OS" and "installed packages", while Linux does not have this kind of separation. BSD puts system's stuff in /etc/, and local (not to the system belonging) parts in the respective /usr/local/etc/ directories. You can conclude the nature of a file from its name and it place within the file hierarchy.

Libraries go in /lib. Or is it /usr/lib? Which libraries go in which directories? Why does some libraries get stuck in /usr/lib/appname/? Why are some, sometimes, under /opt? Why do I sometimes see a /lib/firmware--is a firmware blob a library? Where does the FHS say firmware goes?

This one continues the aspect mentioned before. Some Linux distributions have /opt/, others don't. In some cases, the purpose of lib/ and share/ subtrees is merged, too.

Does each program get installed into /usr/lib/appame? If so, do you symlink from /usr/bin to the binary or place the binary directly in /usr/bin? If I'm using /opt do I symlink or adjust the system PATH? What's the difference between /opt, /usr and /usr/local? What about games, where do they go?

In general, additional software should go into /usr/local/ where the basic subtrees of the system (etc/, lib/, include/, bin/, share/) are replicated with the respective purpose. Games should obey this rule. But as I mentioned before, it's hard to say which things do not belong to the system because Linux distributions do not differ between OS and installed packages; in fact, the "OS part" is a set of packages chosen by the creator of the distribution. Rule: Everythin within /usr/local/ is extra stuff, everything outside is the system (mountpoints and home directories not mentioned here).

And /opt/... I think it has initally been intended as a directory that contains extra stuff that does not obay the subtree rule, i. e. no etc/, lib/ or bin/ separation, instead a name of the application with its own subtree.

Following the rule:


Not following the rule


What is /mnt for and what directories will you find under it?

/mnt is intended as a temporary mount point for the system administrator (according to man hier).

What is /media for?

/media is intended for (usually auto)mounted media, it contains a subtree for the devices (e. g. /media/cdrom, /media/dvd, /media/stick) or mountpoints are created from a label provided by the media itself or by the class of the drive (man geom).

Where should /floppy and /cdrom really? be located?

Allthough the access to /floppy and /cdrom is much easier than their successors within /media (due to less typing), these mountpoints may already be deprecated.

Is there any structure to /tmp?

No, because programs or users that use /tmp should keep an eye on the stuff they do on their own. This is because /tmp may disappear at system shutdown, or, may be empty after system startup, for example when /tmp leads to a RAM disk or some system setting clears /tmp at startup. It's the system's waste dump. :-)

What is the structure of /usr/local and what determines which programs are installed there?

I mentioned this before, it's complicated in Linux because it's hard to determine what's local and what's not. In BSD, it's obvious.

What's the difference between /usr/doc and /usr/share/doc?

Only the last one should exist, an assumption from priority and precedence considerations.

What directories can I expect to find in /var?

Usually databases and logs that are created and managed by programs, not by the user.

How do I decide whether a file should be created in /var or /tmp?

If it's okay to lose it - /tmp. If it should be kept - /var.

If I have a web site where should the files for it be stored?

In ~/public_html? :-)

If you think you know the answers to some of these questions I have a surprise for you: *every unix does some of them differently and even distributions of Linux can't all agree*.

You see this from my explainations, and some reasons why it is so. Alltough much of the stuff is well intended, there are inconvenient uses of the existing structures, maybe due to sloppyness, or due to general problems of interpretation. There are many differences between the many Linux distributions and among the UNIXes, too.

Reply Parent Score: 5