Disk Mounting Guide¶
Persistent local and network mounts using
/etc/fstaband, where present, systemd mount generation.
The filesystem must already exist and the device identity, ownership, backup, filesystem and init-system versions must be verified.
Prerequisites¶
- Root/sudo access
- Target disk identified (
/dev/sdX) - Filesystem already created on the disk
Workflow¶
flowchart LR
A[Identify Disk] --> B[Get UUID]
B --> C[Create Mount Point]
C --> D[Edit fstab]
D --> E[Test Mount]
E --> F[Reboot Verify]
Step-by-Step Guide¶
1. Identify Available Disks¶
# List all block devices
sudo lsblk
# Show detailed disk information
sudo fdisk -l
# Show disk partitions with filesystem types
lsblk -f
2. Get Disk UUID¶
# Get UUID for specific disk
sudo blkid /dev/sdX1
# Example output:
# /dev/sdb1: UUID="a1b2c3d4-5678-90ab-cdef-1234567890ab" TYPE="ext4"
3. Create Mount Point¶
# Create directory for mounting
sudo mkdir -p /mnt/data
# Or use descriptive name
sudo mkdir -p /mnt/storage
4. Configure Permanent Mount¶
Edit /etc/fstab:
Add entry:
# Format: UUID=<uuid> <mount-point> <type> <options> <dump> <pass>
UUID=a1b2c3d4-5678-90ab-cdef-1234567890ab /mnt/data ext4 defaults 0 2
Back up /etc/fstab and edit the intended entry deliberately. Blind tee -a use can create duplicate mount points or conflicting UUID entries.
5. Test the Configuration¶
# Test fstab without reboot
sudo mount -a
# Verify mount
df -h | grep /mnt/data
# Check mount details
mount | grep /mnt/data
Mount Options Reference¶
| Option | Description |
|---|---|
defaults |
rw, suid, dev, exec, auto, nouser, async |
noatime |
Don't update access time (performance) |
nofail |
Don't fail boot if device missing |
ro |
Read-only |
rw |
Read-write |
user |
Allow non-root users to mount |
x-systemd.automount |
Mount on first access |
Common Configurations¶
SSD/NVMe (performance):
Network share (NFS):
External drive (optional):
Troubleshooting¶
Mount Failed After Reboot¶
Permission Issues¶
# Inspect before changing ownership
namei -l /mnt/data
findmnt --target /mnt/data
# Change only the mount root when policy requires it
sudo chown "$USER:$USER" /mnt/data
Completion and rollback evidence¶
Run findmnt --verify, mount only the target, and confirm source/type/options plus service-account read/write behavior. Network mounts also require server-loss and recovery tests. If validation fails, unmount safely, restore the backed-up fstab, and verify again. A bad boot entry must be corrected in rescue mode, not by formatting the device.