Wednesday 27 January 2021

Setting up a Samba server

My Raspberry Pi's main purpose is to host a raid array.  It does that more or less fine, though it took me a while to find a stable enough powered USB hub to host the pair of external hard drives.

To server the files to the rest of my network I connect to the Pi via sshfs on the client computer.  This has the benefit of not needing me to do anything else on the Pi, though it means installing sshfs on the client systems.  A downside is that sshfs is not supported natively on the Macs that I am connecting to the Pi with, and I need to make sure I keep sshfs working whenever e.g. a new update happens to the Mac OS.  sshfs is also an encrypted protocol, yet I don't necessarily want the overhead of encryptic massive media files which is what I usually access from the raid array.  Authentication would be nice, but encryption of the data is not really necessary in my case.  

So, I'd like to set up a samba server, which is the Windows files sharing protocol that will allow me to mount the raid data on the Pi as a shared drive on an other machine (be it Windows, Mac, Linux, or my Android tablet).  

I'm going to follow the official raspberry pi site to install and run samba.  I will document what I do here so that I can refer back to it.

The first step is to install samba via:

sudo apt update
sudo apt install samba samba-common-bin smbclient cifs-utils

doing this and saying 'yes' to the confirmation to go ahead proceeds as expected and the software installs.

Next, I jump to the "Sharing a folder for use by Windows" section of the above web page.  I already have a folder to share, which in my case is /mnt/raid.  So I edit the file /etc/samba/smb.conf  and add the following to the end:

[share]
   path = /mnt/raid
   read only = no
   public = yes
   writeable = yes 

I follow the suggestions of the web page, but that's all fine as I want the drive to be freely available to users on my home network.

There is also a suggestion to change the workgroup setting to agree with my home Windows networt.  Since this is the first thing to use my home windows network, I generate a new name for the workgroup:

   workgroup = 12leas    

Saving the file appears to be enoug for samba to pick it up, and indeed I can see a directory called "share" on my Mac:


Note that "ah-satan" is the name of my Raspberry Pi.  (It's my wife's name, backwards)

success!


Thursday 9 March 2017

My Raspberry Pi blog

Welcome to my blog about the raspberry pi computer.  I've been using the first model pi for a while (as a raid array) and I just got a later model which I haven't taken out of the box yet.  

Having spent lots of time playing with / configuring the older pi, I thought that it would be helpful for me to start documenting what I've been doing, more so that I can refer back to what I have done, that anything else.  Having it as a blog, though, means that what I learn might just end up being useful for someone else.

The title of the blog is "My Pi's Mad at Me".  I don't really think my Pi is mad at me, but I liked the pun based on this Tracey Ullman cover of a Madness song: