LPIC 102.1 Design hard disk layout

Weight: 2

Description: Candidates should be able to design a disk partitioning scheme for a Linux system.

Key Knowledge Areas:

  • Allocate filesystems and swap space to separate partitions or disks
  • Tailor the design to the intended use of the system
  • Ensure the /boot partition conforms to the hardware architecture requirements for booting
  • Knowledge of basic features of LVM

Terms and Utilities:

  • / (root) filesystem
  • /var filesystem
  • /home filesystem
  • /boot filesystem
  • swap space
  • mount points
  • partitions

Partitions and Devices

The operating system uses the filesystem to map files to the actual blocks on disk and manage directories and permissions.

Partitioning allows you to limit the scope of disk problems and to tune according to the intended use.

For example, you may not want to track the last time a file was looked at on system binaries and database files but track the time on users’ files. Breaking out user files onto its own partition means you can use a different set of options for user files than you use for system binaries.

When deciding how to lay out your disks, a useful acronym to remember for real-world needs is PIBS:

  • Performance increases if the system’s heavy usage directory trees are put on another disk. Such as mount DB folder to a separate dick.
  • Integrity improves by having critical files in their own partition. Separate FTP folder from the traditional root of the system is a good idea.
  • Backup a partition with dump or dd tool is more efficient than using tar.
  • Security can be enhanced by using mount options to disallow direct execution of any binaries on the mounted filesystem or make all files on that partition read-only.

Logical Volume Manager (LVM)

Features

  • It is flexible to expand the space at any time.
  • Any file systems can be installed and handle.
  • Migration can be used to recover faulty disk.
  • Restore the file system using Snapshot features to earlier stage. etc…

Structure
LVM Structure

More about LVM

Commonly Used Mounts

FolderReason
/homeshould be NFS, share between servers
/var or /var/loggrow over time
/var/lib/mysqlDB folder, for dedicated I/O
/tmpgrow often, consider use high performance disk
/usr3rd application folder, may share across multiple servers