Ch 3 Essential File Mgmt Tools Flashcards
(138 cards)
What is the layout of the Linux file system defined by?
The FHS - Filesystem Hierarchy Standard
Where can you find documentation for the FHS?
man 7 file-hierarchy
Name the most significant directories to know for the FHS
“bdrm shoves trump” or “dumb mothers rsvp”
/
/b - boot
/r - root
/o - opt
/s - sys
/e - etc
/m - mnt
/s - srv
/m - media
/r - run
/p - proc
/h - home
/d - dev
/t - tmp
/u - usr
/v - var
What is the / directory?
root directory, where the file system tree starts
What is the /boot directory?
it contains all files and directories needed to boot the Linux kernel
What is the /dev directory?
it contains device files that are used for accessing physical devices. This is essential during boot (need to see the hard drive, /dev/sda!)
What is the /etc directory for?
it contains confgiuration files that are used by programs and services on your server. essential during boot
What is the /home directory for?
user for local user home directories, e.g. /home/elise, home/leelemur
What is the /media or /mnt directory for?
cntain directories that are used for mounting devices in the file system tree (like a CD player)
What is the /opt directory for?
Used for optional packages that may be installe don your server
What is the /proc directory for?
used by the proc file system. This is a file system structure that gives access to kernel informaiton
What is the /root directory for?
specifies the home directory of the root user
What is the /run directory for?
Contains process and user-specific information that has been created since the last boot
What is the /srv directory for?
May be used for data by services like NFS, FTP, and HTTP
What is the /sys directory for?
Virtual Filesystem:
The /sys directory is part of the sysfs virtual filesystem, which is managed by the kernel.
Device Information:
It contains information about devices, including their drivers, configuration, and status.
Kernel Subsystem Access:
/sys provides access to various kernel subsystems, allowing users to read and potentially modify their configuration.
Not a Replacement for /dev:
While /sys provides device information, it’s not meant to be a replacement for the /dev directory, which provides access to devices through device nodes.
Forensic Tool:
The /sys directory can be valuable for forensic investigations, offering insights into kernel operations and hardware configurations, according to Medium.
What is the /tmp directory for?
Purpose:
/tmp provides a location for programs to store temporary files, such as intermediate results, cached data, or files created during the execution of a process.
Temporary Nature:
Files in /tmp are not intended to be preserved across reboots, so they are typically cleared during system startup.
Memory-Based Storage:
Many Linux systems mount /tmp as a tmpfs, which means files are stored in RAM, making access very fast but also ensuring they are lost on reboot.
Common Use Cases:
Programs may use /tmp to store data while they are running, then delete it when the program is finished. For example, an application might use /tmp to store temporary files during a long operation, such as an image processing task.
Difference from /var/tmp:
While both /tmp and /var/tmp are used for temporary storage, /var/tmp is often backed by physical storage and is more likely to retain files across reboots, making it suitable for data that should be preserved through a system restart.
What is the /usr directory for?
History:
Originally, /usr was intended to hold user home directories, but it evolved to its current role.
Purpose:
It’s designed to store files not required for the system’s fundamental functionality, often used for applications installed by users or the system administrator.
Structure:
/usr contains several subdirectories, each with a specific purpose:
/usr/bin: Contains executable user programs.
/usr/lib: Holds shared libraries.
/usr/share: Stores shared data, like documentation and fonts.
/usr/include: Contains header files for compiling software.
Relationship to other directories:
While /bin and /sbin contain basic system binaries, /usr/bin, /usr/sbin, and /usr/local/bin hold additional user and system-specific executables, respectively.
What is the /var directory for?
Contains files that may change in size dynamically, such as log files, mail boxes, and spool files (aaaah so var maybe like “variable size”)
What is a mount?
a mount is a connection between a device and a directory
The linux filesystem hierarchy, starting at the /, may be distributed across many different devices and even many different computer systems….how?
These devices are mounted into the root directory
What is involved in the mounting process?
a device connects to a specific directory. Once this has happened (it has been mounted), the device’s contents are accessible
Linux lets you use multiple mounts (and therefore potentially different filesystems) on a filesystem. What’s a drawback of all files being on just one filesystem?
1) high activity in one area may fill the entire filesystem, which hurts the processes running
2) if all files are on the same devices, its harder to secure and determine security of different areas of the file system. When you mount a separate file system, you can add mount options that can add extra security
3) it’s harder to add addnl storage space if a file system is already filled
How does linux avoid the pitfalls of everything being on one filesystem?
organize the filesystem into
1. diff devices
2. diff shares on other computers
3. logical volumes
4. disk partitions
What directories are commonly mounted on dedicated devices?
/boot, /boot/EFI, /var, /home, /usr