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?
12 Answers
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:
blkidMine 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 6AAA4323AA42EB61We 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/SeagateWe 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.origThen 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 0That 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!
7Basic CLI steps lsblk -> /etc/fstab
The basic steps are to list your block devices:
$ lsblk -o NAME,TYPE,LABEL,UUID
NAME TYPE LABEL UUID
sda disk
├─sda1 part System Reserved FAC07A55C07A1859
├─sda2 part KSX_Win7 2EBA8445BA840B91
├─sda3 part KSX Win 8.1 8C3ADAA93ADA8F96
└─sda4 part
sdb disk
├─sdb1 part ST9_Win7 C2F48A08F489FF43
├─sdb2 part ST9_Linux bf80a37d-dfad-4df1-b8b1-a67ef2a9ab66
└─sdb3 part f7ca38bd-ccf1-4d61-b54b-017b1493d1b4
sdc disk
├─sdc2 part F9m_Win7 5824BF4E76D68BE2
├─sdc3 part F9m_Linux d02dc21d-dcb2-478e-9f7d-9a3331931de4
└─sdc4 part 09606fe6-c131-43fc-9ebc-be05a96e1c1d
sdd disk
├─sdd1 part WHITEBLACK 080F-96E9
└─sdd2 part
sr0 rom Ubuntu 14.04.3 LTS amd64 2015-08-05-05-38-20-00Then add the drive you want auto-mounted to /etc/fstab:
$ cat /etc/fstab
# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point> <type> <options> <dump> <pass>
# / was on /dev/sda3 during installation
UUID=d02dc21d-dcb2-478e-9f7d-9a3331931de4 / ext4 errors=remount-ro 0 1
# swap was on /dev/sda4 during installation
UUID=09606fe6-c131-43fc-9ebc-be05a96e1c1d none swap sw 0 0Basic GUI steps
The easiest way of auto-mounting drives is using Disks utility accessed from Dash (first option on launcher):
Click on a drive, click on a partition and then click on the nearly invisible gears icon below it after the "play" and + icons. Then select Edit Mount Options... from the drop-down menu:
Here you can hide the partition in Nautilus, prevent auto-mounting or allow auto-mounting (but it doesn't update /etc/fstab). In this example the "Generic Flash Disk" is selected and you can see by default it's not auto-mounted.
Many answers address auto-mounting
This answer will hopefully serve as a "sign post" to finding other answers with more detailed steps for your particular environment.
The list is a fraction of thousands of questions because only questions with answers are included. Duplicates are also included if they have good answers.
Questions about "unmounting" are not included to keep the list shorter. Questions requiring usbmount, a third-party program for mounting USBs that was required for a short period of time, are omitted. Questions about mounting network drives through configuration files other than/etc/fstab are omitted. Questions with specific problems on a specific platform are omitted.
- Location of Gnome Automount
- ftp automount in ubuntu
- Automount in 16.04
- Problem with automount and exfat fstype
- fstab automount smb fails
- How to automount NTFS partitions?
- automount thumb drive own by root
- How do I change the automount point?
- mdadm automount
- Pam_mount won't automount encrypted partiton
- Permission denied on SSHFS automount
- Automount NTFS drives before startup applications
- How to automount removable devices with options?
- How to automount usb external hardisks in ubuntu server 12.04?
- Automount with async option
- Automount flash drive lags
- automount USB drive in VirtualBox via udev in ubuntu 12.04
- Ubuntu Community - Mounting Partitions Automatically (The best I think)
- How to automount my Windows partition at boot?
- How do I automount partitions on statup, Xubuntu 14.04
- Automount ext4 partition with user permission/ownership (fstab?)
- Mounting filesystem with special user id set
- How to automount hdd without causing freeze when missing?
- Automount of external hard disk
- How do I automount a unionfs-fuse filesystem?
- How to automount HPFS/NTFS (exFAT) 64GB microSD card on 10.04? (Although 10.04 should work same today)
- How to automount a partition on login?
- When automount ntfs partition, all file were marked "Allow executing file as program"
- Automount of CIFS share fails during boot while mount -a works after login
- Is it possible to automount a partition on a dummy location?
- How to configure the default automount location?
- Automount NTFS partition like Nautilus do
- Can't automount two partitions at login
- Securely automount encrypted drive at user login
- How to automount cardreader on startup?
- How can I automount my hard disk partitions?
- Automatic NTFS Partition Mount on Startup
- Automatically mount NTFS drive when I login
- How to automatically mount hibernated NTFS to read-only? (Particularly interesting for Windows Fastboot and Hibernation)
- With fstab, how do I automatically mount an NTFS partition with full permissions for every user?
- Unable to mount external NTFS HDDs due to duplicate UUID
- automatic mount any external drive under /media with read/write access to everyone
- Best practice to keep a NTFS partition constantly mounted?
There are thousands of questions about mounting particularly with ntfs (Windows) but hopefully this list will provide a short cut to some.
Please feel free edit this answer to add and subtract to this list as you think appropriate. My eyes are bloodshot from reading so many Q&A's and am unlikely to maintain it.
Creating this list of links took a couple of hours but it won't solve everyone's problems. Some will still have to sort through search lists of thousands of Q&A's. Indeed this list is almost exclusive to Ask Ubuntu and even more answers are on the broader internet and other Stack Exchange sites.