1

Similar to a previous question, however that question seems to have gone cold.

I'm running a Ubuntu 19.04 server, with plex and samba installed. Currently what happens on a reboot, is my external hard drive is not listed by fdisk -l. I unplug and re-plug the drive in.

This also has the added affect of the device name changing.

  • e.g. started as /dev/sdf2
  • presently showing as /dev/sda2

Is there a way of having the drive still be detected on start up and keep the mapping persistent over reboots? Just as it is a little annoying having to reconnect the drive, and re-map it manually.

The drive is formatted as NTFS (my main PC is a Windows 10 PC, and the one that I access most stuff from)

Current commands used to mount the drive are:

sudo mount -t ntfs -o nls=utf8,umask=0222 /dev/sda2 /media/storage

Where /dev/sda changes when the drive is re-connected.

  • For the mapping: reference it by its UUID instead of the device node. See man mount and look for the -U, -uuid switch. – danzel Apr 28 at 9:59
0

Use blkid to find the UUID of your device.

sudo blkid | grep ntfs

Then change your mount command into something like this:

sudo mount -t ntfs -o nls=utf8,umask=0222 -U 123e4567-e89b-12d3-a456-426655440000 /media/storage

just replace the 123e4567-e89b-12d3-a456-426655440000 part with your device's UUID.

Also, consider saving it to fstab instead of using mount command directly.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.