1 2 3 4 - 1 - 5 6 7 8 9 10 11 Filesystem Hierarchy Standard -- Version 2.2 beta 12 13 Filesystem Hierarchy Standard Group 14 edited by Rusty Russell and Daniel Quinlan 15 16 17 ABSTRACT 18 19 This standard consists of a set of requirements and 20 guidelines for file and directory placement under UNIX-like 21 operating systems. The guidelines are intended to support 22 interoperability of applications, system administration tools, 23 development tools, and scripts as well as greater uniformity 24 of documentation for these systems. 25 26 27 March 12, 2001 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 Filesystem Hierarchy Standard March 12, 2001 71 72 73 74 All trademarks and copyrights are owned by their owners, unless 75 specifically noted otherwise. Use of a term in this document should not 76 be regarded as affecting the validity of any trademark or service mark. 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 Copyright (C) 1994-2001 Daniel Quinlan 111 112 Copyright (C) 2001 Paul `Rusty' Russell 113 114 Permission is granted to make and distribute verbatim copies of this 115 standard provided the copyright and this permission notice are preserved 116 on all copies. 117 Permission is granted to copy and distribute modified versions of this 118 standard under the conditions for verbatim copying, provided also that 119 the title page is labeled as modified including a reference to the 120 original standard, provided that information on retrieving the original 121 standard is included, and provided that the entire resulting derived 122 work is distributed under the terms of a permission notice identical to 123 this one. 124 125 Permission is granted to copy and distribute translations of this 126 standard into another language, under the above conditions for modified 127 versions, except that this permission notice may be stated in a 128 translation approved by the copyright holder. 129 130 - 2 - 131 132 133 134 135 136 Filesystem Hierarchy Standard March 12, 2001 137 138 139 140 1. Introduction 141 142 1.1 Purpose 143 144 This standard enables 145 146 o Software to predict the location of installed files and 147 directories, and 148 149 o Users to predict the location of installed files and directories. 150 151 We do this by 152 153 o Specifying guiding principles for each area of the filesystem, 154 155 o Specifying the minimum files and directories required, 156 157 o Enumerating exceptions to the principles, and 158 159 o Enumerating specific cases where there has been historical 160 conflict. 161 162 The FHS document is used by 163 164 o Independent software suppliers to create applications which are FHS 165 compliant, and work with distributions which are FHS complaint, 166 167 o OS creators to provide systems which are FHS compliant, and 168 169 o Users to understand and maintain the FHS compliance of a system. 170 171 1.2 Conventions 172 173 We recommend that you read a typeset version of this document rather 174 than the plain text version. In the typeset version, the names of files 175 and directories are displayed in a constant-width font. 176 177 Components of filenames that vary are represented by a description of 178 the contents enclosed in "<" and ">" characters, . Electronic 179 mail addresses are also enclosed in "<" and ">" but are shown in the 180 usual typeface. 181 182 Optional components of filenames are enclosed in "[" and "]" characters 183 and may be combined with the "<" and ">" convention. For example, if a 184 filename is allowed to occur either with or without an extension, it 185 might be represented by [.]. 186 187 Variable substrings of directory names and filenames are indicated by 188 "*". 189 190 191 192 193 194 195 196 - 3 - 197 198 199 200 201 202 Filesystem Hierarchy Standard March 12, 2001 203 204 205 206 2. The Filesystem 207 208 This standard assumes that the operating system underlying an FHS- 209 compliant file system supports the same basic security features found in 210 most UNIX filesystems. 211 212 It is possible to define two independent categories of files: shareable 213 vs. unshareable and variable vs. static. There should be a simple and 214 easily understandable mapping from directories to the type of data they 215 contain: directories may be mount points for other filesystems with 216 different characteristics from the filesystem on which they are mounted. 217 218 Shareable data is that which can be shared between several different 219 hosts; unshareable is that which must be specific to a particular host. 220 For example, user home directories are shareable data, but device lock 221 files are not. 222 223 Static data includes binaries, libraries, documentation, and anything 224 that does not change without system administrator intervention; variable 225 data is anything else that does change without system administrator 226 intervention. 227 228 BEGIN RATIONALE 229 The distinction between shareable and unshareable data is needed for 230 several reasons: 231 232 o In a networked environment (i.e., more than one host at a site), 233 there is a good deal of data that can be shared between different 234 hosts to save space and ease the task of maintenance. 235 236 o In a networked environment, certain files contain information 237 specific to a single host. Therefore these filesystems cannot be 238 shared (without taking special measures). 239 240 o Historical implementations of UNIX-like filesystems interspersed 241 shareable and unshareable data in the same hierarchy, making it 242 difficult to share large portions of the filesystem. 243 244 The "shareable" distinction can be used to support, for example: 245 246 o A /usr partition (or components of /usr) mounted (read-only) 247 through the network (using NFS). 248 249 o A /usr partition (or components of /usr) mounted from read-only 250 media. A CD-ROM is one copy of many identical ones distributed to 251 other users by the postal mail system and other methods. It can 252 thus be regarded as a read-only filesystem shared with other FHS- 253 compliant systems by some kind of "network". 254 255 The "static" versus "variable" distinction affects the filesystem in two 256 major ways: 257 258 o Since / contains both variable and static data, it needs to be 259 mounted read-write. 260 261 262 - 4 - 263 264 265 266 267 268 Filesystem Hierarchy Standard March 12, 2001 269 270 271 272 o Since the traditional /usr contains both variable and static data, 273 and since we may want to mount it read-only (see above), it is 274 necessary to provide a method to have /usr mounted read-only. This 275 is done through the creation of a /var hierarchy that is mounted 276 read-write (or is a part of another read-write partition, such as 277 /), taking over much of the /usr partition's traditional 278 functionality. 279 280 Here is a summarizing chart. This chart is only an example for a common 281 FHS-compliant system, other chart layouts are possible within FHS- 282 compliance. 283 284 +---------+-----------------+-------------+ 285 | | shareable | unshareable | 286 +---------+-----------------+-------------+ 287 |static | /usr | /etc | 288 | | /opt | /boot | 289 +---------+-----------------+-------------+ 290 |variable | /var/mail | /var/run | 291 | | /var/spool/news | /var/lock | 292 END RATIONALE +---------+-----------------+-------------+ 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 - 5 - 329 330 331 332 333 334 Filesystem Hierarchy Standard March 12, 2001 335 336 337 338 3. The Root Filesystem 339 340 3.1 Purpose 341 342 The contents of the root filesystem must be adequate to boot, restore, 343 recover, and/or repair the system. 344 345 o To boot a system, enough must be present on the root partition to 346 mount other filesystems. This includes utilities, configuration, 347 boot loader information, and other essential start-up data. /usr, 348 /opt, and /var are designed such that they may be located on other 349 partitions or filesystems. 350 351 o To enable recovery and/or repair of a system, those utilities 352 needed by an experienced maintainer to diagnose and reconstruct a 353 damaged system must be present on the root filesystem. 354 355 o To restore a system, those utilities needed to restore from system 356 backups (on floppy, tape, etc.) must be present on the root 357 filesystem. 358 359 BEGIN RATIONALE 360 The primary concern used to balance these considerations, which favor 361 placing many things on the root filesystem, is the goal of keeping root 362 as small as reasonably possible. For several reasons, it is desirable 363 to keep the root filesystem small: 364 365 o It is occasionally mounted from very small media. 366 367 o The root filesystem contains many system-specific configuration 368 files. Possible examples include a kernel that is specific to the 369 system, a specific hostname, etc. This means that the root 370 filesystem isn't always shareable between networked systems. 371 Keeping it small on servers in networked systems minimizes the 372 amount of lost space for areas of unshareable files. It also 373 allows workstations with smaller local hard drives. 374 375 o While you may have the root filesystem on a large partition, and 376 may be able to fill it to your heart's content, there will be 377 people with smaller partitions. If you have more files installed, 378 you may find incompatibilities with other systems using root 379 filesystems on smaller partitions. If you are a developer then you 380 may be turning your assumption into a problem for a large number of 381 users. 382 383 o Disk errors that corrupt data on the root filesystem are a greater 384 problem than errors on any other partition. A small root 385 filesystem is less prone to corruption as the result of a system 386 crash. 387 388 Software must never create or require special files or subdirectories in 389 the root directory. Other locations in the FHS hierarchy provide more 390 than enough flexibility for any package. 391 392 393 394 - 6 - 395 396 397 398 399 400 Filesystem Hierarchy Standard March 12, 2001 401 402 403 404 There are several reasons why introducing a new subdirectory of the root 405 filesystem is prohibited: 406 407 o It demands space on a root partition which the system administrator 408 may want kept small and simple for either performance or security 409 reasons. 410 411 o It evades whatever discipline the system administrator may have set 412 up for distributing standard file hierarchies across mountable 413 volumes. 414 END RATIONALE 415 416 3.2 Requirements 417 418 The following directories, or symbolic links to directories, are 419 required in /. 420 / -- the root directory 421 +-bin Essential command binaries 422 +-boot Static files of the boot loader 423 +-dev Device files 424 +-etc Host-specific system configuration 425 +-lib Essential shared libraries and kernel modules 426 +-mnt Mount point for mounting a filesystem temporarily 427 +-opt Add-on application software packages 428 +-sbin Essential system binaries 429 +-tmp Temporary files 430 +-usr Secondary hierarchy 431 +-var Variable data 432 Each directory listed above is specified in detail in separate 433 subsections below. /usr and /var each have a complete section in this 434 document due to the complexity of those directories. 435 436 437 3.3 Specific Options 438 439 The following directories, or symbolic links to directories, must be in 440 /, if the corresponding subsystem is installed: 441 / -- the root directory 442 +-home User home directories (optional) 443 +-lib Alternate format essential shared libraries (optional) 444 +-media Mount points for removable media (optional) 445 +-root Home directory for the root user (optional) 446 Each directory listed above is specified in detail in separate 447 subsections below. 448 449 450 3.4 /bin : Essential user command binaries (for use by all users) 451 452 3.4.1 Purpose 453 454 /bin contains commands that may be used by both the system administrator 455 and by users, but which are required when no other filesystems are 456 mounted (e.g. in single user mode). It may also contain commands which 457 are used indirectly by scripts.1 458 459 460 - 7 - 461 462 463 464 465 466 Filesystem Hierarchy Standard March 12, 2001 467 468 469 470 3.4.2 Requirements 471 472 There must be no subdirectories in /bin. 473 474 The following commands, or symbolic links to commands, are required in 475 /bin. 476 477 cat Utility to concatenate files to standard output 478 chgrp Utility to change file group ownership 479 chmod Utility to change file access permissions 480 chown Utility to change file owner and group 481 cp Utility to copy files and directories 482 date Utility to print or set the system data and time 483 dd Utility to convert and copy a file 484 df Utility to report filesystem disk space usage 485 dmesg Utility to print or control the kernel message buffer 486 echo Utility to display a line of text 487 false Utility to do nothing, unsuccessfully 488 hostname Utility to show or set the system's host name 489 kill Utility to send signals to processes 490 ln Utility to make links between files 491 login Utility to begin a session on the system 492 ls Utility to list directory contents 493 mkdir Utility to make directories 494 mknod Utility to make block or character special files 495 more Utility to page through text 496 mount Utility to mount a filesystem 497 mv Utility to move/rename files 498 ps Utility to report process status 499 pwd Utility to print name of current working directory 500 rm Utility to remove files or directories 501 rmdir Utility to remove empty directories 502 sed The `sed' stream editor 503 sh The Bourne command shell 504 stty Utility to change and print terminal line settings 505 su Utility to change user ID 506 sync Utility to flush filesystem buffers 507 true Utility to do nothing, successfully 508 umount Utility to unmount file systems 509 uname Utility to print system information 510 511 If /bin/sh is not a true Bourne shell, it must be a hard or symbolic 512 link to the real shell command. 513 514 The [ and test commands must be placed together in either /bin or 515 /usr/bin as separate binaries. 516 517 518 519 ____________________ 520 521 1. Command binaries that are not essential enough to place into /bin 522 must be placed in /usr/bin, instead. Items that are required only by 523 non-root users (the X Window System, chsh, etc.) are generally not 524 essential enough to be placed into the root partition. 525 526 - 8 - 527 528 529 530 531 532 Filesystem Hierarchy Standard March 12, 2001 533 534 535 536 BEGIN RATIONALE 537 For example bash behaves differently when called as sh or bash. The use 538 of a symbolic link also allows users to easily see that /bin/sh is not a 539 true Bourne shell. 540 541 The requirement for the [ and test commands to be included as separate 542 binaries is shared with the POSIX.2 standard. 543 END RATIONALE 544 545 3.4.3 Specific Options 546 547 The following programs, or symbolic links to programs, must be in /bin 548 if the corresponding subsystem is installed:2 549 550 csh The C shell (optional) 551 ed The `ed' editor (optional) 552 tar The tar archiving utility (optional) 553 cpio The cpio archiving utility (optional) 554 gzip The GNU compression utility (optional) 555 gunzip The GNU uncompression utility (optional) 556 zcat The GNU uncompression utility (optional) 557 netstat The network statistics utility (optional) 558 ping The ICMP network test utility (optional) 559 560 If the gunzip and zcat programs exist, they must be symbolic or hard 561 links to gzip. /bin/csh may be a symbolic link to /bin/tcsh or 562 /usr/bin/tcsh. 563 564 BEGIN RATIONALE 565 The tar, gzip and cpio commands have been added to make restoration of a 566 system possible (provided that / is intact). 567 568 Conversely, if no restoration from the root partition is ever expected, 569 then these binaries might be omitted (e.g., a ROM chip root, mounting 570 /usr through NFS). If restoration of a system is planned through the 571 network, then ftp or tftp (along with everything necessary to get an ftp 572 connection) must be available on the root partition. 573 END RATIONALE 574 575 3.5 /boot : Static files of the boot loader 576 577 3.5.1 Purpose 578 579 This directory contains everything required for the boot process except 580 configuration files and the map installer. Thus /boot stores data that 581 is used before the kernel begins executing user-mode programs. This may 582 include saved master boot sectors, sector map files, and other data that 583 is not directly edited by hand.3 584 585 586 ____________________ 587 588 3. Programs necessary to arrange for the boot loader to be able to boot 589 a file must be placed in /sbin. Configuration files for boot loaders 590 must be placed in /etc. 591 592 - 9 - 593 594 595 596 597 598 Filesystem Hierarchy Standard March 12, 2001 599 600 601 602 3.5.2 Specific Options 603 604 The operating system kernel must be located in either / or /boot.4 605 606 3.6 /dev : Device files 607 608 3.6.1 Purpose 609 610 The /dev directory is the location of special or device files. 611 612 3.6.2 Specific Options 613 614 If it is possible that devices in /dev will need to be manually created, 615 /dev must contain a command named MAKEDEV, which can create devices as 616 needed. It may also contain a MAKEDEV.local for any local devices. 617 618 If required, MAKEDEV must have provisions for creating any device that 619 may be found on the system, not just those that a particular 620 implementation installs. 621 622 3.7 /etc : Host-specific system configuration 623 624 3.7.1 Purpose 625 626 /etc contains configuration files and directories that are specific to 627 the current system.5 628 629 3.7.2 Requirements 630 631 No binaries may be located under /etc. 632 633 The following directories, or symbolic links to directories are required 634 in /etc: 635 /etc -- Host-specific system configuration 636 +-opt Configuration for /opt 637 638 3.7.3 Specific Options 639 640 The following directories, or symbolic links to directories must be in 641 /etc, if the corresponding subsystem is installed: 642 643 ____________________ 644 645 4. On some i386 machines, it may be necessary for /boot to be located on 646 a separate partition located completely below cylinder 1024 of the 647 boot device due to hardware constraints. 648 649 Certain MIPS systems require a /boot partition that is a mounted MS- 650 DOS filesystem or whatever other filesystem type is accessible for 651 the firmware. This may result in restrictions with respect to usable 652 filenames for /boot (only for affected systems). 653 654 5. The setup of command scripts invoked at boot time may resemble System 655 V, BSD or other models. Further specification in this area may be 656 added to a future version of this standard. 657 658 - 10 - 659 660 661 662 663 664 Filesystem Hierarchy Standard March 12, 2001 665 666 667 668 /etc -- Host-specific system configuration 669 +-X11 Configuration for the X Window System (optional) 670 +-sgml Configuration for SGML and XML (optional) 671 The following files, or symbolic links to files, must be in /etc if the 672 corresponding subsystem is installed:6 673 674 csh.login Systemwide initialization file for C shell logins (optional) 675 exports NFS filesystem access control list (optional) 676 fstab Static information about filesystems (optional) 677 ftpusers FTP daemon user access control list (optional) 678 gateways File which lists gateways for routed (optional) 679 gettydefs Speed and terminal settings used by getty (optional) 680 group User group file (optional) 681 host.conf Resolver configuration file (optional) 682 hosts Static information about host names (optional) 683 hosts.allow Host access file for TCP wrappers (optional) 684 hosts.deny Host access file for TCP wrappers (optional) 685 hosts.equiv List of trusted hosts for rlogin, rsh, rcp (optional) 686 hosts.lpd List of trusted hosts for lpd (optional) 687 inetd.conf Configuration file for inetd (optional) 688 inittab Configuration file for init (optional) 689 issue Pre-login message and identification file (optional) 690 ld.so.conf List of extra directories to search for shared libraries (optional) 691 motd Post-login message of the day file (optional) 692 mtab Dynamic information about filesystems (optional) 693 mtools.conf Configuration file for mtools (optional) 694 networks Static information about network names (optional) 695 passwd The password file (optional) 696 printcap The lpd printer capability database (optional) 697 profile Systemwide initialization file for sh shell logins (optional) 698 protocols IP protocol listing (optional) 699 resolv.conf Resolver configuration file (optional) 700 rpc RPC protocol listing (optional) 701 securetty TTY access control for root login (optional) 702 services Port names for network services (optional) 703 shells Pathnames of valid login shells (optional) 704 syslog.conf Configuration file for syslogd (optional) 705 706 mtab does not fit the static nature of /etc: it is excepted for 707 historical reasons.7 708 709 3.7.4 /etc/opt : Configuration files for /opt 710 711 3.7.4.1 Purpose 712 713 Host-specific configuration files for add-on application software 714 715 ____________________ 716 717 6. Systems that use the shadow password suite will have additional 718 configuration files in /etc (/etc/shadow and others) and programs in 719 /usr/sbin (useradd, usermod, and others). 720 721 7. On some Linux systems, this may be a symbolic link to /proc/mounts, 722 in which case this exception is not required. 723 724 - 11 - 725 726 727 728 729 730 Filesystem Hierarchy Standard March 12, 2001 731 732 733 734 packages must be installed within the directory /etc/opt/, 735 where is the name of the subtree in /opt where the static data 736 from that package is stored. 737 738 3.7.4.2 Requirements 739 740 No structure is imposed on the internal arrangement of 741 /etc/opt/. 742 743 If a configuration file must reside in a different location in order for 744 the package or system to function properly, it may be placed in a 745 location other than /etc/opt/. 746 747 BEGIN RATIONALE 748 Refer to the rationale for /opt. 749 END RATIONALE 750 751 3.7.5 /etc/X11 : Configuration for the X Window System (optional) 752 753 3.7.5.1 Purpose 754 755 /etc/X11 is the location for all X11 host-specific configuration. This 756 directory is necessary to allow local control if /usr is mounted read 757 only. 758 759 3.7.5.2 Specific Options 760 761 The following files, or symbolic links to files, must be in /etc/X11 if 762 the corresponding subsystem is installed: 763 764 Xconfig The configuration file for early versions of XFree86 (optional) 765 XF86Config The configuration file for XFree86 versions 3 and 4 (optional) 766 Xmodmap Global X11 keyboard modification file (optional) 767 768 Subdirectories of /etc/X11 may include those for xdm and for any other 769 programs (some window managers, for example) that need them.8 We 770 recommend that window managers with only one configuration file which is 771 a default .*wmrc file must name it system.*wmrc (unless there is a 772 widely-accepted alternative name) and not use a subdirectory. Any 773 window manager subdirectories must be identically named to the actual 774 window manager binary. 775 776 3.7.6 /etc/sgml : Configuration files for SGML and XML (optional) 777 778 3.7.6.1 Purpose 779 780 Generic configuration files defining high-level parameters of the SGML 781 or XML systems are installed here. Files with names *.conf indicate 782 generic configuration files. File with names *.cat are the DTD-specific 783 784 ____________________ 785 786 8. /etc/X11/xdm holds the configuration files for xdm. These are most 787 of the files previously found in /usr/lib/X11/xdm. Some local 788 variable data for xdm is stored in /var/lib/xdm. 789 790 - 12 - 791 792 793 794 795 796 Filesystem Hierarchy Standard March 12, 2001 797 798 799 800 centralized catalogs, containing references to all other catalogs needed 801 to use the given DTD. The super catalog file catalog references all the 802 centralized catalogs. 803 804 3.8 /home : User home directories (optional) 805 806 3.8.1 Purpose 807 808 /home is a fairly standard concept, but it is clearly a site-specific 809 filesystem.9 The setup will differ from host to host. Therefore, no 810 program should rely on this location.10 811 812 3.9 /lib : Essential shared libraries and kernel modules 813 814 3.9.1 Purpose 815 816 The /lib directory contains those shared library images needed to boot 817 the system and run the commands in the root filesystem, ie. by binaries 818 in /bin and /sbin.11 819 820 3.9.2 Requirements 821 822 At least one of each of the following filename patterns are required 823 (they may be files, or symbolic links): 824 825 libc.so.* The dynamically-linked C library (optional) 826 ld* The execution time linker/loader (optional) 827 828 If a C preprocessor is installed, /lib/cpp must be a reference to it, 829 for historical reasons.12 830 831 ____________________ 832 833 9. Different people prefer to place user accounts in a variety of 834 places. This section describes only a suggested placement for user 835 home directories; nevertheless we recommend that all FHS-compliant 836 distributions use this as the default location for home directories. 837 On small systems, each user's directory is typically one of the many 838 subdirectories of /home such as /home/smith, /home/torvalds, 839 /home/operator, etc. On large systems (especially when the /home 840 directories are shared amongst many hosts using NFS) it is useful to 841 subdivide user home directories. Subdivision may be accomplished by 842 using subdirectories such as /home/staff, /home/guests, 843 /home/students, etc. 844 845 10.If you want to find out a user's home directory, you should use the 846 getpwent(3) library function rather than relying on /etc/passwd 847 because user information may be stored remotely using systems such as 848 NIS. 849 850 11.Shared libraries that are only necessary for binaries in /usr (such 851 as any X Window binaries) must not be in /lib. Only the shared 852 libraries required to run binaries in /bin and /sbin may be here. In 853 particular, the library libm.so.* may also be placed in /usr/lib if 854 it is not required by anything in /bin or /sbin. 855 856 - 13 - 857 858 859 860 861 862 Filesystem Hierarchy Standard March 12, 2001 863 864 865 866 3.9.3 Specific Options 867 868 The following directories, or symbolic links to directories, must be in 869 /lib, if the corresponding subsystem is installed: 870 /lib -- essential shared libraries and kernel modules 871 +-modules Loadable kernel modules (optional) 872 3.10 /lib : Alternate format essential shared libraries 873 (optional) 874 875 3.10.1 Purpose 876 877 There may be one or more variants of the /lib directory on systems which 878 support more than one binary format requiring separate libraries.13 879 880 3.10.2 Requirements 881 882 The requirements for contents of this directory are the same as the 883 normal /lib directory, except that /lib/cpp is not required.14 884 885 3.11 /media : Mount points for removable media (optional) 886 887 3.11.1 Purpose 888 889 This directory must contain a single level of subdirectories to be used 890 as mount points for removable and temporary media, such as CD-ROMs, 891 DVDs, floppies, and other forms of removable media. 892 893 The naming of subdirectories must not affect the manner in which any 894 program is run. 895 896 3.11.2 Specific Options 897 898 It is recommended that subdirectories be named [], where 899 is the media or device to be mounted under that directory and 900 is not used for the first device of any one type. The second 901 device of any one type is given a of "2", the third "3", and so 902 on. For example, the mount point for the second CD-ROM drive is 903 "cdrom2". 904 905 Example type names: 906 907 ____________________ 908 909 12.The usual placement of this binary is 910 /usr/lib/gcc-lib///cpp. /lib/cpp can either point 911 at this binary, or at any other reference to this binary which exists 912 in the filesystem. (For example, /usr/bin/cpp is also often used.) 913 914 13.This is commonly used for 64-bit or 32-bit support on systems which 915 support multiple binary formats, but require libraries of the same 916 name. In this case, /lib32 and /lib64 might be the library 917 directories, and /lib a symlink to one of them. 918 919 14.The case where /lib and /lib are the same (one is a symbolic 920 link to the other) this files subdirectories will exist. 921 922 - 14 - 923 924 925 926 927 928 Filesystem Hierarchy Standard March 12, 2001 929 930 931 932 cdrom CD-ROM drive 933 dvd DVD drive 934 floppy floppy drive 935 jaz JAZ drive 936 zip ZIP drive 937 938 3.12 /mnt : Mount point for a temporarily mounted filesystem 939 940 3.12.1 Purpose 941 942 This directory is provided so that the system administrator may 943 temporarily mount a filesystem as needed. The content of this directory 944 is a local issue and should not affect the manner in which any program 945 is run. 946 947 This directory must not be used by installation programs: a suitable 948 temporary directory not in use by the system must be used instead. 949 950 3.13 /opt : Add-on application software packages 951 952 3.13.1 Purpose 953 954 /opt is reserved for the installation of add-on application software 955 packages. 956 957 A package to be installed in /opt must locate its static files in a 958 separate /opt/ directory tree, where is a name that 959 describes the software package. 960 961 3.13.2 Requirements 962 963 /opt -- Add-on application software packages 964 +- Static package objects 965 The directories /opt/bin, /opt/doc, /opt/include, /opt/info, /opt/lib, 966 and /opt/man are reserved for local system administrator use. Packages 967 may provide "front-end" files intended to be placed in (by linking or 968 copying) these reserved directories by the local system administrator, 969 but must function normally in the absence of these reserved directories. 970 971 Programs to be invoked by users must be located in the directory 972 /opt//bin. If the package includes UNIX manual pages, they must 973 be located in /opt//man and the same substructure as 974 /usr/share/man must be used. 975 976 Package files that are variable (change in normal operation) must be 977 installed in /var/opt. See the section on /var/opt for more 978 information. 979 980 Host-specific configuration files must be installed in /etc/opt. See 981 the section on /etc for more information. 982 983 No other package files may exist outside the /opt, /var/opt, and 984 /etc/opt hierarchies except for those package files that must reside in 985 specific locations within the filesystem tree in order to function 986 987 988 - 15 - 989 990 991 992 993 994 Filesystem Hierarchy Standard March 12, 2001 995 996 997 998 properly. For example, device lock files must be placed in /var/lock 999 and devices must be located in /dev. 1000 1001 Distributions may install software in /opt, but must not modify or 1002 delete software installed by the local system administrator without the 1003 assent of the local system administrator. 1004 1005 BEGIN RATIONALE 1006 The use of /opt for add-on software is a well-established practice in 1007 the UNIX community. The System V Application Binary Interface [AT&T 1008 1990], based on the System V Interface Definition (Third Edition), 1009 provides for an /opt structure very similar to the one defined here. 1010 1011 The Intel Binary Compatibility Standard v. 2 (iBCS2) also provides a 1012 similar structure for /opt. 1013 1014 Generally, all data required to support a package on a system must be 1015 present within /opt/, including files intended to be copied 1016 into /etc/opt/ and /var/opt/ as well as reserved 1017 directories in /opt. 1018 1019 The minor restrictions on distributions using /opt are necessary because 1020 conflicts are possible between distribution-installed and locally- 1021 installed software, especially in the case of fixed pathnames found in 1022 some binary software. 1023 END RATIONALE 1024 1025 3.14 /root : Home directory for the root user (optional) 1026 1027 3.14.1 Purpose 1028 1029 The root account's home directory may be determined by developer or 1030 local preference, but this is the recommended default location.15 1031 1032 3.15 /sbin : System binaries 1033 1034 3.15.1 Purpose 1035 1036 Utilities used for system administration (and other root-only commands) 1037 are stored in /sbin, /usr/sbin, and /usr/local/sbin. /sbin contains 1038 binaries essential for booting, restoring, recovering, and/or repairing 1039 1040 ____________________ 1041 1042 15.If the home directory of the root account is not stored on the root 1043 partition it will be necessary to make certain it will default to / 1044 if it can not be located. 1045 1046 We recommend against using the root account for tasks that can be 1047 performed as an unprivileged user, and that it be used solely for 1048 system administration. For this reason, we recommend that 1049 subdirectories for mail and other applications not appear in the root 1050 account's home directory, and that mail for administration roles such 1051 as root, postmaster, and webmaster be forwarded to an appropriate 1052 user. 1053 1054 - 16 - 1055 1056 1057 1058 1059 1060 Filesystem Hierarchy Standard March 12, 2001 1061 1062 1063 1064 the system in addition to the binaries in /bin.16 Programs executed 1065 after /usr is known to be mounted (when there are no problems) are 1066 generally placed into /usr/sbin. Locally-installed system 1067 administration programs should be placed into /usr/local/sbin.17 1068 1069 3.15.2 Requirements 1070 1071 The following commands, or symbolic links to commands, are required in 1072 /sbin. 1073 1074 shutdown Command to bring the system down. 1075 1076 3.15.3 Specific Options 1077 1078 The following files, or symbolic links to files, must be in /sbin if the 1079 corresponding subsystem is installed: 1080 1081 fastboot Reboot the system without checking the disks (optional) 1082 fasthalt Stop the system without checking the disks (optional) 1083 fdisk Partition table manipulator (optional) 1084 fsck File system check and repair utility (optional) 1085 fsck.* File system check and repair utility for a specific filesystem (optional) 1086 getty The getty program (optional) 1087 halt Command to stop the system (optional) 1088 ifconfig Configure a network interface (optional) 1089 init Initial process (optional) 1090 mkfs Command to build a filesystem (optional) 1091 mkfs.* Command to build a specific filesystem (optional) 1092 mkswap Command to set up a swap area (optional) 1093 reboot Command to reboot the system (optional) 1094 1095 1096 ____________________ 1097 1098 16.Originally, /sbin binaries were kept in /etc. 1099 1100 17.Deciding what things go into "sbin" directories is simple: if a 1101 normal (not a system administrator) user will ever run it directly, 1102 then it must be placed in one of the "bin" directories. Ordinary 1103 users should not have to place any of the sbin directories in their 1104 path. 1105 1106 For example, files such as chfn which users only occasionally use 1107 must still be placed in /usr/bin. ping, although it is absolutely 1108 necessary for root (network recovery and diagnosis) is often used by 1109 users and must live in /bin for that reason. 1110 1111 We recommend that users have read and execute permission for 1112 everything in /sbin except, perhaps, certain setuid and setgid 1113 programs. The division between /bin and /sbin was not created for 1114 security reasons or to prevent users from seeing the operating 1115 system, but to provide a good partition between binaries that 1116 everyone uses and ones that are primarily used for administration 1117 tasks. There is no inherent security advantage in making /sbin off- 1118 limits for users. 1119 1120 - 17 - 1121 1122 1123 1124 1125 1126 Filesystem Hierarchy Standard March 12, 2001 1127 1128 1129 1130 route IP routing table utility (optional) 1131 swapon Enable paging and swapping (optional) 1132 swapoff Disable paging and swapping (optional) 1133 update Daemon to periodically flush filesystem buffers (optional) 1134 1135 3.16 /tmp : Temporary files 1136 1137 3.16.1 Purpose 1138 1139 The /tmp directory must be made available for programs that require 1140 temporary files. 1141 1142 Programs must not assume that any files or directories in /tmp are 1143 preserved between invocations of the program.18 1144 1145 BEGIN RATIONALE 1146 IEEE standard P1003.2 (POSIX, part 2) makes requirements that are 1147 similar to the above section. 1148 1149 FHS added the recommendation that /tmp be cleaned at boot time on the 1150 basis of historical precedent and common practice, but did not make it a 1151 requirement because system administration is not within the scope of 1152 this standard. 1153 END RATIONALE 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 ____________________ 1181 1182 18.Although data stored in /tmp may be deleted in a site-specific 1183 manner, it is recommended that files and directories located in /tmp 1184 be deleted whenever the system is booted. 1185 1186 - 18 - 1187 1188 1189 1190 1191 1192 Filesystem Hierarchy Standard March 12, 2001 1193 1194 1195 1196 4. The /usr Hierarchy 1197 1198 4.1 Purpose 1199 1200 /usr is the second major section of the filesystem. /usr is shareable, 1201 read-only data. That means that /usr should be shareable between 1202 various FHS-compliant hosts and must not be written to. Any information 1203 that is host-specific or varies with time is stored elsewhere. 1204 1205 Large software packages must not use a direct subdirectory under the 1206 /usr hierarchy. 1207 1208 4.2 Requirements 1209 1210 The following directories, or symbolic links to directories, are 1211 required in /usr. 1212 /usr -- Secondary Hierarchy 1213 +-bin Most user commands 1214 +-include Header files included by C programs 1215 +-lib Libraries 1216 +-local Local hierarchy (empty after main installation) 1217 +-sbin Non-vital system binaries 1218 +-share Architecture-independent data 1219 1220 4.3 Specific Options 1221 1222 /usr -- Secondary Hierarchy 1223 +-X11R6 X Window System, version 11 release 6 (optional) 1224 +-games Games and educational binaries (optional) 1225 +-lib Alternate Format Libraries (optional) 1226 +-src Source code (optional) 1227 An exception is made for the X Window System because of considerable 1228 precedent and widely-accepted practice. 1229 1230 The following symbolic links to directories may be present. This 1231 possibility is based on the need to preserve compatibility with older 1232 systems until all implementations can be assumed to use the /var 1233 hierarchy. 1234 1235 /usr/spool -> /var/spool 1236 /usr/tmp -> /var/tmp 1237 /usr/spool/locks -> /var/lock 1238 1239 Once a system no longer requires any one of the above symbolic links, 1240 the link may be removed, if desired. 1241 1242 4.4 /usr/X11R6 : X Window System, Version 11 Release 6 (optional) 1243 1244 4.4.1 Purpose 1245 1246 This hierarchy is reserved for the X Window System, version 11 release 1247 6, and related files. 1248 1249 To simplify matters and make XFree86 more compatible with the X Window 1250 1251 1252 - 19 - 1253 1254 1255 1256 1257 1258 Filesystem Hierarchy Standard March 12, 2001 1259 1260 1261 1262 System on other systems, the following symbolic links must be present if 1263 /usr/X11R6 exists: 1264 1265 /usr/bin/X11 -> /usr/X11R6/bin 1266 /usr/lib/X11 -> /usr/X11R6/lib/X11 1267 /usr/include/X11 -> /usr/X11R6/include/X11 1268 1269 In general, software must not be installed or managed via the above 1270 symbolic links. They are intended for utilization by users only. The 1271 difficulty is related to the release version of the X Window System -- 1272 in transitional periods, it is impossible to know what release of X11 is 1273 in use. 1274 1275 4.4.2 Specific Options 1276 1277 Host-specific data in /usr/X11R6/lib/X11 should be interpreted as a 1278 demonstration file. Applications requiring information about the 1279 current host must reference a configuration file in /etc/X11, which may 1280 be linked to a file in /usr/X11R6/lib.19 1281 1282 4.5 /usr/bin : Most user commands 1283 1284 4.5.1 Purpose 1285 1286 This is the primary directory of executable commands on the system. 1287 1288 4.5.2 Specific Options 1289 1290 The following directories, or symbolic links to directories, must be in 1291 /usr/bin, if the corresponding subsystem is installed: 1292 /usr/bin -- Binaries that are not needed in single-user mode 1293 +-mh Commands for the MH mail handling system (optional) 1294 /usr/bin/X11 must be a symlink to /usr/X11R6/bin if the latter exists. 1295 1296 The following files, or symbolic links to files, must be in /usr/bin, if 1297 the corresponding subsystem is installed: 1298 1299 perl The Practical Extraction and Report Language (optional) 1300 python The Python interpreted language (optional) 1301 tclsh Simple shell containing Tcl interpreter (optional) 1302 wish Simple Tcl/Tk windowing shell (optional) 1303 expect Program for interactive dialog (optional) 1304 1305 BEGIN RATIONALE 1306 Because shell script interpreters (invoked with #! on the first 1307 line of a shell script) cannot rely on a path, it is advantageous to 1308 standardize their locations. The Bourne shell and C-shell interpreters 1309 are already fixed in /bin, but Perl, Python, and Tcl are often found in 1310 many different places. They may be symlinks to the physical location of 1311 the shell interpreters. 1312 1313 ____________________ 1314 1315 19.Examples of such configuration files include Xconfig, XF86Config, or 1316 system.twmrc) 1317 1318 - 20 - 1319 1320 1321 1322 1323 1324 Filesystem Hierarchy Standard March 12, 2001 1325 1326 1327 1328 END RATIONALE 1329 1330 4.6 /usr/include : Directory for standard include files. 1331 1332 4.6.1 Purpose 1333 1334 This is where all of the system's general-use include files for the C 1335 programming language should be placed. 1336 1337 4.6.2 Specific Options 1338 1339 The following directories, or symbolic links to directories, must be in 1340 /usr/include, if the corresponding subsystem is installed: 1341 /usr/include -- Include files 1342 +-bsd BSD compatibility include files (optional) 1343 The symbolic link /usr/include/X11 must link to /usr/X11R6/include/X11 1344 if the latter exists. 1345 1346 4.7 /usr/lib : Libraries for programming and packages 1347 1348 4.7.1 Purpose 1349 1350 /usr/lib includes object files, libraries, and internal binaries that 1351 are not intended to be executed directly by users or shell scripts.20 1352 1353 Applications may use a single subdirectory under /usr/lib. If an 1354 application uses a subdirectory, all architecture-dependent data 1355 exclusively used by the application must be placed within that 1356 subdirectory.21 1357 1358 4.7.2 Specific Options 1359 1360 For historical reasons, /usr/lib/sendmail must be a symbolic link to 1361 /usr/sbin/sendmail if the latter exists.22 1362 1363 /usr/lib/X11 must be a symbolic link to /lib/X11 if the latter exists.23 1364 1365 4.8 /usr/lib : Alternate format libraries (optional) 1366 1367 1368 1369 ____________________ 1370 1371 20.Miscellaneous architecture-independent application-specific static 1372 files and subdirectories must be placed in /usr/share. 1373 1374 21.For example, the perl5 subdirectory for Perl 5 modules and libraries. 1375 1376 22.Some executable commands such as makewhatis and sendmail have also 1377 been traditionally placed in /usr/lib. makewhatis is an internal 1378 binary and must be placed in a binary directory; users access only 1379 catman. Newer sendmail binaries are now placed by default in 1380 /usr/sbin. Additionally, systems using a sendmail-compatible mail 1381 transport agent must provide /usr/sbin/sendmail as a symbolic link to 1382 the appropriate executable. 1383 1384 - 21 - 1385 1386 1387 1388 1389 1390 Filesystem Hierarchy Standard March 12, 2001 1391 1392 1393 1394 4.8.1 Purpose 1395 1396 /usr/lib performs the same role as /usr/lib for an alternate 1397 binary format, with the exception that the symbolic links 1398 /usr/lib/sendmail and /usr/lib/X11 do not need to exist.24 1399 1400 4.9 /usr/local : Local hierarchy 1401 1402 4.9.1 Purpose 1403 1404 The /usr/local hierarchy is for use by the system administrator when 1405 installing software locally. It needs to be safe from being overwritten 1406 when the system software is updated. It may be used for programs and 1407 data that are shareable amongst a group of hosts, but not found in /usr. 1408 1409 Locally installed software must be placed within /usr/local rather than 1410 /usr unless it is being installed to replace or upgrade software in 1411 /usr.25 1412 1413 4.9.2 Requirements 1414 1415 The following directories, or symbolic links to directories, must be in 1416 /usr/local 1417 /usr/local -- Local hierarchy 1418 +-bin Local binaries 1419 +-games Local game binaries 1420 +-include Local C header files 1421 +-lib Local libraries 1422 +-man Local online manuals 1423 +-sbin Local system binaries 1424 +-share Local architecture-independent hierarchy 1425 +-src Local source code 1426 No other directories, expect those listed below, may be in /usr/local 1427 after first installing a FHS-compliant system. 1428 1429 4.9.3 Specific Options 1430 1431 If directories /lib or /usr/lib exist, the equivalent 1432 1433 ____________________ 1434 1435 23.host-specific data for the X Window System must not be stored in 1436 /usr/lib/X11. Host-specific configuration files such as Xconfig or 1437 XF86Config must be stored in /etc/X11. This includes configuration 1438 data such as system.twmrc even if it is only made a symbolic link to 1439 a more global configuration file (probably in /usr/X11R6/lib/X11). 1440 1441 24.The case where /usr/lib and /usr/lib are the same (one is a 1442 symbolic link to the other) these files and the per-application 1443 subdirectories will exist. 1444 1445 25.Software placed in / or /usr may be overwritten by system upgrades 1446 (though we recommend that distributions do not overwrite data in /etc 1447 under these circumstances). For this reason, local software must not 1448 be placed outside of /usr/local without good reason. 1449 1450 - 22 - 1451 1452 1453 1454 1455 1456 Filesystem Hierarchy Standard March 12, 2001 1457 1458 1459 1460 directories must also exist in /usr/local. 1461 1462 4.10 /usr/sbin : Non-essential standard system binaries 1463 1464 4.10.1 Purpose 1465 1466 This directory contains any non-essential binaries used exclusively by 1467 the system administrator. System administration programs that are 1468 required for system repair, system recovery, mounting /usr, or other 1469 essential functions must be placed in /sbin instead.26 1470 1471 4.11 /usr/share : Architecture-independent data 1472 1473 4.11.1 Purpose 1474 1475 The /usr/share hierarchy is for all read-only architecture independent 1476 data files.27 1477 1478 This hierarchy is intended to be shareable among all architecture 1479 platforms of a given OS; thus, for example, a site with i386, Alpha, and 1480 PPC platforms might maintain a single /usr/share directory that is 1481 centrally-mounted. Note, however, that /usr/share is generally not 1482 intended to be shared by different OSes or by different releases of the 1483 same OS. 1484 1485 Any program or package which contains or requires data that doesn't need 1486 to be modified should store that data in /usr/share (or 1487 /usr/local/share, if installed locally). It is recommended that a 1488 subdirectory be used in /usr/share for this purpose. 1489 1490 Game data stored in /usr/share/games must be purely static data. Any 1491 modifiable files, such as score files, game play logs, and so forth, 1492 should be placed in /var/games. 1493 1494 4.11.2 Requirements 1495 1496 The following directories, or symbolic links to directories, must be in 1497 /usr/share 1498 /usr/share -- Architecture-independent data 1499 +-man Online manuals 1500 +-misc Miscellaneous architecture-independent data 1501 1502 4.11.3 Specific Options 1503 1504 The following directories, or symbolic links to directories, must be in 1505 /usr/share, if the corresponding subsystem is installed: 1506 1507 1508 ____________________ 1509 1510 26.Locally installed system administration programs should be placed in 1511 /usr/local/sbin. 1512 1513 27.Much of this data originally lived in /usr (man, doc) or /usr/lib 1514 (dict, terminfo, zoneinfo). 1515 1516 - 23 - 1517 1518 1519 1520 1521 1522 Filesystem Hierarchy Standard March 12, 2001 1523 1524 1525 1526 /usr/share -- Architecture-independent data 1527 +-dict Word lists (optional) 1528 +-doc Miscellaneous documentation (optional) 1529 +-games Static data files for /usr/games (optional) 1530 +-info GNU Info system's primary directory (optional) 1531 +-locale Locale information (optional) 1532 +-nls Native language support (optional) 1533 +-sgml SGML and XML data (optional) 1534 +-terminfo Directories for terminfo database (optional) 1535 +-tmac troff macros not distributed with groff (optional) 1536 +-zoneinfo Timezone information and configuration (optional) 1537 It is recommended that application-specific, architecture-independent 1538 directories be placed here. Such directories include groff, perl, 1539 ghostscript, texmf, and kbd (Linux) or syscons (BSD). They may, 1540 however, be placed in /usr/lib for backwards compatibility, at the 1541 distributor's discretion. Similarly, a /usr/lib/games hierarchy may be 1542 used in addition to the /usr/share/games hierarchy if the distributor 1543 wishes to place some game data there. 1544 1545 4.11.4 /usr/share/dict : Word lists (optional) 1546 1547 4.11.4.1 Purpose 1548 1549 This directory is the home for word lists on the system; Traditionally 1550 this directory contains only the English words file, which is used by 1551 look(1) and various spelling programs. words may use either American or 1552 British spelling. 1553 1554 BEGIN RATIONALE 1555 The reason that only word lists are located here is that they are the 1556 only files common to all spell checkers. 1557 END RATIONALE 1558 1559 4.11.4.2 Specific Options 1560 1561 The following files, or symbolic links to files, must be in 1562 /usr/share/dict, if the corresponding subsystem is installed: 1563 1564 words List of English words (optional) 1565 1566 Sites that require both American and British spelling may link words to 1567 /usr/share/dict/american-english or /usr/share/dict/british-english. 1568 1569 Word lists for other languages may be added using the English name for 1570 that language, e.g., /usr/share/dict/french, /usr/share/dict/danish, 1571 etc. These should, if possible, use an ISO 8859 character set which is 1572 appropriate for the language in question; if possible the Latin1 (ISO 1573 8859-1) character set should be used (this is often not possible). 1574 1575 Other word lists must be included here, if present. 1576 1577 4.11.5 /usr/share/man : Manual pages 1578 1579 1580 1581 1582 - 24 - 1583 1584 1585 1586 1587 1588 Filesystem Hierarchy Standard March 12, 2001 1589 1590 1591 1592 4.11.5.1 Purpose 1593 1594 This section details the organization for manual pages throughout the 1595 system, including /usr/share/man. Also refer to the section on 1596 /var/cache/man. 1597 1598 The primary of the system is /usr/share/man. /usr/share/man 1599 contains manual information for commands and data under the / and /usr 1600 filesystems.28 1601 1602 Manual pages are stored in //man
/. An 1603 explanation of , ,
, and is given below. 1604 1605 A description of each section follows: 1606 1607 o man1: User programs 1608 Manual pages that describe publicly accessible commands are 1609 contained in this chapter. Most program documentation that a user 1610 will need to use is located here. 1611 1612 o man2: System calls 1613 This section describes all of the system calls (requests for the 1614 kernel to perform operations). 1615 1616 o man3: Library functions and subroutines 1617 Section 3 describes program library routines that are not direct 1618 calls to kernel services. This and chapter 2 are only really of 1619 interest to programmers. 1620 1621 o man4: Special files 1622 Section 4 describes the special files, related driver functions, 1623 and networking support available in the system. Typically, this 1624 includes the device files found in /dev and the kernel interface to 1625 networking protocol support. 1626 1627 o man5: File formats 1628 The formats for many data files are documented in the section 5. 1629 This includes various include files, program output files, and 1630 system files. 1631 1632 o man6: Games 1633 This chapter documents games, demos, and generally trivial 1634 programs. Different people have various notions about how 1635 essential this is. 1636 1637 o man7: Miscellaneous 1638 Manual pages that are difficult to classify are designated as being 1639 section 7. The troff and other text processing macro packages are 1640 1641 ____________________ 1642 1643 28.Obviously, there are no manual pages in / because they are not 1644 required at boot time nor are they required in emergencies.29 1645 1646 29.Really. 1647 1648 - 25 - 1649 1650 1651 1652 1653 1654 Filesystem Hierarchy Standard March 12, 2001 1655 1656 1657 1658 found here. 1659 1660 o man8: System administration 1661 Programs used by system administrators for system operation and 1662 maintenance are documented here. Some of these programs are also 1663 occasionally useful for normal users. 1664 1665 4.11.5.2 Specific Options 1666 1667 The following directories, or symbolic links to directories, must be in 1668 /usr/share//, unless they are empty:30 1669 / -- A manual page hierarchy 1670 +-man1 User programs (optional) 1671 +-man2 System calls (optional) 1672 +-man3 Library calls (optional) 1673 +-man4 Special files (optional) 1674 +-man5 File formats (optional) 1675 +-man6 Games (optional) 1676 +-man7 Miscellaneous (optional) 1677 +-man8 System administration (optional) 1678 The component
describes the manual section. 1679 1680 Provisions must be made in the structure of /usr/share/man to support 1681 manual pages which are written in different (or multiple) languages. 1682 These provisions must take into account the storage and reference of 1683 these manual pages. Relevant factors include language (including 1684 geographical-based differences), and character code set. 1685 1686 This naming of language subdirectories of /usr/share/man is based on 1687 Appendix E of the POSIX 1003.1 standard which describes the locale 1688 identification string -- the most well-accepted method to describe a 1689 cultural environment. The string is: 1690 1691 [_][.][,] 1692 1693 The field must be taken from ISO 639 (a code for the 1694 representation of names of languages). It must be two characters wide 1695 and specified with lowercase letters only. 1696 1697 The field must be the two-letter code of ISO 3166 (a 1698 specification of representations of countries), if possible. (Most 1699 people are familiar with the two-letter codes used for the country codes 1700 in email addresses.31) It must be two characters wide and specified with 1701 uppercase letters only. 1702 1703 The field must represent the standard describing the 1704 character set. If the field is just a numeric 1705 1706 ____________________ 1707 1708 30.For example, if /usr/local/man has no manual pages in section 4 1709 (Devices), then /usr/local/man/man4 may be omitted. 1710 1711 31.A major exception to this rule is the United Kingdom, which is `GB' 1712 in the ISO 3166, but `UK' for most email addresses. 1713 1714 - 26 - 1715 1716 1717 1718 1719 1720 Filesystem Hierarchy Standard March 12, 2001 1721 1722 1723 1724 specification, the number represents the number of the international 1725 standard describing the character set. It is recommended that this be a 1726 numeric representation if possible (ISO standards, especially), not 1727 include additional punctuation symbols, and that any letters be in 1728 lowercase. 1729 1730 A parameter specifying a of the profile may be placed after 1731 the field, delimited by a comma. This may be used to 1732 discriminate between different cultural needs; for instance, dictionary 1733 order versus a more systems-oriented collating order. This standard 1734 recommends not using the field, unless it is necessary. 1735 1736 Systems which use a unique language and code set for all manual pages 1737 may omit the substring and store all manual pages in . 1738 For example, systems which only have English manual pages coded with 1739 ASCII, may store manual pages (the man
directories) directly in 1740 /usr/share/man. (That is the traditional circumstance and arrangement, 1741 in fact.) 1742 1743 Countries for which there is a well-accepted standard character code set 1744 may omit the field, but it is strongly recommended that 1745 it be included, especially for countries with several competing 1746 standards. 1747 1748 Various examples: 1749 1750 Language Territory Character Set Directory 1751 ------------------------------------------------------------------------- 1752 English -- ASCII /usr/share/man/en 1753 English United Kingdom ASCII /usr/share/man/en_GB 1754 English United States ASCII /usr/share/man/en_US 1755 French Canada ISO 8859-1 /usr/share/man/fr_CA 1756 French France ISO 8859-1 /usr/share/man/fr_FR 1757 German Germany ISO 646 /usr/share/man/de_DE.646 1758 German Germany ISO 6937 /usr/share/man/de_DE.6937 1759 German Germany ISO 8859-1 /usr/share/man/de_DE.88591 1760 German Switzerland ISO 646 /usr/share/man/de_CH.646 1761 Japanese Japan JIS /usr/share/man/ja_JP.jis 1762 Japanese Japan SJIS /usr/share/man/ja_JP.sjis 1763 Japanese Japan UJIS (or EUC-J) /usr/share/man/ja_JP.ujis 1764 1765 Similarly, provision must be made for manual pages which are 1766 architecture-dependent, such as documentation on device-drivers or low- 1767 level system administration commands. These must be placed under an 1768 directory in the appropriate man
directory; for example, 1769 a man page for the i386 ctrlaltdel(8) command might be placed in 1770 /usr/share/man//man8/i386/ctrlaltdel.8. 1771 1772 Manual pages for commands and data under /usr/local are stored in 1773 /usr/local/man. Manual pages for X11R6 are stored in /usr/X11R6/man. 1774 It follows that all manual page hierarchies in the system must have the 1775 same structure as /usr/share/man. 1776 1777 The cat page sections (cat
) containing formatted manual page 1778 1779 1780 - 27 - 1781 1782 1783 1784 1785 1786 Filesystem Hierarchy Standard March 12, 2001 1787 1788 1789 1790 entries are also found within subdirectories of /, but 1791 are not required nor may they be distributed in lieu of nroff source 1792 manual pages. 1793 1794 The numbered sections "1" through "8" are traditionally defined. In 1795 general, the file name for manual pages located within a particular 1796 section end with .
. 1797 1798 In addition, some large sets of application-specific manual pages have 1799 an additional suffix appended to the manual page filename. For example, 1800 the MH mail handling system manual pages must have mh appended to all MH 1801 manuals. All X Window System manual pages must have an x appended to 1802 the filename. 1803 1804 The practice of placing various language manual pages in appropriate 1805 subdirectories of /usr/share/man also applies to the other manual page 1806 hierarchies, such as /usr/local/man and /usr/X11R6/man. (This portion 1807 of the standard also applies later in the section on the optional 1808 /var/cache/man structure.) 1809 1810 4.11.6 /usr/share/misc : Miscellaneous architecture-independent data 1811 1812 This directory contains miscellaneous architecture-independent files 1813 which don't require a separate subdirectory under /usr/share. 1814 1815 4.11.6.1 Specific Options 1816 1817 The following files, or symbolic links to files, must be in 1818 /usr/share/misc, if the corresponding subsystem is installed: 1819 1820 ascii ASCII character set table (optional) 1821 magic Default list of magic numbers for the file command (optional) 1822 termcap Terminal capability database (optional) 1823 termcap.db Terminal capability database (optional) 1824 1825 Other (application-specific) files may appear here,32 but a distributor 1826 may place them in /usr/lib at their discretion. 1827 1828 4.11.7 /usr/share/sgml : SGML and XML data (optional) 1829 1830 4.11.7.1 Purpose 1831 1832 /usr/share/sgml contains architecture-independent files used by SGML or 1833 XML applications, such as ordinary catalogs (not the centralized ones, 1834 see /etc/sgml), DTDs, entities, or style sheets. 1835 1836 ____________________ 1837 1838 32.Some such files include: 1839 1840 { airport, birthtoken, eqnchar, getopt, gprof.callg, gprof.flat, 1841 inter.phone, ipfw.samp.filters, ipfw.samp.scripts, keycap.pcvt, 1842 mail.help, mail.tildehelp, man.template, map3270, mdoc.template, 1843 more.help, na.phone, nslookup.help, operator, scsi_modes, 1844 sendmail.hf, style, units.lib, vgrindefs, vgrindefs.db, zipcodes } 1845 1846 - 28 - 1847 1848 1849 1850 1851 1852 Filesystem Hierarchy Standard March 12, 2001 1853 1854 1855 1856 4.11.7.2 Specific Options 1857 1858 The following directories, or symbolic links to directories, must be in 1859 /usr/share/sgml, if the corresponding subsystem is installed: 1860 /usr/share/sgml -- SGML and XML data 1861 +-docbook docbook DTD (optional) 1862 +-tei tei DTD (optional) 1863 +-html html DTD (optional) 1864 +-mathml mathml DTD (optional) 1865 Other files that are not specific to a given DTD may reside in their own 1866 subdirectory. 1867 1868 4.12 /usr/src : Source code (optional) 1869 1870 4.12.1 Purpose 1871 1872 Any non-local source code should be placed in this subdirectory. 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 - 29 - 1913 1914 1915 1916 1917 1918 Filesystem Hierarchy Standard March 12, 2001 1919 1920 1921 1922 5. The /var Hierarchy 1923 1924 5.1 Purpose 1925 1926 /var contains variable data files. This includes spool directories and 1927 files, administrative and logging data, and transient and temporary 1928 files. 1929 1930 Some portions of /var are not shareable between different systems. For 1931 instance, /var/log, /var/lock, and /var/run. Other portions may be 1932 shared, notably /var/mail, /var/cache/man, /var/cache/fonts, and 1933 /var/spool/news. 1934 1935 /var is specified here in order to make it possible to mount /usr read- 1936 only. Everything that once went into /usr that is written to during 1937 system operation (as opposed to installation and software maintenance) 1938 must be in /var. 1939 1940 If /var cannot be made a separate partition, it is often preferable to 1941 move /var out of the root partition and into the /usr partition. (This 1942 is sometimes done to reduce the size of the root partition or when space 1943 runs low in the root partition.) However, /var must not be linked to 1944 /usr because this makes separation of /usr and /var more difficult and 1945 is likely to create a naming conflict. Instead, link /var to /usr/var. 1946 1947 Applications must generally not add directories to the top level of 1948 /var. Such directories should only be added if they have some system- 1949 wide implication, and in consultation with the FHS mailing list. 1950 1951 5.2 Requirements 1952 1953 The following directories, or symbolic links to directories, are 1954 required in /var. 1955 /var -- Variable data 1956 +-cache Application cache data 1957 +-lib Variable state information 1958 +-local Variable data for /usr/local 1959 +-lock Lock files 1960 +-log Log files and directories 1961 +-opt Variable data for /opt 1962 +-run Data relevant to running processes 1963 +-spool Application spool data 1964 +-tmp Temporary files preserved between system reboots 1965 Several directories are `reserved' in the sense that they must not be 1966 used arbitrarily by some new application, since they would conflict with 1967 historical and/or local practice. They are: 1968 1969 /var/backups 1970 /var/cron 1971 /var/msgs 1972 /var/preserve 1973 1974 5.3 Specific Options 1975 1976 1977 1978 - 30 - 1979 1980 1981 1982 1983 1984 Filesystem Hierarchy Standard March 12, 2001 1985 1986 1987 1988 The following directories, or symbolic links to directories, must be in 1989 /var, if the corresponding subsystem is installed: 1990 /var -- Variable data 1991 +-account Process accounting logs (optional) 1992 +-crash System crash dumps (optional) 1993 +-games Variable game data (optional) 1994 +-mail User mailbox files (optional) 1995 +-yp Network Information Service (NIS) database files (optional) 1996 1997 5.4 /var/account : Process accounting logs (optional) 1998 1999 5.4.1 Purpose 2000 2001 This directory holds the current active process accounting log and the 2002 composite process usage data (as used in some UNIX-like systems by 2003 lastcomm and sa). 2004 2005 5.5 /var/cache : Application cache data 2006 2007 5.5.1 Purpose 2008 2009 /var/cache is intended for cached data from applications. Such data is 2010 locally generated as a result of time-consuming I/O or calculation. The 2011 application must be able to regenerate or restore the data. Unlike 2012 /var/spool, the cached files can be deleted without data loss. The data 2013 must remain valid between invocations of the application and rebooting 2014 the system. 2015 2016 Files located under /var/cache may be expired in an application specific 2017 manner, by the system administrator, or both. The application must 2018 always be able to recover from manual deletion of these files (generally 2019 because of a disk space shortage). No other requirements are made on 2020 the data format of the cache directories. 2021 2022 BEGIN RATIONALE 2023 The existence of a separate directory for cached data allows system 2024 administrators to set different disk and backup policies from other 2025 directories in /var. 2026 END RATIONALE 2027 2028 5.5.2 Specific Options 2029 2030 /var/cache -- Cache directories 2031 +-fonts Locally-generated fonts (optional) 2032 +-man Locally-formatted manual pages (optional) 2033 +-www WWW proxy or cache data (optional) 2034 +- Package specific cache data (optional) 2035 5.5.3 /var/cache/fonts : Locally-generated fonts (optional) 2036 2037 5.5.3.1 Purpose 2038 2039 The directory /var/cache/fonts should be used to store any dynamically- 2040 created fonts. In particular, all of the fonts which are automatically 2041 generated by mktexpk must be located in appropriately-named 2042 2043 2044 - 31 - 2045 2046 2047 2048 2049 2050 Filesystem Hierarchy Standard March 12, 2001 2051 2052 2053 2054 subdirectories of /var/cache/fonts.33 2055 2056 5.5.3.2 Specific Options 2057 2058 Other dynamically created fonts may also be placed in this tree, under 2059 appropriately-named subdirectories of /var/cache/fonts. 2060 2061 5.5.4 /var/cache/man : Locally-formatted manual pages (optional) 2062 2063 5.5.4.1 Purpose 2064 2065 This directory provides a standard location for sites that provide a 2066 read-only /usr partition, but wish to allow caching of locally-formatted 2067 man pages. Sites that mount /usr as writable (e.g., single-user 2068 installations) may choose not to use /var/cache/man and may write 2069 formatted man pages into the cat
directories in /usr/share/man 2070 directly. We recommend that most sites use one of the following options 2071 instead: 2072 2073 o Preformat all manual pages alongside the unformatted versions. 2074 2075 o Allow no caching of formatted man pages, and require formatting to 2076 be done each time a man page is brought up. 2077 2078 o Allow local caching of formatted man pages in /var/cache/man. 2079 2080 The structure of /var/cache/man needs to reflect both the fact of 2081 multiple man page hierarchies and the possibility of multiple language 2082 support. 2083 2084 Given an unformatted manual page that normally appears in 2085 /man//man
, the directory to place formatted man 2086 pages in is /var/cache/man///cat
, where 2087 is derived from by removing any leading usr and/or 2088 trailing share pathname components.34 (Note that the component 2089 may be missing.) 2090 2091 Man pages written to /var/cache/man may eventually be transferred to the 2092 appropriate preformatted directories in the source man hierarchy or 2093 expired; likewise formatted man pages in the source man hierarchy may be 2094 expired if they are not accessed for a period of time. 2095 2096 If preformatted manual pages come with a system on read-only media (a 2097 CD-ROM, for instance), they must be installed in the source man 2098 2099 ____________________ 2100 2101 33.This standard does not currently incorporate the TeX Directory 2102 Structure (a document that describes the layout TeX files and 2103 directories), but it may be useful reading. It is located at 2104 ftp://ctan.tug.org/tex/. 2105 2106 34.For example, /usr/share/man/man1/ls.1 is formatted into 2107 /var/cache/man/cat1/ls.1, and /usr/X11R6/man//man3/XtClass.3x 2108 into /var/cache/man/X11R6//cat3/XtClass.3x. 2109 2110 - 32 - 2111 2112 2113 2114 2115 2116 Filesystem Hierarchy Standard March 12, 2001 2117 2118 2119 2120 hierarchy (e.g. /usr/share/man/cat
). /var/cache/man is 2121 reserved as a writable cache for formatted manual pages. 2122 2123 BEGIN RATIONALE 2124 Release 1.2 of the standard specified /var/catman for this hierarchy. 2125 The path has been moved under /var/cache to better reflect the dynamic 2126 nature of the formatted man pages. The directory name has been changed 2127 to man to allow for enhancing the hierarchy to include post-processed 2128 formats other than "cat", such as PostScript, HTML, or DVI. 2129 END RATIONALE 2130 2131 5.6 /var/crash : System crash dumps (optional) 2132 2133 5.6.1 Purpose 2134 2135 This directory holds system crash dumps. As of the date of this release 2136 of the standard, system crash dumps were not supported under Linux. 2137 2138 5.7 /var/games : Variable game data (optional) 2139 2140 5.7.1 Purpose 2141 2142 Any variable data relating to games in /usr should be placed here. 2143 /var/games should hold the variable data previously found in /usr; 2144 static data, such as help text, level descriptions, and so on, must 2145 remain elsewhere, such as /usr/share/games. 2146 2147 BEGIN RATIONALE 2148 /var/games has been given a hierarchy of its own, rather than leaving it 2149 merged in with the old /var/lib as in release 1.2. The separation 2150 allows local control of backup strategies, permissions, and disk usage, 2151 as well as allowing inter-host sharing and reducing clutter in /var/lib. 2152 Additionally, /var/games is the path traditionally used by BSD. 2153 END RATIONALE 2154 2155 5.8 /var/lib : Variable state information 2156 2157 5.8.1 Purpose 2158 2159 This hierarchy holds state information pertaining to an application or 2160 the system. State information is data that programs modify while they 2161 run, and that pertains to one specific host. Users must never need to 2162 modify files in /var/lib to configure a package's operation. 2163 2164 State information is generally used to preserve the condition of an 2165 application (or a group of inter-related applications) between 2166 invocations and between different instances of the same application. 2167 State information should generally remain valid after a reboot, should 2168 not be logging output, and should not be spooled data. 2169 2170 An application (or a group of inter-related applications) must use a 2171 subdirectory of /var/lib for its data.35 There is one required 2172 subdirectory, /var/lib/misc, which is intended for state files that 2173 don't need a subdirectory; the other subdirectories should only be 2174 2175 2176 - 33 - 2177 2178 2179 2180 2181 2182 Filesystem Hierarchy Standard March 12, 2001 2183 2184 2185 2186 present if the application in question is included in the distribution. 2187 2188 /var/lib/ is the location that must be used for all distribution 2189 packaging support. Different distributions may use different names, of 2190 course. 2191 2192 5.8.2 Requirements 2193 2194 The following directories, or symbolic links to directories, are 2195 required in /var/lib: 2196 /var/lib -- Variable state information 2197 +-misc Miscellaneous state data 2198 2199 5.8.3 Specific Options 2200 2201 The following directories, or symbolic links to directories, must be in 2202 /var/lib, if the corresponding subsystem is installed: 2203 /var/lib -- Variable state information 2204 +- Editor backup files and state (optional) 2205 +- Packaging support files (optional) 2206 +- State data for packages and subsystems (optional) 2207 +-hwclock State directory for hwclock (optional) 2208 +-xdm X display manager variable data (optional) 2209 2210 5.8.4 /var/lib/ : Editor backup files and state (optional) 2211 2212 5.8.4.1 Purpose 2213 2214 These directories contain saved files generated by any unexpected 2215 termination of an editor (e.g., elvis, jove, nvi). 2216 2217 Other editors may not require a directory for crash-recovery files, but 2218 may require a well-defined place to store other information while the 2219 editor is running. This information should be stored in a subdirectory 2220 under /var/lib (for example, GNU Emacs would place lock files in 2221 /var/lib/emacs/lock). 2222 2223 Future editors may require additional state information beyond crash- 2224 recovery files and lock files -- this information should also be placed 2225 under /var/lib/. 2226 2227 BEGIN RATIONALE 2228 Previous Linux releases, as well as all commercial vendors, use 2229 /var/preserve for vi or its clones. However, each editor uses its own 2230 format for these crash-recovery files, so a separate directory is needed 2231 for each editor. 2232 2233 Editor-specific lock files are usually quite different from the device 2234 or resource lock files that are stored in /var/lock and, hence, are 2235 2236 ____________________ 2237 2238 35.An important difference between this version of this standard and 2239 previous ones is that applications are now required to use a 2240 subdirectory of /var/lib. 2241 2242 - 34 - 2243 2244 2245 2246 2247 2248 Filesystem Hierarchy Standard March 12, 2001 2249 2250 2251 2252 stored under /var/lib. 2253 END RATIONALE 2254 2255 5.8.5 /var/lib/hwclock : State directory for hwclock (optional) 2256 2257 5.8.5.1 Purpose 2258 2259 This directories contains the file /var/lib/hwclock/adjtime). 2260 2261 BEGIN RATIONALE 2262 In FHS 2.1, this file was /etc/adjtime, but as hwclock updates it, that 2263 was obviously incorrect. 2264 END RATIONALE 2265 2266 5.8.6 /var/lib/misc : Miscellaneous variable data 2267 2268 5.8.6.1 Purpose 2269 2270 This directory contains variable data not placed in a subdirectory in 2271 /var/lib. An attempt should be made to use relatively unique names in 2272 this directory to avoid namespace conflicts.36 2273 2274 5.9 /var/lock : Lock files 2275 2276 5.9.1 Purpose 2277 2278 Lock files should be stored within the /var/lock directory structure. 2279 2280 Lock files for devices and other resources shared by multiple 2281 applications, such as the serial device lock files that were originally 2282 found in either /usr/spool/locks or /usr/spool/uucp, must now be stored 2283 in /var/lock. The naming convention which must be used is "LCK.." 2284 followed by the base name of the device. For example, to lock 2285 /dev/ttyS0 the file "LCK..ttyS0" would be created. 37 2286 2287 The format used for the contents of such lock files must be the HDB UUCP 2288 lock file format. The HDB format is to store the process identifier 2289 (PID) as a ten byte ASCII decimal number, with a trailing newline. For 2290 example, if process 1230 holds a lock file, it would contain the eleven 2291 characters: space, space, space, space, space, space, one, two, three, 2292 zero, and newline. 2293 2294 5.10 /var/log : Log files and directories 2295 2296 5.10.1 Purpose 2297 2298 2299 ____________________ 2300 2301 36.This hierarchy should contain files stored in /var/db in current BSD 2302 releases. These include locate.database and mountdtab, and the 2303 kernel symbol database(s). 2304 2305 37.Then, anything wishing to use /dev/ttyS0 can read the lock file and 2306 act accordingly (all locks in /var/lock should be world-readable). 2307 2308 - 35 - 2309 2310 2311 2312 2313 2314 Filesystem Hierarchy Standard March 12, 2001 2315 2316 2317 2318 This directory contains miscellaneous log files. Most logs must be 2319 written to this directory or an appropriate subdirectory. 2320 2321 5.10.2 Specific Options 2322 2323 The following files, or symbolic links to files, must be in /var/log, if 2324 the corresponding subsystem is installed: 2325 2326 lastlog record of last login of each user 2327 messages system messages from syslogd 2328 wtmp record of all logins and logouts 2329 2330 5.11 /var/mail : User mailbox files (optional) 2331 2332 5.11.1 Purpose 2333 2334 The mail spool must be accessible through /var/mail and the mail spool 2335 files must take the form . /var/mail may be a symbolic link 2336 to another directory. 2337 2338 User mailbox files in this location must be stored in the standard UNIX 2339 mailbox format. 2340 2341 BEGIN RATIONALE 2342 The logical location for this directory was changed from /var/spool/mail 2343 in order to bring FHS in-line with nearly every UNIX implementation. 2344 This change is important for inter-operability since a single /var/mail 2345 is often shared between multiple hosts and multiple UNIX implementations 2346 (despite NFS locking issues). 2347 2348 It is important to note that there is no requirement to physically move 2349 the mail spool to this location. However, programs and header files 2350 must be changed to use /var/mail. 2351 END RATIONALE 2352 2353 5.12 /var/opt : Variable data for /opt 2354 2355 5.12.1 Purpose 2356 2357 Variable data of the packages in /opt must be installed in 2358 /var/opt/, where is the name of the subtree in /opt 2359 where the static data from an add-on software package is stored, except 2360 where superseded by another file in /etc. No structure is imposed on 2361 the internal arrangement of /var/opt/. 2362 2363 BEGIN RATIONALE 2364 Refer to the rationale for /opt. 2365 END RATIONALE 2366 2367 5.13 /var/run : Run-time variable data 2368 2369 5.13.1 Purpose 2370 2371 This directory contains system information data describing the system 2372 2373 2374 - 36 - 2375 2376 2377 2378 2379 2380 Filesystem Hierarchy Standard March 12, 2001 2381 2382 2383 2384 since it was booted. Files under this directory must be cleared 2385 (removed or truncated as appropriate) at the beginning of the boot 2386 process. Programs may have a subdirectory of /var/run; this is 2387 encouraged for programs that use more than one run-time file. 2388 2389 /var/run must be unwritable for unprivileged users (root or users 2390 running daemons). It is a major security problem if any user can write 2391 in this directory. 2392 2393 Process identifier (PID) files, which were originally placed in /etc, 2394 must be placed in /var/run. The naming convention for PID files is 2395 .pid. For example, the crond PID file is named 2396 /var/run/crond.pid. 2397 2398 5.13.2 Requirements 2399 2400 The internal format of PID files remains unchanged. The file must 2401 consist of the process identifier in ASCII-encoded decimal, followed by 2402 a newline character. For example, if crond was process number 25, 2403 /var/run/crond.pid would contain three characters: two, five, and 2404 newline. 2405 2406 Programs that read PID files should be somewhat flexible in what they 2407 accept; i.e., they should ignore extra whitespace, leading zeroes, 2408 absence of the trailing newline, or additional lines in the PID file. 2409 Programs that create PID files should use the simple specification 2410 located in the above paragraph. 2411 2412 The utmp file, which stores information about who is currently using the 2413 system, is located in this directory. 2414 2415 Programs that maintain transient UNIX-domain sockets must place them in 2416 this directory. 2417 2418 5.14 /var/spool : Application spool data 2419 2420 5.14.1 Purpose 2421 2422 /var/spool contains data which is awaiting some kind of later 2423 processing. Data in /var/spool represents work to be done in the future 2424 (by a program, user, or administrator); often data is deleted after it 2425 has been processed.38 2426 2427 5.14.2 Specific Options 2428 2429 The following directories, or symbolic links to directories, must be in 2430 /var/spool, if the corresponding subsystem is installed: 2431 2432 2433 2434 2435 ____________________ 2436 2437 38.UUCP lock files must be placed in /var/lock. See the above section 2438 on /var/lock. 2439 2440 - 37 - 2441 2442 2443 2444 2445 2446 Filesystem Hierarchy Standard March 12, 2001 2447 2448 2449 2450 /var/spool -- Spool directories 2451 +-lpd Printer spool directory (optional) 2452 +-mqueue Outgoing mail queue (optional) 2453 +-news News spool directory (optional) 2454 +-rwho Rwhod files (optional) 2455 +-uucp Spool directory for UUCP (optional) 2456 5.14.3 /var/spool/lpd : Line-printer daemon print queues (optional) 2457 2458 5.14.3.1 Purpose 2459 2460 The lock file for lpd, lpd.lock, must be placed in /var/spool/lpd. It 2461 is suggested that the lock file for each printer be placed in the spool 2462 directory for that specific printer and named lock. 2463 2464 5.14.3.2 Specific Options 2465 2466 /var/spool/lpd -- Printer spool directory 2467 +- Spools for a specific printer (optional) 2468 2469 5.14.4 /var/spool/rwho : Rwhod files (optional) 2470 2471 5.14.4.1 Purpose 2472 2473 This directory holds the rwhod information for other systems on the 2474 local net. 2475 2476 BEGIN RATIONALE 2477 Some BSD releases use /var/rwho for this data; given its historical 2478 location in /var/spool on other systems and its approximate fit to the 2479 definition of `spooled' data, this location was deemed more appropriate. 2480 END RATIONALE 2481 2482 5.15 /var/tmp : Temporary files preserved between system reboots 2483 2484 5.15.1 Purpose 2485 2486 The /var/tmp directory is made available for programs that require 2487 temporary files or directories that are preserved between system 2488 reboots. Therefore, data stored in /var/tmp is more persistent than 2489 data in /tmp. 2490 2491 Files and directories located in /var/tmp must not be deleted when the 2492 system is booted. Although data stored in /var/tmp is typically deleted 2493 in a site-specific manner, it is recommended that deletions occur at a 2494 less frequent interval than /tmp. 2495 2496 5.16 /var/yp : Network Information Service (NIS) database files 2497 (optional) 2498 2499 5.16.1 Purpose 2500 2501 Variable data for the Network Information Service (NIS), formerly known 2502 as the Sun Yellow Pages (YP), must be placed in this directory. 2503 2504 2505 2506 - 38 - 2507 2508 2509 2510 2511 2512 Filesystem Hierarchy Standard March 12, 2001 2513 2514 2515 2516 BEGIN RATIONALE 2517 /var/yp is the standard directory for NIS (YP) data and is almost 2518 exclusively used in NIS documentation and systems.39 2519 END RATIONALE 2520 2521 2522 2523 2524 2525 2526 2527 2528 2529 2530 2531 2532 2533 2534 2535 2536 2537 2538 2539 2540 2541 2542 2543 2544 2545 2546 2547 2548 2549 2550 2551 2552 2553 2554 2555 2556 2557 2558 2559 2560 2561 2562 2563 2564 2565 2566 2567 ____________________ 2568 2569 39.NIS should not be confused with Sun NIS+, which uses a different 2570 directory, /var/nis. 2571 2572 - 39 - 2573 2574 2575 2576 2577 2578 Filesystem Hierarchy Standard March 12, 2001 2579 2580 2581 2582 6. Operating System Specific Annex 2583 2584 This section is for additional requirements and recommendations that 2585 only apply to a specific operating system. The material in this section 2586 should never conflict with the base standard. 2587 2588 6.1 Linux 2589 2590 This is the annex for the Linux operating system. 2591 2592 6.1.1 / : Root directory 2593 2594 On Linux systems, if the kernel is located in /, we recommend using the 2595 names vmlinux or vmlinuz, which have been used in recent Linux kernel 2596 source packages. 2597 2598 6.1.2 /bin : Essential user command binaries (for use by all users) 2599 2600 Linux systems which require them place these additional files into /bin. 2601 2602 { setserial } 2603 2604 6.1.3 /dev : Devices and special files 2605 2606 All devices and special files in /dev should adhere to the Linux 2607 Allocated Devices document, which is available with the Linux kernel 2608 source. It is maintained by H. Peter Anvin . 2609 2610 Symbolic links in /dev should not be distributed with Linux systems 2611 except as provided in the Linux Allocated Devices document. 2612 2613 BEGIN RATIONALE 2614 The requirement not to make symlinks promiscuously is made because local 2615 setups will often differ from that on the distributor's development 2616 machine. Also, if a distribution install script configures the symbolic 2617 links at install time, these symlinks will often not get updated if 2618 local changes are made in hardware. When used responsibly at a local 2619 level, however, they can be put to good use. 2620 END RATIONALE 2621 2622 6.1.4 /etc : Host-specific system configuration 2623 2624 Linux systems which require them place these additional files into /etc. 2625 2626 { lilo.conf } 2627 2628 2629 2630 6.1.5 /proc : Kernel and process information virtual filesystem 2631 2632 The proc filesystem is the de-facto standard Linux method for handling 2633 process and system information, rather than /dev/kmem and other similar 2634 methods. We strongly encourage this for the storage and retrieval of 2635 process information as well as other kernel and memory information. 2636 2637 2638 - 40 - 2639 2640 2641 2642 2643 2644 Filesystem Hierarchy Standard March 12, 2001 2645 2646 2647 2648 6.1.6 /sbin : Essential system binaries 2649 2650 Linux systems place these additional files into /sbin. 2651 2652 o Second extended filesystem commands (optional): 2653 2654 { badblocks, dumpe2fs, e2fsck, mke2fs, mklost+found, tune2fs } 2655 2656 o Boot-loader map installer: 2657 2658 { lilo } 2659 2660 Optional files for /sbin: 2661 2662 o Static binaries: 2663 2664 { ldconfig, sln, ssync } 2665 2666 Static ln (sln) and static sync (ssync) are useful when things go 2667 wrong. The primary use of sln (to repair incorrect symlinks in 2668 /lib after a poorly orchestrated upgrade) is no longer a major 2669 concern now that the ldconfig program (usually located in 2670 /usr/sbin) exists and can act as a guiding hand in upgrading the 2671 dynamic libraries. Static sync is useful in some emergency 2672 situations. Note that these need not be statically linked versions 2673 of the standard ln and sync, but may be. 2674 2675 The ldconfig binary is optional for /sbin since a site may choose 2676 to run ldconfig at boot time, rather than only when upgrading the 2677 shared libraries. (It's not clear whether or not it is 2678 advantageous to run ldconfig on each boot.) Even so, some people 2679 like ldconfig around for the following (all too common) situation: 2680 2681 (1) I've just removed /lib/. 2682 2683 (2) I can't find out the name of the library because ls is 2684 dynamically linked, I'm using a shell that doesn't have ls 2685 built-in, and I don't know about using "echo *" as a 2686 replacement. 2687 2688 (3) I have a static sln, but I don't know what to call the 2689 link. 2690 2691 o Miscellaneous: 2692 2693 { ctrlaltdel, kbdrate } 2694 2695 So as to cope with the fact that some keyboards come up with such a 2696 high repeat rate as to be unusable, kbdrate may be installed in 2697 /sbin on some systems. 2698 2699 Since the default action in the kernel for the Ctrl-Alt-Del key 2700 combination is an instant hard reboot, it is generally advisable to 2701 disable the behavior before mounting the root filesystem in read- 2702 2703 2704 - 41 - 2705 2706 2707 2708 2709 2710 Filesystem Hierarchy Standard March 12, 2001 2711 2712 2713 2714 write mode. Some init suites are able to disable Ctrl-Alt-Del, but 2715 others may require the ctrlaltdel program, which may be installed 2716 in /sbin on those systems. 2717 2718 6.1.7 /usr/include : Header files included by C programs 2719 2720 These symbolic links are required if a C or C++ compiler is installed 2721 and only for systems not based on glibc. 2722 2723 /usr/include/asm -> /usr/src/linux/include/asm- 2724 /usr/include/linux -> /usr/src/linux/include/linux 2725 2726 6.1.8 /usr/src : Source code 2727 2728 For systems based on glibc, there are no specific guidelines for this 2729 directory. For systems based on Linux libc revisions prior to glibc, 2730 the following guidelines and rationale apply: 2731 2732 The only source code that should be placed in a specific location is the 2733 Linux kernel source code. It is located in /usr/src/linux. 2734 2735 If a C or C++ compiler is installed, but the complete Linux kernel 2736 source code is not installed, then the include files from the kernel 2737 source code must be located in these directories: 2738 2739 /usr/src/linux/include/asm- 2740 /usr/src/linux/include/linux 2741 2742 is the name of the system architecture. 2743 2744 Note: /usr/src/linux may be a symbolic link to a kernel source code 2745 tree. 2746 2747 BEGIN RATIONALE 2748 It is important that the kernel include files be located in 2749 /usr/src/linux and not in /usr/include so there are no problems when 2750 system administrators upgrade their kernel version for the first time. 2751 END RATIONALE 2752 2753 6.1.9 /var/spool/cron : cron and at jobs 2754 2755 This directory contains the variable data for the cron and at programs. 2756 2757 2758 2759 2760 2761 2762 2763 2764 2765 2766 2767 2768 2769 2770 - 42 - 2771 2772 2773 2774 2775 2776 Filesystem Hierarchy Standard March 12, 2001 2777 2778 2779 2780 7. Appendix 2781 2782 7.1 The FHS mailing list 2783 2784 The FHS mailing list is located at . To subscribe 2785 to the list send mail to with body "ADD fhs- 2786 discuss". 2787 2788 Thanks to Network Operations at the University of California at San 2789 Diego who allowed us to use their excellent mailing list server. 2790 2791 As noted in the introduction, please do not send mail to the mailing 2792 list without first contacting the FHS editor or a listed contributor. 2793 2794 7.2 Background of the FHS 2795 2796 The process of developing a standard filesystem hierarchy began in 2797 August 1993 with an effort to restructure the file and directory 2798 structure of Linux. The FSSTND, a filesystem hierarchy standard 2799 specific to the Linux operating system, was released on February 14, 2800 1994. Subsequent revisions were released on October 9, 1994 and March 2801 28, 1995. 2802 2803 In early 1995, the goal of developing a more comprehensive version of 2804 FSSTND to address not only Linux, but other UNIX-like systems was 2805 adopted with the help of members of the BSD development community. As a 2806 result, a concerted effort was made to focus on issues that were general 2807 to UNIX-like systems. In recognition of this widening of scope, the 2808 name of the standard was changed to Filesystem Hierarchy Standard or FHS 2809 for short. 2810 2811 Volunteers who have contributed extensively to this standard are listed 2812 at the end of this document. This standard represents a consensus view 2813 of those and other contributors. 2814 2815 7.3 General Guidelines 2816 2817 Here are some of the guidelines that have been used in the development 2818 of this standard: 2819 2820 o Solve technical problems while limiting transitional difficulties. 2821 2822 o Make the specification reasonably stable. 2823 2824 o Gain the approval of distributors, developers, and other decision- 2825 makers in relevant development groups and encourage their 2826 participation. 2827 2828 o Provide a standard that is attractive to the implementors of 2829 different UNIX-like systems. 2830 2831 7.4 Scope 2832 2833 This document specifies a standard filesystem hierarchy for FHS 2834 2835 2836 - 43 - 2837 2838 2839 2840 2841 2842 Filesystem Hierarchy Standard March 12, 2001 2843 2844 2845 2846 filesystems by specifying the location of files and directories, and the 2847 contents of some system files. 2848 2849 This standard has been designed to be used by system integrators, 2850 package developers, and system administrators in the construction and 2851 maintenance of FHS compliant filesystems. It is primarily intended to 2852 be a reference and is not a tutorial on how to manage a conforming 2853 filesystem hierarchy. 2854 2855 The FHS grew out of earlier work on FSSTND, a filesystem organization 2856 standard for the Linux operating system. It builds on FSSTND to address 2857 interoperability issues not just in the Linux community but in a wider 2858 arena including 4.4BSD-based operating systems. It incorporates lessons 2859 learned in the BSD world and elsewhere about multi-architecture support 2860 and the demands of heterogeneous networking. 2861 2862 Although this standard is more comprehensive than previous attempts at 2863 filesystem hierarchy standardization, periodic updates may become 2864 necessary as requirements change in relation to emerging technology. It 2865 is also possible that better solutions to the problems addressed here 2866 will be discovered so that our solutions will no longer be the best 2867 possible solutions. Supplementary drafts may be released in addition to 2868 periodic updates to this document. However, a specific goal is 2869 backwards compatibility from one release of this document to the next. 2870 2871 Comments related to this standard are welcome. Any comments or 2872 suggestions for changes may be directed to the FHS editor (Daniel 2873 Quinlan ) or the FHS mailing list. Typographical 2874 or grammatical comments should be directed to the FHS editor. 2875 2876 Before sending mail to the mailing list it is requested that you first 2877 contact the FHS editor in order to avoid excessive re-discussion of old 2878 topics. 2879 2880 Questions about how to interpret items in this document may occasionally 2881 arise. If you have need for a clarification, please contact the FHS 2882 editor. Since this standard represents a consensus of many 2883 participants, it is important to make certain that any interpretation 2884 also represents their collective opinion. For this reason it may not be 2885 possible to provide an immediate response unless the inquiry has been 2886 the subject of previous discussion. 2887 2888 7.5 Acknowledgments 2889 2890 The developers of the FHS wish to thank the developers, system 2891 administrators, and users whose input was essential to this standard. 2892 We wish to thank each of the contributors who helped to write, compile, 2893 and compose this standard. 2894 2895 The FHS Group also wishes to thank those Linux developers who supported 2896 the FSSTND, the predecessor to this standard. If they hadn't 2897 demonstrated that the FSSTND was beneficial, the FHS could never have 2898 evolved. 2899 2900 2901 2902 - 44 - 2903 2904 2905 2906 2907 2908 Filesystem Hierarchy Standard March 12, 2001 2909 2910 2911 2912 7.6 Contributors 2913 2914 Brandon S. Allbery 2915 Keith Bostic 2916 Drew Eckhardt 2917 Rik Faith 2918 Stephen Harris 2919 Ian Jackson 2920 John A. Martin 2921 Ian McCloghrie 2922 Chris Metcalf 2923 Ian Murdock 2924 David C. Niemi 2925 Daniel Quinlan 2926 Eric S. Raymond 2927 Rusty Russell 2928 Mike Sangrey 2929 David H. Silber 2930 Theodore Ts'o 2931 Stephen Tweedie 2932 Fred N. van Kempen 2933 Bernd Warken 2934 2935 2936 2937 2938 2939 2940 2941 2942 2943 2944 2945 2946 2947 2948 2949 2950 2951 2952 2953 2954 2955 2956 2957 2958 2959 2960 2961 2962 2963 2964 2965 2966 2967 2968 - 45 - 2969 2970 2971 2972 2973 2974 2975 2976 2977 2978 CONTENTS 2979 2980 2981 2982 1. Introduction ..................................................... 2 2983 1.1 Purpose .................................................... 2 2984 1.2 Conventions ................................................ 2 2985 2986 2. The Filesystem ................................................... 3 2987 2988 3. The Root Filesystem .............................................. 5 2989 3.1 Purpose .................................................... 5 2990 3.2 Requirements ............................................... 6 2991 3.3 Specific Options ........................................... 6 2992 3.4 /bin : Essential user command binaries (for use by all 2993 users) ..................................................... 6 2994 3.5 /boot : Static files of the boot loader .................... 8 2995 3.6 /dev : Device files ........................................ 9 2996 3.7 /etc : Host-specific system configuration .................. 9 2997 3.8 /home : User home directories (optional) .................. 12 2998 3.9 /lib : Essential shared libraries and kernel modules ...... 12 2999 3.10 /lib : Alternate format essential shared libraries 3000 (optional) ................................................ 13 3001 3.11 /media : Mount points for removable media (optional) ...... 13 3002 3.12 /mnt : Mount point for a temporarily mounted filesystem ... 14 3003 3.13 /opt : Add-on application software packages ............... 14 3004 3.14 /root : Home directory for the root user (optional) ....... 15 3005 3.15 /sbin : System binaries ................................... 15 3006 3.16 /tmp : Temporary files .................................... 17 3007 3008 4. The /usr Hierarchy .............................................. 18 3009 4.1 Purpose ................................................... 18 3010 4.2 Requirements .............................................. 18 3011 4.3 Specific Options .......................................... 18 3012 4.4 /usr/X11R6 : X Window System, Version 11 Release 6 3013 (optional) ................................................ 18 3014 4.5 /usr/bin : Most user commands ............................. 19 3015 4.6 /usr/include : Directory for standard include files. ...... 20 3016 4.7 /usr/lib : Libraries for programming and packages ......... 20 3017 4.8 /usr/lib : Alternate format libraries (optional) .... 20 3018 4.9 /usr/local : Local hierarchy .............................. 21 3019 4.10 /usr/sbin : Non-essential standard system binaries ........ 22 3020 4.11 /usr/share : Architecture-independent data ................ 22 3021 4.12 /usr/src : Source code (optional) ......................... 28 3022 3023 5. The /var Hierarchy .............................................. 29 3024 5.1 Purpose ................................................... 29 3025 5.2 Requirements .............................................. 29 3026 5.3 Specific Options .......................................... 29 3027 5.4 /var/account : Process accounting logs (optional) ......... 30 3028 5.5 /var/cache : Application cache data ....................... 30 3029 5.6 /var/crash : System crash dumps (optional) ................ 32 3030 5.7 /var/games : Variable game data (optional) ................ 32 3031 3032 3033 3034 i 3035 3036 3037 3038 3039 3040 3041 3042 3043 3044 5.8 /var/lib : Variable state information ..................... 32 3045 5.9 /var/lock : Lock files .................................... 34 3046 5.10 /var/log : Log files and directories ...................... 34 3047 5.11 /var/mail : User mailbox files (optional) ................. 35 3048 5.12 /var/opt : Variable data for /opt ......................... 35 3049 5.13 /var/run : Run-time variable data ......................... 35 3050 5.14 /var/spool : Application spool data ....................... 36 3051 5.15 /var/tmp : Temporary files preserved between system 3052 reboots ................................................... 37 3053 5.16 /var/yp : Network Information Service (NIS) database files 3054 (optional) ................................................ 37 3055 3056 6. Operating System Specific Annex ................................. 39 3057 6.1 Linux ..................................................... 39 3058 3059 7. Appendix ........................................................ 42 3060 7.1 The FHS mailing list ...................................... 42 3061 7.2 Background of the FHS ..................................... 42 3062 7.3 General Guidelines ........................................ 42 3063 7.4 Scope ..................................................... 42 3064 7.5 Acknowledgments ........................................... 43 3065 7.6 Contributors .............................................. 44 3066 3067 3068 3069 3070 3071 3072 3073 3074 3075 3076 3077 3078 3079 3080 3081 3082 3083 3084 3085 3086 3087 3088 3089 3090 3091 3092 3093 3094 3095 3096 3097 3098 3099 3100 ii 3101 3102