Categoria: Tricks

Quick NFS on Raspberry

If for some reason you find problems with broken Samba sharing on Raspbian, or just want something faster and more transparent, there is the NFS alternative — which, at least for me, is cooler than Samba. To access it from Windows is a bit more involved, and I won’t cover it on this quickie, as I’m really only needing to access it remotely from another Linux machine anyway.

So, it was a bit tricky to get it running and mounting automatically, but after spending some time on Google and experimenting/resuming a lot of different random forum suggestions, I finally got it working nicely and also mounting automatically. Here I try to resume it in just a few steps (first on a Rasberry terminal):

sudo apt-get install nfs-kernel-server

Then open /etc/exports for editing:

sudo nano /etc/exports

And add this line to map the usb hdd that is there (you need to change the path to your mounted usb drive, of course):


The first path is where I’ve an external usb hdd mounted on this Raspberry, and the mask after it allows all machines coming from 192.168.1.* (my internal network) to read from it normally through the network. I decided to mount it as read-only (ro flag). You should adapt these to your case.

To overcome the warning “NFS Server: Not starting: portmapper is not running” that happens on Raspbian, I needed to use this:

sudo update-rc.d rpcbind enable && sudo update-rc.d nfs-common enable
sudo service rpcbind restart
sudo /etc/init.d/nfs-kernel-server restart

instead of just restarting NFS. Check if the NFS server is properly running with this:

sudo /etc/init.d/nfs-kernel-server status

Ok, so if it’s now running properly on Raspbian, go to the Desktop Linux from where you want to access that Raspberry share, and install the common client:

sudo apt-get install nfs-common

Edit fstab to add the share on that machine:

sudo nano /etc/fstab

Then add the map to the share:

# maps to raspberry's music nfs /media/Public nfs auto,user,ro,hard,intr 0 0 is my Raspberry ip, you should change that. Also do not forget to create the mounting point (/media/Public) locally.

This specific combination of Client and Server configuration should made it automatically mount the shared nfs drive for me at boot time. If you don’t want to reboot right now, you can mount manually with

sudo mount -a

In my case, I never turn the Raspberry off, so it’s always available. If your Raspberry is not going to be online 24/7, you may prefer to remove the “auto” flag from the fstab line, then always use the mount -a when you want to access it on a given session.


From the many places I visited, these were the more important for me to find a successful configuration:

1 –

2 –

3 –

Solving Ubuntu stuck on Login Screen

After a simple apt-get update & apt-get upgrade, next time I booted Ubuntu 16.04LTS it was stuck on a login loop, not allowing me to enter the system normally. Searching on Google I found out that many people have had the same problem. I then tried almost everything that was suggested (except for some extremely risky ones which would not work anyway), but nothing fixed the problem for me.

In desperation I tried one thing that ended up working well, and I want to share my solution with you. First, at boot time (on that initial Grub boot selection screen), I chose the previous kernel to boot with. It booted normally, and I could now login to the system again. Then I went to and from the list found the latest Kernel available (it was v4.15.10 at this time), then downloaded these files:


Note that those were two linux-headers (all and amd64, as I’m using 64bit Linux), plus the linux-image, all for the same 4.15.10 Kernel version. You may prefer to choose the low-latency Kernel but they’re really meant for some specific use cases of Linux, so I went with the standard generic one.

After getting the three files, I installed all them at once by typing inside their download directory:

sudo dpkg -i *.deb

Then rebooted. I don’t really know what exactly caused the login problem, or if what I did will solve that for everyone, but for me that fixed the login problem and I also ended up with the latest stable Kernel, while keeping my system intact. I don’t recommend blindly following most crazy suggestions you find out there (uninstalling parts of the system or installing more and more random packages). I believe that upgrading the Kernel was straightforward, did not add or remove any packages, and was safe because if it did not work, I could simply select another older Kernel at boot, and try something else again.

Good luck.

Quickly Install Samba on Raspberry (or any Linux, that is)

So, I wanted to quickly put some USB HDD shared on my network using a Raspberry Pi. This is something simple, but I wasted a bit of extra time to get working this time, so I’m posting here just in case I forget again in the future, or someone comes looking for the same quick solution. On the Raspberry:

If you don’t have nano editor installed, install it first (or skip this if you have it already):

sudo apt-get install nano

Now install and immediately after open smb.conf (the Samba configuration file) for editing:

sudo apt-get install samba samba-common-bin
sudo nano /etc/samba/smb.conf

Put the following lines in the end of smb.conf (only things you really *need* to customize are the path in the second part and maybe the workgroup if your network workgroup is not the default Windows WORKGROUP):

  workgroup = WORKGROUP
  wins support = yes
  netbios name = Raspberry
  server string =
  domain master = no
  local master = yes
  preferred master = yes
  os level = 35
  security = user

  comment = Public
  path = /mnt/media01/Public
  public = yes
  writable = yes
  create mask = 0777
  directory mask = 0777

Remember that the path above must be changed to the actual path of the mounted USB HDD.

Save (CTRL+O then ENTER to save, CTRL+X to leave nano) and then restart Samba:

sudo /etc/init.d/samba reload

Now Windows Explorer should see the shared folder on the network. Please note that this is not set for high security. I don’t have strangers accessing my Wifi network, so I’m not too paranoid with that. If you need stronger security than the quickie above, please look elsewhere.