Mounting disks via UUID is the most reliable method for Linux. This guide demonstrates how to pull disk information directly into /etc/fstab using Vim to minimize typing errors.
sudo vim /etc/fstab
Instead of switching terminals, pull the blkid data directly into your current buffer:
:r !blkid /dev/sdb
Example output inserted into text:
/dev/sdb: UUID="a1b2c3d4-e5f6-7890-abcd-1234567890ef" TYPE="ext4" ...
An fstab entry must follow this specific 6-field structure:
| Field | Description | Example |
|---|---|---|
| UUID | Unique ID (Remove quotes and prefix) | UUID=a1b2c3d4... |
| Mount Point | Target directory | /data |
| Type | Filesystem type | ext4 |
| Options | Mount parameters | defaults |
| Dump | Backup trigger | 0 |
| Pass | Filesystem check order | 2 |
UUID=a1b2c3d4-e5f6-7890-abcd-1234567890ef /data ext4 defaults 0 2
Press Esc, then type :wq to save changes.
Never reboot without testing. An error in fstab can cause a boot failure (Emergency Mode).
sudo mount -a
Interpreting Results: