Life of Pi -- Samba Server

Update:

Fix the issue of not having writing permission on the mounted exFAT disk: In /etc/fstab add:

/dev/sda1	/media/Media	exfat	rw,async,umask=0	0	0

And then mount the disk:

sudo mount -a


I have a 2T external hard disk that is partioned into:

  • 1.5T of exFAT format to store media files
  • 0.5T of HFS+ as TimeMachine
    Device Boot      Start         End      Blocks   Id  System
    /dev/sda1               2  2930667377  1465333688    7  HPFS/NTFS/exFAT
    /dev/sda2   *  2930667379  3906967727   488150174+  af  HFS / HFS+
    

What I want to do is to mount the hard disk to my Raspberry Pi running Arch Linux ARM, then it can be used wirelessly as media hub and TimeMachine.

Mount the disk

In order to mount exFAT formatted disks, we have to install fuse-exfat and exfat-utils

sudo pacman -S fuse-exfat exfat-utils

After install the packages, we need to reboot the system:

sudo reboot

After rebooting, we should be able to mount the exFAT formatted disk
sudo mount -t exfat-fuse /dev/sda1 /media/Media

Setup samba

Install samba:

sudo pacman -S samba

Copy the default conf file:

sudo cp /etc/samba/smb.conf.default /etc/samba/smb.conf

Open the configuration file:

sudo vim /etc/samba/smb.conf

Insert this after Share Definitions:

[Media]
        path=/media/Media
        valid users     =       USERNAME
        public          =       no
        writable        =       yes
        printable       =       no
        create mask     =       0644

Add a user: This is to add a user to Samba, and this user must exists in linux.

pdbedit -a -u USERNAME

Start Samba:

sudo systemctl start smbd

I mounted and shared the TimeChine partition too. However, Mac OS X does not support TimeChine over Samba:

sudo tmutil setdestination /Volumes/TM
/Volumes/TM: Incompatible file system type: smbfs (error 45)
The backup destination could not be set.

My next step is to setup TimeMachine over AFP