RH003::LINUX ESSENTIALS CHAPTER: 2 Linux Filesystem Hierarchy and Structure: Everything in Linux can be reduced to a file. Partitions are associated with file system device nodes such as /dev/hda1. Hardware components are associated with node files such as /dev/dvd. Detected devices are documented as files in the /proc directory. The File system Hierarchy Standard (FHS) is the official way to organize files in Unix and Linux directories. Linux Filesystems and Directories Several major directories are associated with all modern Unix/Linux operating systems. These directories organize user files, drivers, kernels, logs, programs, utilities, and more into different categories. The standardization of the FHS makes it easier for users of other Unix-based operating systems to understand the basics of Linux. / ROOT DIRECTORY var RY usr lib bin media dev boot home etc mnt sbin proc /root opt net tmp Basic File system Hierarchy Standard Directories Directory Description / The root directory, the top-level directory in the FHS. All other directories are subdirectories of root, which is always mounted on some partition. Essential command line utilities. Should not be mounted separately; otherwise, it could be difficult to get to these utilities when using a rescue disk. Includes Linux startup files, including the Linux kernel. The default, 100MB, is usually sufficient for a typical modular kernel and additional kernels that you might install during the RHCE or RHCT exam. Hardware and software device drivers for everything from floppy drives to terminals. Do not mount this directory on a separate partition. Most basic configuration files. Home directories for almost every user. Program libraries for the kernel and various command line utilities. Do not mount this directory on a separate partition. The mount point for removable media, including floppy drives, DVDs, and Zip disks. The standard mount point for local directories mounted via the automounter. A legacy mount point; formerly used for removable media. The standard mount point for network directories mounted via the automounter. Common location for third-party application files. Currently running kernel-related processes, including device assignments such as IRQ ports, I/O addresses, and DMA channels, as well as kernel configuration settings such as IP forwarding. The home directory of the root user. Temporary files. By default, Red Hat Enterprise Linux deletes all files in this directory periodically. Small programs accessible to all users. Includes many system administration commands and utilities. Variable data, including log files and printer spools. /bin /boot /dev /etc /home /lib /media /misc /mnt /net /opt /proc /root /tmp /usr /var A Variety of Media Devices: Several basic types of media are accessible to most PCs, including PATA, SATA, and SCSI hard disks; floppy drives; DVD/CD drives; and more. Other media are accessible through other PC ports, including serial, parallel, USB, and IEEE 1394 systems. You can use Linux to manage all of these types of media. Media Device Floppy drive Media Devices Device File First floppy (Microsoft A: drive) = /dev/fd0 Second floppy (Microsoft B: drive) = /dev/fd1 PATA (IDE) hard drive PATA (IDE) CD/DVD drive First drive = /dev/hda Second drive = /dev/hdb Third drive = /dev/hdc Fourth drive = /dev/hdd SATA or SCSI hard drive SATA or SCSI CD/DVD drive First drive = /dev/sda Second drive = /dev/sdb … Twenty-seventh drive = /dev/sdaa and so on Parallel port drives First drive = /dev/pd1 First tape drive: /dev/pt1 USB drives IEEE 1394 drives Varies widely IEEE 1394 (a.k.a. FireWire, iLink) is actually a SCSI standard, so these are controlled in Linux as SCSI devices.