We use cookies

We use cookies and similar technologies to enhance your browsing experience, analyze site traffic, and personalize content and ads. By clicking "Accept", you consent to our use of cookies. Learn more in our Privacy Policy.

DIY Raspberry Pi NAS: exFAT SSD & Samba Sharing

Raspberry PiDecember 21, 2025

Home Server on RPI

Introduction

Ever found your Raspberry Pi running out of storage, or wished you could easily share a large pool of files across your home network? You're in luck! This guide will walk you through transforming your humble Raspberry Pi into a capable Network Attached Storage (NAS) device. We'll connect an exFAT-formatted SSD, mount it reliably, and then set up a Samba server to make its contents accessible to all your devices – Windows, macOS, Linux, and even smart TVs.

Using an SSD not only gives you ample storage but also offers significant speed advantages over traditional SD cards or HDDs, especially for frequent file access. Let's get started!

Prerequisites

Before we dive in, make sure you have the following:

  • Raspberry Pi: Any modern model (Pi 3B+, Pi 4, or Pi 5) is recommended for better performance.
  • USB SSD: An external SSD, preferably in a USB enclosure or a USB-to-SATA adapter.
  • Power Supply: A robust power supply for your Raspberry Pi, especially if powering the SSD directly from the Pi's USB ports (some SSDs might require external power).
  • Ethernet Cable: For a stable network connection, an Ethernet cable is highly recommended over Wi-Fi.
  • Raspberry Pi OS: A fresh installation of Raspberry Pi OS (formerly Raspbian).
  • Basic Linux Knowledge: Familiarity with the terminal is helpful.

Step 1: Prepare Your Raspberry Pi

First, ensure your Raspberry Pi's operating system is up-to-date. This ensures you have the latest security patches and package versions.

Open a terminal and run:

bash
sudo apt update sudo apt upgrade -y

Next, we need to install the necessary utilities to handle exFAT file systems. exFAT is a common format for external drives, offering compatibility across Windows, macOS, and Linux.

bash
sudo apt install exfat-fuse exfat-utils -y

It's also good practice to have NTFS support, just in case you ever connect an NTFS drive:

bash
sudo apt install ntfs-3g -y

Step 2: Connect and Identify Your SSD

Physically connect your USB SSD to one of your Raspberry Pi's USB ports. For Raspberry Pi 4/5, use a USB 3.0 port for optimal speed.

Now, we need to identify the device name of your SSD. Use the

text
lsblk
command, which lists block devices:

bash
lsblk

You'll see output similar to this (your device names might vary):

text
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT sda 8:0 0 232.9G 0 disk └─sda1 8:1 0 232.9G 0 part micro-sd 179:0 0 29.7G 0 disk ├─micro-sd1 179:1 0 256M 0 part /boot └─micro-sd2 179:2 0 29.4G 0 part /

In this example,

