- Manually mount and unmount filesystems
- Configure automatic mounts at boot using
/etc/fstab - Enable swap partitions at startup
- Use UUIDs for stable device identification
1. Manual Mounting and Unmounting
1.1 Verify an Empty Mount Point
A common temporary mount directory is/mnt. Confirm it’s empty:
1.2 Mount an XFS Filesystem
Assuming you created an XFS filesystem on/dev/vdb1, mount it to /mnt:
/mnt is the root of that filesystem. Create a test file and verify:
lsblk to confirm the mount point:
1.3 Unmount the Filesystem
To detach the filesystem:2. Automatic Mounting at Boot with /etc/fstab
The /etc/fstab file defines filesystems to mount automatically during system startup.
2.1 Create the Mount Point
2.2 Understand /etc/fstab Fields
| Field | Description | Example |
|---|---|---|
| Device | Block device path or UUID | /dev/vdb1 or UUID=... |
| Mount point | Directory to attach the filesystem | /mybackups |
| Filesystem type | xfs, ext4, swap, etc. | xfs, swap |
| Options | Mount options, e.g., defaults, rw, noexec | defaults |
| Dump | 0 = disable, 1 = enable (for dump utility) | 0 |
| Pass (fsck order) | 0 = skip, 1 = root, 2 = other filesystems | 2 |
2.3 Add an XFS Entry
Open/etc/fstab in your editor:
If you don’t plan to reboot immediately, apply the new mounts with:
2.4 Verify and Reboot
Confirm/mybackups is not yet mounted:
3. Enabling Swap at Boot
If you created a swap partition on/dev/vdb3, add it to /etc/fstab so it’s activated at startup.
3.1 Add Swap Entry
Edit/etc/fstab and append:
none, and 0 0 disables dump and fsck.