nce upon a time I wanted to switch the OS of my Plex Media Server from Windows to Ubuntu. I ran into issues right away because my media is on an external drive attached to my ASUS router and exposed on the network as Windows (SMB) shares. Out of the box Ubuntu would not mount my SMB shares. Here are the steps I took to be able to mount these folders automatically, so that I could then install and configure Plex Media Server and add my libraries. (The key items are the smb.conf parameters and adding ver=1.0 in fstab. ASUS router firmware only supports SMB 1.0.)
UPDATE (12/19/2019): The old solution did not survive a reboot, so I’ve updated. The key items now are using x-systemd.automount and uid/gid in the fstab line. I also discovered that installing asuswrt-merlin firmware enables ASUS routers to use SMB 2.0.
Install Ubuntu 18.04 LTS, update and login as the plex user, then
sudo apt install smbclient cifs-utils
sudo nano /etc/samba/smb.conf
and add this to smb.conf in the [global] section
WORKGROUP = MYWORKGROUP
client use spnego = no
client ntlmv2 auth = no
Then
sudo nano /etc/hosts
and add the IP and servername of your fileserver (router) to hosts
192.168.1.76 servername
Then
sudo mkdir /home/plex/movies
nano /home/plex/.smbcredentials
and add your username and password to .smbcredentials
username=plex
password=plexpassword
Then
chmod 600 /home/plex/.smbcredentials
sudo nano /etc/fstab
and add the share you want to automatically mount as a line in /etc/fstab
//servername/movies /home/plex/movies cifs nofail,x-systemd.automount,vers=2.0,uid=plex,gid=plex,credentials=/home/plex/.smbcredentials
Reboot to test that the share automounts.
Install Plex Media server. I like this guide: https://www.linuxbabe.com/ubuntu/install-plex-media-server-ubuntu-18-04
Sources: How to connect to Samba share on an ASUS router, Does asus only support Samba/SMB1? Is it possible to enable SMB2 or higher?, Why is mount.cifs not working in fstab any more after upgrading from 16.04 to 18.04?, No write access to destination Ubuntu, Ubuntu 18.04 Cifs Mount not showing files on boot, fstab, CIFS automount using systemd getting read only

