This RPi has a 1TB USB disk connected as media storage and it was mounted whenever the RPi boots.
The drive was also shared on the network via a samba share.
After I did an OSMC update yesterday and got KODI 18 instead of 16 or 17 I had before the USB drive does not connect on boot anymore and the samba share seems to have disappeared.

So now I am working on restoring these two points but I am really confused about all I see on the net when I google so I seek advice here....
1. Automatic mount of the USB drive
I believe that the mount should be entered into /etc/fstab in order to happen on a reboot, right?
Here is the current fstab content:
Code: Select all
/dev/mmcblk0p1 /boot vfat defaults,noatime,noauto,x-systemd.automount 0 0
Code: Select all
sudo blkid
/dev/sda1: LABEL="MEDIADRIVE" UUID="EE78237678233D29" TYPE="ntfs" PARTUUID="81375152-01"
Code: Select all
ls -la /mnt/
total 12
drwxr-xr-x 3 root root 4096 May 29 01:46 .
drwxr-xr-x 23 root root 4096 Jun 16 2018 ..
drwxrwxrwx 1 root root 4096 Jun 2 2018 mediadrive
Code: Select all
sudo mount /dev/sda1 /mnt/mediadrive
Code: Select all
UUID=EE78237678233D29 /mnt/mediadrive ntfs defaults,auto,umask=000,users,rw,nofail 0 0
# or possibly instead of "users":
UUID=EE78237678233D29 /mnt/mediadrive ntfs defaults,auto,umask=000,uid=1000,gid=1000,rw,nofail 0 0
So could you please verify if the line above is correct and also explain what the parameters mean:
umask: I have seen many different values used for this, what does it do?
users: Here I have instead seen uid=pi,gid=pi or uid=1000,gid=1000 What is the correct setting (user pi does not exist on OSMC; the default user is osmc)
0 0: The ending two zeros also confuse me, what purpose do they serve?
2. Automatic sharing of the USB drive via samba
Once the above is done I would like to restore my samba share of the mounted USB drive.
Samba service is installed and running, but it is not correctly configured as far as I can see.
What are the steps to take in order to share the /mnt/mediadrive as a share MEDIADRIVE with rw permissions for user osmc?
I now think that rather than configuring in /etc/samba/smb.conf one should use the linked files for customized setup, especially of the shares.
I.e. smb-local.conf and smb-shares.conf, which are linked to inside the main smb.conf file.
This is the current content of smb.conf:
Code: Select all
[global]
# If you require a fully custom smb.conf create smb-local.conf instead of editing smb.conf so your
# configuration will not be overwritten by samba upgrades. You can use smb.conf as a template by
# copying it to smb-local.conf then removing the config file line below in the new file. If you only
# need to add some additional shares see smb-shares.conf below for a simpler way to do this.
config file = /etc/samba/smb-local.conf
workgroup = WORKGROUP
security=user
follow symlinks = yes
wide links = no
unix extensions = no
lock directory = /var/cache/samba
load printers = no
printing = bsd
printcap name = /dev/null
disable spoolss = yes
log level = 1
map to guest = bad user
# usershare template share = automount template
# Automount template disabled to work around a samba bug causing crashes accessing external drives.
read raw = Yes
write raw = Yes
strict locking = no
min receivefile size = 16384
use sendfile = true
aio read size = 2048
aio write size = 2048
socket options = TCP_NODELAY IPTOS_LOWDELAY SO_RCVBUF=131072 SO_SNDBUF=131072
[osmc]
browsable = yes
read only = no
valid users = osmc
path = /home/osmc
comment = OSMC Home Directory
[automount template]
browseable = yes
-valid = no
valid users = osmc
path = %P
hide files = /$RECYCLE.BIN/System Volume Information/desktop.ini/thumbs.db/
# Add custom shares in smb-shares.conf instead of editing smb.conf so they will not be
# overwritten by samba updates. You can only add new shares to smb-shares.conf, not change
# the default shares or global options. If you need full control see smb-local.conf above.
include = /etc/samba/smb-shares.conf
I will add this into a new file smb-shares.conf:
Code: Select all
[mediadrive]
browseable = yes
read only = no
valid users = osmc
path = /mnt/mediadrive
comment = Media root Directory
Since the only thing I really need to change in the main conf file is the workgroup name I wonder how that would look in a smb-local.conf file?