Introduction
This is a how-to on how to add storage devices to /etc/fstab and have them mount on boot.
Procedure
You can create a new entry in fstab by following the steps below.
1. Create the directory for the partition and get the device id. If you already have a directory you would like to use as a mount point, you can skip this step.
The dirtectory can be created via:
mkdir /your/directory/here
Replace the directory destination with the directory you would like to make your device's mount point.
2. Add the fstab entry:
-
- Enter
blkid
and look for the device. The output could be:/dev/sda2: UUID="32a4b76f-246e-486e-8495-31b8a781fb4c" TYPE="swap" /dev/sda1: UUID="31f39d50-16fa-4248-b396-0cba7cd6eff2" TYPE="ext4"
- Then open /etc/fstab in the editor of your choice and append the line:
UUID=31f39d50-16fa-4248-b396-0cba7cd6eff2 /your/directory/here auto rw,user,auto 0 0
Be sure to add a newline after the entry to avoid any warnings.
- Enter
To mount the partition, open a terminal and type:
mount /your/directory/hereBecause of the entry
auto
the device should be mounted automatically on next boot.
Comments
0 comments
Article is closed for comments.