text
/dev/sda
is our SSD, and
text
/dev/sda1
is its partition. Make a note of your SSD's partition name (e.g.,
text
sda1
). Do not confuse it with your SD card, which is usually
text
mmcblk0
or similar.
If your SSD is brand new and unformatted, you might only see
text
sda
without any partitions. In that case, you'll need to format it first using
text
fdisk
and
text
mkfs.exfat
(this guide assumes it's already exFAT).

Step 3: Mount the exFAT SSD

We need a place on the file system to "attach" our SSD. This is called a mount point. Let's create one:

bash
sudo mkdir /mnt/ssd_share

Now, let's manually mount the SSD to test it:

bash
sudo mount /dev/sda1 /mnt/ssd_share

Replace

text
/dev/sda1
with your SSD's partition name. To verify it's mounted, use
text
df -h
:

bash
df -h

You should see

text
/mnt/ssd_share
listed with the SSD's capacity.

Persistent Mounting with
text
/etc/fstab

To ensure your SSD automatically mounts every time your Raspberry Pi boots, we'll edit the

text
/etc/fstab
file. Before editing, it's safer to identify your SSD by its UUID (Universally Unique Identifier) rather than its
text
/dev/sda1
name, as device names can sometimes change after reboots or adding other USB devices.

Find the UUID of your SSD's partition:

bash
sudo blkid /dev/sda1

You'll get output like:

text
/dev/sda1: UUID="YOUR_SSD_UUID" TYPE="exfat" PARTUUID="..."

Copy your

text
UUID
. Now, open
text
/etc/fstab
for editing:

bash
sudo nano /etc/fstab

Add the following line to the end of the file, replacing

text
YOUR_SSD_UUID
with your actual UUID:

text
UUID=YOUR_SSD_UUID /mnt/ssd_share exfat defaults,nofail,users,uid=1000,gid=1000 0 0

Let's break down those options:

  • text
    UUID=YOUR_SSD_UUID
    : Identifies the device.
  • text
    /mnt/ssd_share
    : The mount point we created.
  • text
    exfat
    : Specifies the filesystem type.
  • text
    defaults
    : Basic mount options.
  • text
    nofail
    : Prevents the system from failing to boot if the drive isn't present.
  • text
    users
    : Allows any user to mount and unmount the filesystem (though we're mounting at boot).
  • text
    uid=1000,gid=1000
    : Assigns ownership of the mounted filesystem to the default
    text
    pi
    user (UID 1000) and group (GID 1000). This is crucial for Samba to work without permission issues.

Save and exit (

text
Ctrl+O
, then
text
Enter
, then
text
Ctrl+X
).

Test the

text
fstab
entry by unmounting and remounting everything:

bash
sudo umount /mnt/ssd_share sudo mount -a

Check

text
df -h
again to confirm it's mounted correctly. If there are no errors, your SSD will now mount automatically on boot.

Step 4: Install and Configure Samba

Samba is a re-implementation of the SMB/CIFS networking protocol, allowing Linux/Unix machines to interact with Windows-based network shares.

Install Samba:

bash
sudo apt install samba samba-common-bin -y

Before modifying the Samba configuration, it's wise to create a backup:

bash
sudo cp /etc/samba/smb.conf /etc/samba/smb.conf.bak

Now, open the main Samba configuration file for editing:

bash
sudo nano /etc/samba/smb.conf

Scroll to the very end of the file and add a new share definition. Here's a common setup for a basic shared drive. Feel free to adjust the

text
[SSD_Share]
name.

ini
[SSD_Share] comment = Raspberry Pi SSD Network Share path = /mnt/ssd_share browseable = yes read only = no guest ok = no create mask = 0775 directory mask = 0775 valid users = pi # If you want to allow anonymous access (less secure), uncomment the line below: # guest ok = yes # force user = pi # force group = pi

Let's explain these parameters:

  • text
    [SSD_Share]
    : The name of your share as it will appear on the network.
  • text
    comment
    : A descriptive text for your share.
  • text
    path
    : The absolute path to your mounted SSD.
  • text
    browseable = yes
    : Allows clients to see this share when browsing the network.
  • text
    read only = no
    : Allows users to write to the share.
  • text
    guest ok = no
    : Disables anonymous access. This is recommended for security.
  • text
    create mask = 0775
    : Sets file permissions for newly created files (owner/group full, others read/execute).
  • text
    directory mask = 0775
    : Sets directory permissions for newly created directories.
  • text
    valid users = pi
    : Specifies which users are allowed to connect to this share. Replace
    text
    pi
    with other Linux usernames if needed, separated by commas.

Save and exit (

text
Ctrl+O
, then
text
Enter
, then
text
Ctrl+X
).

Create a Samba User

Samba users are separate from system users. You need to add a system user to Samba's password database. We'll use the default

text
pi
user for simplicity.

bash
sudo smbpasswd -a pi

You'll be prompted to set a new Samba password for the

text
pi
user. This can be different from your Raspberry Pi login password.

Finally, restart the Samba service to apply the changes:

bash
sudo systemctl restart smbd

Step 5: Access the Share from Your Network

Now that your Samba share is configured, you can access it from other devices on your local network.

On Windows

Open File Explorer, type

text
\\RASPBERRYPI_IP_ADDRESS\SSD_Share
or
text
\\raspberrypi\SSD_Share
(if your Pi's hostname is
text
raspberrypi
) into the address bar and press Enter. You'll be prompted for credentials – use
text
pi
as the username and the Samba password you set earlier.

On macOS

From the Finder, go to

text
Go > Connect to Server...
(or press
text
Command+K
). Enter
text
smb://RASPBERRYPI_IP_ADDRESS/SSD_Share
or
text
smb://raspberrypi/SSD_Share
and click
text
Connect
. Enter your Samba credentials when prompted.

On Linux

Most file managers (Nautilus, Dolphin) can connect to SMB shares. Look for an option like

text
Connect to Server
or
text
Network
. You can typically enter
text
smb://RASPBERRYPI_IP_ADDRESS/SSD_Share
.

Troubleshooting Tips

  • Permissions: If you can connect but can't write, it's almost always a permissions issue. Ensure
    text
    uid=1000,gid=1000
    is in your
    text
    fstab
    for the exFAT drive, and check the
    text
    create mask
    and
    text
    directory mask
    in
    text
    smb.conf
    .
  • SSD Not Mounting: Double-check the UUID in
    text
    /etc/fstab
    . If you're using
    text
    nofail
    , the Pi will boot but the drive won't be mounted. Check
    text
    dmesg
    for errors during boot related to your SSD.
  • Samba Not Accessible: Verify the Raspberry Pi's IP address (
    text
    hostname -I
    ). Ensure Samba is running (
    text
    sudo systemctl status smbd
    ). Check if your firewall (if enabled) is blocking ports 139 and 445.
  • Power Issues: Some SSDs require more power than the Raspberry Pi's USB ports can reliably provide, especially older Pi models. Consider a powered USB hub if you experience intermittent disconnections or performance problems.
  • Hostname vs. IP: If
    text
    \\raspberrypi
    doesn't work, try using the Raspberry Pi's IP address instead.

Conclusion

Congratulations! You've successfully transformed your Raspberry Pi into a basic yet powerful NAS device. You now have a network-accessible exFAT SSD, offering flexible storage for your files, backups, or media library. This setup is a fantastic way to repurpose an old Pi or expand the capabilities of a new one, providing convenient centralized storage for your entire home network. Enjoy your new DIY NAS!

Enjoyed this article?

Share it with your network

Comments (0)

Leave a Comment

0/1000 characters

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

No comments yet. Be the first to share your thoughts!

More Articles

Raspberry PiDec 9

Turn Your Raspberry Pi Into a Simple Samba File Server

Ever wished you had a central place on your home network to store files, share documents, or stream ...

Raspberry PiDec 14

Schedule Tasks on Raspberry Pi: Easy Cron Job Guide

Ever wished your Raspberry Pi could just do things on its own, like taking a photo every hour, loggi...

AIDec 16

Unlock Developer Superpowers: The Benefits of OpenAI Codex

Imagine having an AI-powered co-pilot that understands your programming needs, writes boilerplate co...