💾 Archived View for chirale.org › 2012-08-31_506.gmi captured on 2024-08-31 at 11:59:01. Gemini links have been rewritten to link to archived content

View Raw

More Information

⬅️ Previous capture (2024-05-12)

-=-=-=-=-=-=-

Turn Raspberry into a small NAS with samba

I got a Raspberry Pi Model B. It’s cheap and I want to do some experiments for fun.

Raspberry Pi Model B

Experiment \#1: I have a 1T external HDD (FAT) and I want to turn Raspberry into a very basic NAS.

I used:

I flashed Raspbian into a class 10 SDHC, I follow this useful howto about to turn on HDMI instead of TV and voilĂ , I got a down-scaled debian system into a silent, little board that I charge with the smartphone charger via microusb (5V, 700mA).

flashed Raspbian

this useful howto

I plug a wireless mouse and keyboard on the first USB port, and then I plug my external drive on the second. Debian read the FAT partition well (mounted on /media/MYDRIVE), but now I have to turn it into a wannabe-NAS.

Shall we dance? With Samba!

I plug the RJ-45 ethernet connector from my modem router into the Raspberry Pi and I follow this howto in Italian.

this howto

$ is a pi console (Start \> Accessories \> LXTerminal)

\# is a root console (Start \> Accessories \> Root terminal)

# adduser guest --home=/home/public --shell=/bin/false --disabled-password # sudo chmod -R 0700 /home/public # chown -R guest.guest /home/public $ sudo apt-get install samba smbfs

Then I have a new user “guest” with no password authentication. The howto covers the creation of a shared home (/home/public) but I do something slightly different (WORKGROUP is my local network name):

editing /etc/samba/smb.conf

## Browsing/Identification ### # Change this to the workgroup/NT-domain name your Samba server will part of workgroup = WORKGROUP ####### Authentication ####### security = share obey pam restrictions = yes guest account = guest invalid users = root

And now the most interesting part:

[MYDRIVE] comment = Mydrive read only = no locking = no path = /media/MYDRIVE guest ok = yes force user = pi

Where /media/MYDRIVE is the path to your external usb drive.

And then:

# /etc/init.d/samba restart

to apply.

As this howto explains, the “force user” allows a user (i.e. guest) to get the files from a device mounted by another user (i.e. pi, the default raspbian user).

this howto explains

Have fun

Now on the Windows machine on the Network panel I look for RASPBERRYPI and inside it I find the “mydrive” folder, with all the files from MYDRIVE within. I play a 720p video without slowdown. And so, the cheap NAS experiment is successfully completed.

https://web.archive.org/web/20120831000000*/http://www.raspberrypi.org/faqs

https://web.archive.org/web/20120831000000*/http://www.raspberrypi.org/downloads

https://web.archive.org/web/20120831000000*/http://blog.superpat.com/2012/06/08/raspberry-pi-fix-for-hdmi-to-dvi-cable-issue/

https://web.archive.org/web/20120831000000*/http://guide.debianizzati.org/index.php/Samba:_guida_rapida

https://web.archive.org/web/20120831000000*/http://ubuntuforums.org/showthread.php?t=1756575