Samba network-filesharing

Samba is an easy way to share an external storage to the whole network.

In my case there is a 2TB USB Hard Disk, which I wanted to share to everyone. My router would provide a built-in NAS option, but not everyone does have the luck of owning a router capable of this option and furthermore, where is the fun in that? Let’s get started:


Install raspberian on the SD. Get the image and a good description of the installation on

After the installation you can give your Raspberry Pi a shiny name and you can also change the overclocking settings. Mine are running medium overclocking settings.


If you own a router who is providing DHCP to the network, I suggest giving your raspberry(s) a static IP address. This will make your life easier and also prevents confusion if you are using more then 1 raspberry.

The MAC address might be needed, for this reason use the command:


eth0 is your network adapter.

USB drive mount:

First we need to tell your raspberry where to find the USB drive.


driver installation


You can change “usb” to whatever you like


Execute this command AFTER you plug in your USB drive. It should prompt something like “sda:”.


to cancel the message

Depanding on the filesystem we will mount the USB drive now







In order to mount the USB drive during every restart we needto do the following steps


This will output an UUID. Note your UUID and procceed to the next step


Add one of the following at the end of the file (depending on your filesystem)







That’s it, we are done mounting the USB drive. The next step is to install samba:


After that we need to edit smb.conf


uncomment (delete ‘#’) the following line and save




Now we are adding a samba user to the standard user pi


and add the rights to the USB drive


we are now editing smb.conf


At the end of the file add the following code. change [share] to whatever you want. This will be the name which is displayed to the users.


save and restart


[1] We are now adding users who may access the USB drive. Replace [user] with a username of your choice.


[2] Adding the user to samba. Replace [user] again with the user created in the steop before.


We are almost done. The last step is to configure smb.conf:


This part now is pretty much customizeable to fit your needs. I will provide a basic configuration and my personal configuration that has 2 users. To add a user simply repeat the steps [1] and [2].


This configuration will provide your user full access to your USB drive. Below you can see my setup which is set up for 2 users, one with full rights to the USB drive and another share that has just access to one folder of the USB drive.


Restart your samba one last time.


We are done!

Credit goes to who provides very good guides about Raspberry Pi in German. I have made the whole samba setup using his guides.


Raspberry Pi as DHCP Server

In order to run my Raspberry Pi as a PXE server I had to switch the DHCP server from my router to the Raspberry.

For this duty we are using isc-dhcp-server

Quite simple stuff, so lets start and get it.

At first we need a static IP on our raspberry pi:


comment out iface eth0 inet dhcp

add the following lines and adjust the gateway to your routers IP. Address and network can also be changed f.e. to address and network In this howto I will use my personal settings which are in a network


save the configuration and restart the connection


now we are going to install our dhcp server


and start the config:


my network is running on the subnet Adjust the IP if you want to use f.e.


almost done, lets start the DHCP-server:


Now deactivate the DHCP server on your router.

After that you can test it. On a windows client open cmd and type ipconfig /release and afterwards ipconfig /renew. You should now have a new IP from your subnet.

lets change the motd of our raspberry pi

Most of us will be using ssh to log into our raspberry pi. So lets change the motd to something more shiny:


delete everything


look for uname -snrvm > /var/run/motd.dynamic and comment it out (put # at the beginning of the line)


look for PrintLastLog and change yes to no


azeam of forums provided a nice code which shows some basic information of your raspberry pi and can be complete customized. You’ll also find information about customized motd’s at the following link

so lets put in the following code:


save and go on with the next step:




go to the end of the file an add /etc/motd.tcl

save your work and test it



You’ll see I just added a custom text at the bottom, you can modify it however you like by editing /etc/motd.tcl


current state

Nagios3 status

This blog will be my personal documentation about the home server infrastructure and should as well provide guides and howtos about using the raspberry pi as a low cost home server for various duties.

Currently the network looks like this:


Raspberry Pi B+: Amarr

Samba Fileserver: 1 admin user 1 restricted user

torrent client


Raspberry Pi B: Gallente

Monitoring Server: Nagios 3

LDAP Server: in progress

Both raspberry pi are running on Raspberian which is based on Debian Wheezy. A router is providing DHCP and Internet for all clients and server, altough I will transfer the DHCP service to one of the server in order to use PXE Image distribution to my clients.

3 Clients are running Windows 7, one of them is used as a test client only. 1 netbook is using Windows XP and Ubuntu 14.04 LTS, 1 notebook on Ubuntu 14.10 and 1 subnetbook doesn’t have a hard disk, it is running Ubuntu 14.10 from a USB Stick.

There are also 2 cats providing entertainment as well as random inputs from the keyboard.