Digital Marketing

How to auto mount a drive after a reboot on #Linux

To ensure that the drive is remounted after a reboot, it must be added to the /etc/fstab file. 

To do so, get the UUID of the disk with the blkid utility.

sudo -i blkid

The output displays the UUID of the drive, /dev/sdc1 in this case.

/dev/sdc1: UUID="88888888-3b3b-3c3c-3d3d-3e3e3e3e3e3e" TYPE="xfs"

Improperly editing the /etc/fstab file could result in an unbootable system. If unsure, refer to the distribution's documentation for information on how to properly edit this file. It is also recommended that a backup of the /etc/fstab file is created before editing.
Before you reboot your system, run
sudo mount -a to make sure your /etc/fstab file are OK without problem.

Open the /etc/fstab file in a text editor as follows:

sudo nano /etc/fstab
Add a line similar to the following to the /etc/fstab file, replacing the UUID value with your own.

UUID=88888888-3b3b-3c3c-3d3d-3e3e3e3e3e3e   /datadrive  xfs    defaults,nofail   1  2


Popular posts from this blog

Fixed WSL sshd: no hostkeys available -- exiting

PowerMTA pmta command

How to fix: mv: failed to preserve ownership