I'm running a vanilla install of Ubuntu 16.04. There's a USB drive that I want to access through Plex but it's not available to Plex (the media server is unable to access files) until I have manually navigated to the drive in Nautilus. I think the act of navigating to it is what triggers the automount.
In addition to Plex problems I am unable to cd
into or ls
the directory from terminal until it has been opened in Nautilus. I am told "Permission Denied".
How can I have the drive automounted and available after startup with no manual intervention in Nautilus?
I run Plex server at home, and the only way that I was able to solve this with USB hard drives was to manually add them to the /etc/fstab
file so they would come up on the same mount after every reboot.
First, get the UUID of the partition of the drive:
blkid
Mine that we are going to use is a Seagate external drive.
~$ blkid
/dev/sda1: LABEL="Seagate Backup Plus Drive" UUID="6AAA4323AA42EB61" TYPE="ntfs"
Or you can use lsblk
:
:~$ lsblk -o NAME,LABEL,TYPE,UUID
NAME LABEL TYPE UUID
sda disk
└─sda1 Seagate Backup Plus Drive part 6AAA4323AA42EB61
We can see the UUID
there of 6AAA4323AA42EB61
. Now, we create a mount point where we are going to have that drive mount every time:
sudo mkdir -p /media/Seagate
We will now add the information to the /etc/fstab
file so that every time we boot the computer it will mount that drive in the same location. We will add a nofail
option so that if the drive is disconnected or not powered on the boot process will still complete.
First, backup your /etc/fstab
file in case something goes wrong.
sudo cp /etc/fstab /etc/fstab.orig
Then use your favorite editor with sudo access and add the following line to /etc/fstab
. Or I will put a line below it that will allow you to add it via an echo line:
UUID=6AAA4323AA42EB61 /media/Seagate ntfs defaults,nofail 0 0
That line can be added via echo
like so:
sudo bash -c 'echo "UUID=6AAA4323AA42EB61 /media/Seagate ntfs defaults,nofail 0 0" >> /etc/fstab'
You can then run sudo mount -a
to mount the drive in that location now, or you can reboot the host and it should come up in the same location every time now.
Hope this helps!
No comments:
Post a Comment