exFAT drive partition not shared with Samba

Hardware: Raspberry Pi 3 model B

OSMC version: 2019.10-1 running Kodi 18.4

(sharing with Windows 7 and Windows 10 PCs)

I have done a lot of searching and can’t find any mention of anyone else suffering from this problem…

I have a problem with a Samba share from an exFAT drive.
Other drives/folders attached to the pi are accessible from my other computers, it is only this exFAT drive that is the problem.

I have installed samba from the OSMC app store.

Only the EFI partition of the drive is automounted in Samba, not the main partition with all the actual files.

The main partition is mounted and the files read fine from Kodi/OSMC, it is just not being shared via Samba.

I have tried to manually add the drive to /etc/samba/smb-shares.conf using the automount template:

browseable = yes

read only = no

valid users = osmc

path = media/billymedia

comment = exFAT videos drive

This didn’t work either.

(I have not edited the original smb.conf file)

I had previously set up a samba share through apt-get, and mounted through fstab, but this was causing the pi to fail to boot when the drive wasn’t connected, so I deleted the lines from fstab. Could this be causing some kind of conflict in my shares?

Any ideas? I would be very grateful for some help, I am very much a novice at Linux….

Does the drive show up in /media automatically?
Are you sure you haven’t changed the default Samba configuration?


Thanks for the quick response.
Yes, the drive shows up in /media automatically

Can you try on a default install with a new SD card as a quick test?

Suggest to remove /etc/samba/smb-shares.conf then reboot.
Also post your smb.conf via paste-log /etc/samba/smb.conf and share the URL
Last install smbutils sudo apt-get install smbutils and run smbutils -L localhost and show output


smb.conf URL:

sudo apt-get install smbutils unfortunately returns E: Unable to locate package smbutils
even after running sudo apt update

Sorry, try sudo apt-get install smbclient
And then run smbclient -L localhost

osmc@billymedia:~$ smbclient -L localhost
Enter osmc’s password:
Domain=[WORKGROUP] OS=[Windows 6.1] Server=[Samba 4.5.16-Debian]

    Sharename       Type      Comment
    ---------       ----      -------
    osmc            Disk      OSMC Home Directory
    IPC$            IPC       IPC Service (Samba 4.5.16-Debian)
    8GB REFURB      Disk      Auto-mount Volume
    EFI             Disk      Auto-mount Volume
    ED30-9BB2       Disk      Auto-mount Volume

Domain=[WORKGROUP] OS=[Windows 6.1] Server=[Samba 4.5.16-Debian]

    Server               Comment
    ---------            -------
    BILLYMEDIA           Samba 4.5.16-Debian

    Workgroup            Master
    ---------            -------

These are 3 external devices being shared.
If you label your partition specially it might be easier for you to find.

8GB REFURB - is a USB stick plugged into the pi.
EFI - is the EFI partion of the drive I want to access
ED30-9BB2 - looks like one of the partitions of the SD card

This is a list of the mounts in media - the partition I want shared is labelled billymedia and is mounted OK.

osmc@billymedia:/etc/samba$ cd /media
osmc@billymedia:/media$ ls
8GB REFURB ED30-9BB2 EFI README billymedia

Ok, the EFI partition could be your issue. As I doubt you will boot from a media drive suggest to remove that partition. If you can store the data somewhere else in between and repartition the drive to a single partition would be best.

BTW fdisk -L or lsblk will tell you which partition on which drive

I will give that a go. Thanks for your time helping me out.
I won’t need to boot from the drive, but I am slightly worried about removing the partition. I might try exploring some other options first.

Thanks again.

Just a heads up there are issues with Windows and exFAT partitions shared over SMB from OSMC. Large file transfers from Windows will fail and they will corrupt the partition in the process. Both a failed transfer or just deleting a file over the network from Windows will not recover the disk space the file used. This corruption is not able to be repaired by either exfatfsck in Debian or chkdsk in Windows.

If you are only reading from the Windows machines then it should work fine. Setting the share as read only may be a good idea.

Drives formatted as NTFS, FAT32, or ext4 do not have these issues and can be used without restriction.

Oh wow, that is a very important nugget of information! Thanks @darwindesign.

I will format to NTFS then, I had used exFAT to allow me to use either my windows or mac machines with the drive. The risk of destroying the partition is much greater than the convenience of accesss across platforms. I think you just saved me from some enormous headaches and stress in the future.

If you are going to reformat, EXT4 would be the best choice for performance. But then it would only be readable on a linux system. If you don’t plan on using the drive on Windows or Mac, then go with EXT4. If you do think you will need to use Windows, then go with NTFS.

If the drive is EXT4 you will still be able to access it via SMB from Windows.

If you were only writing from your Mac over the network then that might work (I would test it first on a drive you don’t mind formatting if it fails). Someone else tested it from a Debian PC and the issue didn’t happen. It seems to be specific to Windows.

Well after a serious amount of data copying, I have reformated the drive as NTFS, and removed the EFI partition, so there is only one partition on the drive.

The drive still does not auto-mount through samba.

USB sticks however, show up consistently, and can be accessed through my windows machine over the network. There must be something about this drive or interface that the SMB client does not like.

I think I’m going to give up and set up FTP instead!

Thanks all, for your attempts to help me anyway.

Hi thinbilly,

just have had a quick look to this: I’m missing the section name in first line (which will be the sharename afterwards) and there is a missing slash in the path. So, can you try /etc/samba/smb-shares.conf with content:

    browsable = yes
    read only = no
    valid users = osmc
    path = /media/billymedia
    force user = osmc
    comment = Deprecated (Please use the Auto-mount Volume shares)
    hide files = /$RECYCLE.BIN/System Volume Information/desktop.ini/thumbs.db/

(last 3 lines just as it is configured on my OSMC devices)

Do a

sudo systemctl restart sambaor even a reboot of the OSMC device to make that active.

1 Like

Amazing! That’s got it all sorted. Thank you so much :slight_smile: