STLLUG - St. Louis Linux User Group
10/19/1995 : Filesystem Structure Standard Tutorial
Presenter: Matthew Feldt
Linux Filesystem Structure Standard
v1.2 released March 28, 1995
The official HTML version of the file system standard can be found at
http://www.pathname.com/fhs/.
- Describes the structure of the filesystem:
-
- Locations of files and directories
- Not how the data is written to disk
- Why?
-
- To promote uniformity across distributions
- Simplfy development of new applications/features
- Features:
-
- Distingishes between shareable and unshareable resources
- R/O /usr filesystem
- Well organized binary directories
| Shareable | Unshareable |
Static | /usr | /etc |
| /boot |
Dynamic | /home | /var/run |
/var/spool/mail | /var/lock |
/ | (Root) Must contain all the files necessary to boot the machine single |
/bin | Essential commands |
/boot | Boot loader files and optionally kernels |
/dev | Device files |
/etc | Machine local config files |
/home | Home directories |
/lib | Shared libraries |
/mnt | Temporary mount points |
/proc | Process information pseudo-filesystem |
/root | Home directory for root |
/sbin | Essential system binaries |
/tmp | Temporary files |
/usr | Second major hierarchy |
/var | Variable data (Third major hierarchy) |
/bin
- General rule:
-
If a user needs to execute it, put it in /bin
If only superuser or startup needs it, put it in /sbin
- Required files:
-
arch, cat, chgrp, chmod, chown, cp, date, dd, df, dmesg, echo, ed,
false, kill, ln, login, ls, mkdir, mknod, more, mount, mv, ps, pwd,
rm, rmdir, sed, setserial, sh, stty, su, sync, true, umount, uname
- All user-level recovery binaries should also be in /bin:
-
tar, cpio, gzip, gunzip, zcat
- Some shells:
-
bash, sh (link to bash), tcsh, ash, zsh, pksh
/etc - Local configuration files. No binaries!!
- Required files:
-
adjtime, csh.login, disktab, fdprm, fstab, gettydefs, group, inittab,
issue, ld.so.conf, lilo.conf, magic, motd, mtab, mtools, passwd, profile,
psdatabase, securetty, shells, syslog.conf, termcap, ttytype
exports, ftpusers, gateways, hosts, host.conf, hosts.equiv, hosts.lpd
inetd.conf, networks, printcap, protocols, resolv.conf, rpc, services
/lib - Essential static libraries
libc.so.*, libm.so.*, ld.so, cpp (for compatability),
/lib/modules - kernel loadable modules (unspecified) organized by version
/sbin - utilities for system administration
Ordanary users should not have /sbin (/usr/sbin) on their paths.
- Required files:
-
clock, getty, init, update, mkswap, swapon, swapoff, telinit,
fastboot, fasthalt, halt, reboot, shutdown, fdisk, fsck, fsck.*,
mkfs, mkfs.*, badblocks, dumpe2fs, e2fsck, mke2fs, mklost+found,
tune2fs, lilo, arp, ifconfig, route
- Optional files:
-
static ln, static sync, ldconfig, kbdrate, ctrlaltdel
/usr
/X11R6 | X11 R6 |
/X386 | X11 R5 |
/bin | Most user commands |
/dict | Word lists |
/doc | Misc. documentation |
/etc | Site-wide system configuration |
/games | Games |
/include | Header files |
/info | Gnu info files |
/lib | Libraries |
/local | Local files |
/man | Manual pages |
/sbin | Non-vital system admin binaries |
/share | Architecture-independent data |
/src | Source code (e.g. linux kernel source) |
- The sybolic links may be present for compatibility
-
/usr/adm -> /var/adm
/usr/preserve -> /var/preserve
/usr/spool -> /var/spool
/usr/tmp -> /var/tmp
/usr/bin - Most user level commands
- Example contents
-
User-level networking binaries: telnet, ftp, ncftp, ping
Shells: (links to) bash, sh, tcsh, perl, tcl
Text utilities etc.
/usr/sbin - Non-vital system binaries
All networking daemons: in.*
/var
/adm | System administration data, obsolete, symlink to /var/log |
/catman | Formatted man pages |
/lib | Application state information |
/local | Variable data from /usr/local |
/lock | Lock files |
/log | Log files |
/named | DNS files |
/nis | NIS files |
/preserve | Saved editor states |
/run | Files relevant to running processes (pid's) |
/spool | Queued work, mail, cron, news |
/tmp | Temporary files, (to keep /tmp small) |
Last Modified: 9 December 1995
St. Louis Unix Users Group - Linux SIG