Build a file server with Raspberry Pi 5 | #MagPiMonday

This #MagPiMonday, learn how to make a better NAS with the new features of Raspberry Pi 5. This tutorial is part of The MagPi’s Raspberry Pi 5 launch special.

An M.2 SSD card will help bring down the power requirements for a file server
An M.2 SSD card will help bring down the power requirements for a file server

In The MagPi 134 we talked to Alasdair Allan, Head of Documentation, who mentioned he was excited for the prospect of low-power NAS boxes that made use of the M.2 HAT coming to Raspberry Pi 5 in the future. Here are the basics of setting one up.

01. Software setup

You need to install Samba onto Raspberry Pi OS, usually done with:

sudo apt install samba samba-common-bin

We like to use NTFS for the shared drive so that other operating systems can use it easily, so we install that with:

sudo apt install ntfs-3g
Example code for your Samba config file
Example code for your Samba config file

02. Storage setup

Usually we use an external hard drive, but using the SSD drive will be very similar – plug it in, make sure it’s formatted, and then mount it to Raspberry Pi OS. It will do this automagically when you plug it in once booted, but to automount it on boot (there is a difference) you’ll need to edit the fstab file with sudo nano /etc/fstab and add a line like:

 /dev/sdb1 /mnt/location ntfs nls-utf8,umask-
0222,uid-1000,gid-1000,rw 0 0

03. Configuration

The magic of the NAS box is in the Samba configuration file – it’s like writing a spell to open up the shared storage to the network. Here’s one example, and there’s another in the screenshot above, but tweak it to your own needs:

[share]
Comment = Network share
Path = /mnt/location
Browseable = yes
Writeable = yes
only guest = no
create mask = 0777
directory mask = 0777
Public = yes
Guest ok = yes

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Server Status

Aradippou Chat Larnaca Nicosia

Chat Links

Official Links.

Chat.

Alternative Mirror Links.

1. KiwiIRC 1.
2. KiwiIRC 2.

Other Web Clients.

1. IrcCloud.

Recent Posts

Related Posts:

Archives

Follow me on Mastodon

Super Club Radio

Mighty Deals

CyIRC

CyIRC Tweets

Chat Icon