Mounting ExFAT on Linux

external-hddfstabraspberry pisamba

I've been trying to set up my Raspberry Pi B+ as a HTPC that also shares a USB HDD over Samba and AFP. The latter is working just fine, and the Samba share seemed to be working too for a moment. However, whenever I try to connect to the Pi now (no modifications AFAIK) it shows me the folders with small stop icons. The following links unfortunately didn't offer me any help.

initialization

sudo mkdir /mnt/Data
sudo chown osmc:osmc /mnt/Data
sudo chmod -R 777 /mnt/Data
sudo apt-get install exfat-fuse exfat-utils

mount

/dev/sdb2 on /mnt/Backups type hfsplus (rw,nosuid,nodev,noexec,relatime,umask=22,uid=1000,gid=0,nls=utf8)
/dev/sdb1 on /media/EFI type vfat (rw,nosuid,nodev,relatime,uid=1000,gid=1000,fmask=0111,dmask=0000,allow_utime=0022,codepage=437,iocharset=ascii,shortname=mixed,showexec,utf8,errors=remount-ro,uhelper=udisks)
/dev/sdb3 on /mnt/Data type fuseblk (rw,nosuid,nodev,relatime,user_id=0,group_id=0,allow_other,blksize=4096)

cat /proc/filesystems | grep fuse

        fuseblk
nodev   fuse
nodev   fusectl

blkid

/dev/sdb3: LABEL="Data" UUID="5563-32E4" TYPE="exfat" PARTLABEL="Data" PARTUUID="91a3c291-cfcf-4b17-ba57-538c29c3f951"

fdisk -l

Disk /dev/sdb: 2,7 TiB, 3000592977920 bytes, 732566645 sectors
Units: sectors of 1 * 4096 = 4096 bytes
Sector size (logical/physical): 4096 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: gpt
Disk identifier: C5BDA252-07EB-4C54-B1EF-35AC14D16381

Device         Start       End   Sectors   Size Type
/dev/sdb1          6     76805     76800   300M EFI System
/dev/sdb2      76806 244217437 244140632 931,3G Apple HFS/HFS+
/dev/sdb3  244250368 732566527 488316160   1,8T Microsoft basic data

cat /etc/fstab

/dev/mmcblk0p1  /boot    vfat     defaults,noatime    0   0
/dev/mmcblk0p2  /    ext4      defaults,noatime    0   0

UUID=eae6464d-bd99-39f5-91a9-7d41b61356d4 /mnt/Backups hfsplus rw,force,exec,auto,users 0 3
UUID=5563-32E4 /mnt/Data exfat rw,force,exec,auto,user,umask=0 0 0

I've tried the following:

  • changing "exfat" in /etc/fstab to "fuse-exfat", "exfat-fuse", "fuseblk". All without luck.
  • manually mounting using:

    • sudo mount /dev/sdb3 /mnt/Data
    • sudo mount -t exfat /dev/sdb3 /mnt/Data
    • sudo mount -t exfat-fuse /dev/sdb3 /mnt/Data
    • sudo mount.exfat /dev/sdb3 /mnt/Data
    • sudo mount.exfat-fuse /dev/sdb3 /mnt/Data

/etc/samba/smb.conf

[global]
   workgroup = HOME
   server string = %h server
   dns proxy = no

   log file = /var/log/samba/log.%m
   max log size = 1000
   syslog = 0
   panic action = /usr/share/samba/panic-action %d

   security = user
   encrypt passwords = true
   passdb backend = tdbsam
   obey pam restrictions = yes
   unix password sync = yes

   passwd program = /usr/bin/passwd %u
   passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* .
   pam password change = yes
   map to guest = bad user

   usershare allow guests = no

[homes]
   comment = OSMC
#  browseable = no
   path = /home/osmc/
   valid users = @users, root, osmc ###this seemed necessary according to a guide
   force group = users
   create mask = 0777
   directory mask = 0777
   read only = no

The funny thing is, on every single one of these commands. The /mnt/Data privileges change to (drwxr-xr-x, root:root) and go back to normal when I unmount the volume. I'm guessing OS X won't let me browse into any directory as it is owned by root and I'm connecting as osmc. What seems to be going wrong here?

Regards,
Rowan Kaag

Best Answer

I noticed that by default, OSMC also shares external HDD's over Samba. On connecting to the Raspberry via Samba, I get the following options:

  • osmc
  • homes (not relevant in this case)
  • Data (ExFat partition on HDD)

When connecting to osmc, from my understanding, it serves me /home/osmc which has symlinked folders that I put there, e.g.: /home/osmc/Movies -> /mnt/Data/Movies

This results in the behaviour I mentioned before, giving me red warning circles on the folders. However when connecting directly to 'Data', everything works fine. I figured this would suit me and couldn't be bothered waiting for an answer here as I'm really impatient.

Related Question