Linux filesystem trees

Discussion topics, Linux related - not requests for help

Moderators: ChrisThornett, LXF moderators

Linux filesystem trees

Postby guy » Tue Jun 04, 2013 9:38 am

The structure of Linux filesystems remains an ongoing knot of obfuscation that any expert must overcome: not only has its history left it arcane and convoluted but different distros, different install options, different apps, do things in different ways.

For example I would find it really useful to have a semi-graphical "where-to-find-it" map of all the stuff in my vanilla Debian install. Where does Evolution hold my emails and contacts, where should I install oddball apps I have downloaded and why, etc. etc.

Does this kind of resource exist?
Cheers,
Guy
The eternal help vampire
User avatar
guy
LXF regular
 
Posts: 1087
Joined: Thu Apr 07, 2005 12:07 pm
Location: Worcestershire

Postby nelz » Tue Jun 04, 2013 10:17 am

Programs installed from outside of the package manager should be installed /usr/local for systemwide use, or in your home directory, ~/bin for executables, for your own use.

Individual apps are free to choose where to keep their data, permissions permitting.

You could look at http://tuxradar.com/content/take-linux-filesystem-tour
"Insanity: doing the same thing over and over again and expecting different results." (Albert Einstein)
User avatar
nelz
Site admin
 
Posts: 8532
Joined: Mon Apr 04, 2005 11:52 am
Location: Warrington, UK

Postby Spangwiches » Tue Jun 04, 2013 11:44 am

This is a handy overview. Not searchable as you wanted, but a good explanation of why the filesystem is the way it is.

http://en.wikipedia.org/wiki/Filesystem ... _structure

You may also be interested to hear that Arch Linux have recently done away with all the various /bin and /lib directories and merged them all into /usr/bin and /usr/lib which seems like a very sensible move

https://mailman.archlinux.org/pipermail ... 22625.html
User avatar
Spangwiches
 
Posts: 81
Joined: Thu Sep 22, 2011 2:50 am

Postby nelz » Tue Jun 04, 2013 1:04 pm

Spangwiches wrote:You may also be interested to hear that Arch Linux have recently done away with all the various /bin and /lib directories and merged them all into /usr/bin and /usr/lib which seems like a very sensible move


Not if you want /usr mounted read-only or mounted on NFS. There are traditional reason for the separation of / and /usr and while not all of them still apply, some do.
"Insanity: doing the same thing over and over again and expecting different results." (Albert Einstein)
User avatar
nelz
Site admin
 
Posts: 8532
Joined: Mon Apr 04, 2005 11:52 am
Location: Warrington, UK

Postby Spangwiches » Tue Jun 04, 2013 1:41 pm

They cover that in the link.
User avatar
Spangwiches
 
Posts: 81
Joined: Thu Sep 22, 2011 2:50 am

Postby guy » Tue Jun 04, 2013 1:49 pm

Thanks for the pointers.

In addition to those in the Tuxradar graphic, my system also has:
lib32
lib64 (a link to /lib)
lost+found
media
opt
selinux
srv
tmp
var

Many of these are explained in the Wikipedia article, and the others are reasonably obvious.

These more or less answer the "what will I find in here?" question, bar such things as confusion over mailboxes: I have a mailbox file in /var/mail but it is some kind of system mailbox, not my regular one (which is in $HOME/.evolution).

But they do not answer the "where should I put it?" question. For example calibre installed into /opt by default - why? Where should, or could, I have put it? /bin or /usr/bin or /usr/sbin or... ?

And of course they are generic, not exact for any given distro.
Last edited by guy on Tue Jun 04, 2013 1:52 pm, edited 1 time in total.
Cheers,
Guy
The eternal help vampire
User avatar
guy
LXF regular
 
Posts: 1087
Joined: Thu Apr 07, 2005 12:07 pm
Location: Worcestershire

Postby nelz » Tue Jun 04, 2013 1:51 pm

I see no mention of either NFS or read-only.
"Insanity: doing the same thing over and over again and expecting different results." (Albert Einstein)
User avatar
nelz
Site admin
 
Posts: 8532
Joined: Mon Apr 04, 2005 11:52 am
Location: Warrington, UK

Postby nelz » Tue Jun 04, 2013 1:54 pm

/opt tends to be used as a dumping ground for binary programs, things like adobe-flash. Calibre should be installed into /usr. The only programs installing into /{bin,sbin,lib} should be those required before the kernel mounts any filesystems.

Of course, the list of such "requirements" is ever growing and the cause of much heated discussion, particularly in view of the decision by the udev/systemd developers to roll everything into /usr and require an initramfs for any system that needs a separate /usr.
"Insanity: doing the same thing over and over again and expecting different results." (Albert Einstein)
User avatar
nelz
Site admin
 
Posts: 8532
Joined: Mon Apr 04, 2005 11:52 am
Location: Warrington, UK

Postby guy » Tue Jun 04, 2013 1:56 pm

nelz wrote:I see no mention of either NFS or read-only.

Nope. Should they be there, and if so why?

Just showed hidden files and found .ure to add to the list. Never even heard of it. It contains some kind off java config file and nothing else.
Cheers,
Guy
The eternal help vampire
User avatar
guy
LXF regular
 
Posts: 1087
Joined: Thu Apr 07, 2005 12:07 pm
Location: Worcestershire

Postby nelz » Tue Jun 04, 2013 3:40 pm

That response was to Spangwiches, regarding the Arch post.

There shouldn't be hidden config files in the root directory, but Java programs don't always seem to worry about such things :(
"Insanity: doing the same thing over and over again and expecting different results." (Albert Einstein)
User avatar
nelz
Site admin
 
Posts: 8532
Joined: Mon Apr 04, 2005 11:52 am
Location: Warrington, UK

Postby johnhudson » Tue Jun 04, 2013 9:08 pm

guy wrote:I have a mailbox file in /var/mail but it is some kind of system mailbox, not my regular one (which is in $HOME/.evolution).


It is for the original Unix mail user agent which you will find in /bin. It only transmits plain text messages and is used to send system messages, such as those from syslog.
johnhudson
LXF regular
 
Posts: 881
Joined: Wed Aug 03, 2005 1:37 pm

Postby Spangwiches » Thu Jun 06, 2013 10:54 am

Sorry nelz, you're right I must've read that somewhere else and assumed it was there.

I remember reading an explanation/alternative but sadly I don't remember what it was (since it's not something I care about (or even really understand)).
User avatar
Spangwiches
 
Posts: 81
Joined: Thu Sep 22, 2011 2:50 am


Return to Discussion

Who is online

Users browsing this forum: No registered users and 1 guest