I needed more storage. I didn't want to pay for cloud storage subscriptions forever. So naturally, I built my own network-attached storage server out of a Raspberry Pi 5, a couple of hard drives, and too many hours of my weekend.
Here's everything I did, everything that went wrong, and what I'd change if I were starting over.
Parts List
| Part | What I got | Cost |
|---|---|---|
| Single-board computer | Raspberry Pi 5 (8GB RAM) | $80 |
| Power supply | Official Pi 5 27W USB-C PSU | $12 |
| Storage drives | 2× WD Red 2TB (USB 3.0 enclosures) | $70 |
| Boot drive | Samsung 32GB microSD (Class 10) | $8 |
| Enclosure | Argon ONE M.2 case (modified) | $25 |
Setting Up the OS
I flashed Raspberry Pi OS Lite (64-bit, no desktop) onto the microSD using the Raspberry Pi Imager. Key thing: enable SSH before you boot so you can connect headlessly from day one.
# After first boot, update everything
sudo apt update && sudo apt upgrade -y
# Install Samba for file sharing
sudo apt install samba samba-common-bin -y
Configuring Samba
Edit the Samba config to add your share. I kept it simple — one big share for everything:
sudo nano /etc/samba/smb.conf
# Add this at the bottom:
[brojects-nas]
path = /mnt/storage
browseable = yes
read only = no
guest ok = no
valid users = franklin
Then set a Samba password for your user and restart the service:
sudo smbpasswd -a franklin
sudo systemctl restart smbd
Mounting the Drives
I'm running both drives in a simple RAID 1 mirror using mdadm. Not the fastest setup but if one drive dies, I don't lose everything.
# Install mdadm
sudo apt install mdadm -y
# Create RAID 1 array (replace sda, sdb with your drive names)
sudo mdadm --create /dev/md0 --level=1 --raid-devices=2 /dev/sda /dev/sdb
# Format and mount
sudo mkfs.ext4 /dev/md0
sudo mkdir /mnt/storage
sudo mount /dev/md0 /mnt/storage
What I'd Do Differently
- Use an M.2 SSD for the boot drive instead of microSD — SD cards wear out fast under constant read/write
- Get a proper UPS (uninterruptible power supply) — a power cut mid-write corrupted one of my drives early on
- Set up email alerts for drive health from the start using
smartmontools
Final Result
The NAS has been running for 6 weeks straight with zero downtime. Transfer speeds over gigabit ethernet average around 110 MB/s which is more than fast enough for streaming video off it from the couch. Total cost came in at about $195 — that's less than two months of cloud storage for the equivalent capacity.
Definitely worth it. Next version I want to add a proper RAID controller and swap out the Pi for a cheap mini PC with actual SATA ports. But for now — it works.