Managing Linux Storage Devices
Device Files in /dev
In Linux, storage drives are represented as files within the /dev directory. For example, the first drive is typically /dev/sda, and its first partition is /dev/sda1.
Persistent Naming in /dev/disk
The /dev/disk directory provides more persistent ways to identify disks and partitions, using symbolic links that point to the correct device files. These include:
- by-label : Uses user-specified names for identification.
- by-uuid : Utilizes universally unique identifiers.
- by-partlabel and by-partuuid : For GPT-specific labels and UUIDs.
- by-id : Based on hardware serial numbers.
- by-path : Depends on the device's connection to the system.
For persistent identification, by-label or by-uuid are often the best choices.
Mounting Block Devices
To use a filesystem, it must be mounted, or attached, to the existing directory tree of the Linux system. This is done by linking a formatted partition or drive to a directory, after which the drive's contents become accessible from that location.
Recommended Mount Points
- Temporary filesystems: Use
/mntor its subdirectories. - Permanent storage: No standard recommendation, but
/mntor its subdirectories are commonly used.
Making Mounts Permanent with /etc/fstab
The /etc/fstab file is used to define filesystems that should be automatically mounted at boot. Each line in this file specifies a different filesystem, its mount point, format, and mount options.
No comments yet. Add the first comment to start the discussion.