محاضرة 9
FHS & LVM Summary
شرح هيكلية الملفات (FHS) وإدارة الأقراص المرنة (LVM).
يلا نشوف الملخص
Summary of Lecture 9: FHS & LVM in Linux
1. File system Hierarchy Standard (FHS)
The Linux filesystem is organized in a hierarchical tree structure starting from the root directory /. It dictates how files are stored, organized, and accessed.
Essential Directories and Their Functions:
/bin(Binaries): Contains executable files needed to run the system in single-user mode, such ascp,rm, and shells likebash./sbin(System Binaries): Holds essential system management commands used by administrators, such asfdisk,ifconfig, andshutdown./etc: Stores text-based configuration files for the system and running services./home: The personal directory for regular users to store their data (Desktop, Downloads, etc.)./root: The home directory specifically for the system administrator (Root user)./lib: Contains code libraries used by programs in/binand/sbin, as well as kernel modules./dev(Devices): Contains special files that allow the kernel to interact with hardware (e.g.,sdafor disks)./boot: Holds bootloader files required to start the Linux kernel./var(Variables): Stores data that changes in size over time, such as log files, mailboxes, and print spools./usr: Contains the majority of user applications and programs./proc: A virtual (volatile) directory containing process information and kernel statistics./sys: A volatile directory containing information about system hardware, stored in RAM./tmp: Stores temporary files created by users or the system./media&/mnt: Used for mounting external devices like USB drives or CD-ROMs./opt: Used for installing optional or add-on software packages.
2. Logical Volume Management (LVM)
LVM is a flexible method for managing disk space that allows combining multiple physical disks into a single unit.
Components of LVM:
- Physical Storage: The actual disk partitions or full hard drives.
- Physical Volumes (PV): Initialized physical disks (e.g.,
sda,sdb) used by LVM. - Volume Group (VG): A storage pool created by combining one or more PVs.
- Logical Volumes (LV): Virtual partitions created from a VG that can be formatted and mounted like a standard disk.
Steps to Create LVM:
- Prepare Partitions: Use
fdiskorgdiskto create partitions and set the type to "Linux LVM". - Create PV: Use
pvcreateto label the partitions as Physical Volumes. - Create VG: Use
vgcreateto combine the PVs into a named Volume Group. - Create LV: Use
lvcreateto define the size and name of the Logical Volume from the VG. - Format: Use
mkfsto create a filesystem (e.g., ext4, xfs) on the new LV. - Mount: Create a mount point and mount the filesystem to use it.
Note: To delete LVM components, use lvremove, vgremove, and pvremove in that order.
في نقطة مش واضحة؟ بطبط موجود!
اسأل بطبط عنها