Differences
This shows you the differences between two versions of the page.
linux_wiki:file_system_hierarchy [2016/03/18 23:06] billdozor [File System Hierarchy] |
linux_wiki:file_system_hierarchy [2019/05/25 23:50] |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== File System Hierarchy ====== | ||
- | **General Information** | ||
- | |||
- | Some of the most common top level directories in the Linux file system. | ||
- | |||
- | **Checklist** | ||
- | * Distro(s): Any | ||
- | |||
- | **Sources** | ||
- | * man hier | ||
- | * Linux Foundation: http:// | ||
- | |||
- | ---- | ||
- | |||
- | ====== Top Level Directories ====== | ||
- | |||
- | EL7 = Enterprise Linux 7 (Red Hat, CentOS, Scientific) | ||
- | |||
- | ^ Directory | ||
- | | / | Root directory; file system tree starts here | | ||
- | | /bin | Executable programs needed to repair system; essential during boot; \\ EL7 symlinks /bin -> /usr/bin | | ||
- | | /boot | All files needed to boot the Linux kernel | | ||
- | | /dev | Special/ | ||
- | | /etc | " | ||
- | | /home | User local home directories | | ||
- | | /lib and / | ||
- | | /media and /mnt | Mount points for removable media and temporary file systems respectively | ||
- | | /opt | Add on or optional packages | | ||
- | | /proc | Pseudo-filesystem that provides information on running processes and the kernel | | ||
- | | /root | Home directory for the root user | | ||
- | | /run | Process/ | ||
- | | /sbin | Similar to /bin, except for system administration not used by regular users; \\ EL7 symlinks /sbin -> /usr/sbin | | ||
- | | /srv | Directory to use for data used by services (such as NFS, FTP, HTTP) | | ||
- | | /sys | To interface with hardware devices managed by the kernel | | ||
- | | /tmp | Temporary files that could be deleted without warning during boot | | ||
- | | /usr | Directory containing sub directories with program files, libraries, and documentation. Typically mimics the contents of /. Not required during boot. | | ||
- | | /var | Files that can change dynamically (log files, mail, and spool files) | | ||
- | |||
- | ---- | ||
- | |||
- | ====== Common Directories with Own Partition ====== | ||
- | |||
- | It is common to mount the following directories onto their own partition: | ||
- | |||
- | ^ Directory | ||
- | | / | isolate the core OS away from the rest of the system | | ||
- | | /boot | isolate kernel boot images, cannot be LVM | | ||
- | | /home | isolate user data from the rest of the system; usually to allocate more storage space and preserve user data during upgrades | | ||
- | | /tmp | isolate world writeable /tmp to give more secure mount options | | ||
- | | /var | isolate other variable data that could grow from affecting the rest of the system. (yum cache, common place for applications to write to) | | ||
- | | / | ||
- | |||
- | ---- | ||
- | |||
- | ====== View Mounts ====== | ||
- | |||
- | Different ways to see file system mounts. | ||
- | |||
- | ---- | ||
- | |||
- | ===== Find Mounts ===== | ||
- | |||
- | The " | ||
- | |||
- | <code bash> | ||
- | [root@srv01 ~]# findmnt | ||
- | TARGET | ||
- | / / | ||
- | ├─/ | ||
- | │ └─/ | ||
- | ├─/ | ||
- | │ ├─/ | ||
- | │ ├─/ | ||
- | │ │ ├─/ | ||
- | │ │ ├─/ | ||
- | │ │ ├─/ | ||
- | │ │ ├─/ | ||
- | │ │ ├─/ | ||
- | │ │ ├─/ | ||
- | │ │ ├─/ | ||
- | │ │ ├─/ | ||
- | │ │ ├─/ | ||
- | │ │ └─/ | ||
- | │ ├─/ | ||
- | │ ├─/ | ||
- | │ └─/ | ||
- | ├─/ | ||
- | │ ├─/ | ||
- | │ ├─/ | ||
- | │ ├─/ | ||
- | │ └─/ | ||
- | ├─/ | ||
- | ├─/ | ||
- | ├─/ | ||
- | ├─/ | ||
- | ├─/ | ||
- | ├─/ | ||
- | └─/ | ||
- | </ | ||
- | |||
- | ---- | ||
- | |||
- | ===== Mount ===== | ||
- | |||
- | The " | ||
- | |||
- | <code bash> | ||
- | [root@srv01 ~]# mount -t xfs,ext4 | ||
- | / | ||
- | / | ||
- | / | ||
- | / | ||
- | / | ||
- | / | ||
- | /dev/sda1 on /boot type xfs (rw, | ||
- | </ | ||
- | |||
- | ---- | ||
- | |||
- | ===== df ===== | ||
- | |||
- | " | ||
- | <code bash> | ||
- | [root@srv01 ~]# df -hT | ||
- | Filesystem | ||
- | / | ||
- | devtmpfs | ||
- | tmpfs | ||
- | tmpfs | ||
- | tmpfs | ||
- | / | ||
- | / | ||
- | / | ||
- | / | ||
- | / | ||
- | / | ||
- | </ |