NAS (Network Attached Storage) — simple build on Arch Linux

Sirui Liu Lv1

Very first blog I have ever written. Yoroshiku.

Yappings

I’m having a lot of trouble landing an early co-op job.
Right now the only “experience” on my résumé is WE Accelerate, which feels pretty useless.
By the time this post goes live I’ll have finished my first round of job hunting— I fired off nearly 50 résumés and got ZERO interviews.

Most of my friends have at least gotten one interview. I’m just wondering why.

Hopefully I’ll snag something in Cycle 2. Good luck to me.

Network-Attached Storage, a.k.a. a NAS, is a storage device that provides centralized, shared access to data over the network.
Think of it as an invisible SSD attached to every computer, letting you send, download, share, and transfer files at will. A NAS can do more than storage— e.g. act as a home media server. I’m currently tossing Docker containers onto my personal NAS and have Jellyfin (an open-source media server) up and running. Maybe I’ll write another post on Docker later.

Why did I build a NAS? Well, I happen to have a totally idle computer with ~500 GiB of storage. And I happen to have a few friends building their own NAS boxes at the same time. Maybe it’ll even help me get a job.

Before this, I had zero Linux-CLI experience and barely any networking knowledge. Building a NAS forced me to touch the real CLI, file-sharing protocols, and— later on— container management & multimedia services. Suggestions are welcome.

Special thanks to ChatGPT
No more yapping. Let’s begin.

Prerequisites

  • An idle computer for the OS and storage.
  • Know how to install a clean Linux distro. Any Linux is fine; I’m using Arch.
  • Be familiar with basic Linux CLI.

Notice: This tutorial is Arch-based, but you can still adapt it to other distros.

Intro

Samba is an open-source suite that lets Linux/Unix share files and printers with Windows, macOS, and mobile devices via the SMB/CIFS protocol.

We’ll use Samba for cross-platform transfers. If you only need Linux-to-Linux, NFS is better.

Install Samba on Arch

1
2
sudo pacman -S samba
sudo systemctl enable --now smb # start at boot

smb.service runs the basic file-sharing service.

Note: this NAS isn’t aimed at macOS users. For macOS, look into avahi daemons.

Directory layout

I literally dump everything into /srv/nas/share. Create more directories if you want.

1
2
3
sudo mkdir -p /srv/nas/share
sudo chown -R root:root /srv/nas
sudo chmod 755 /srv/nas

What the heck does 755 meaning?

Permission Breakdown Meaning
7 (owner) rwx The owner can read, write, and execute.
5 (group) r-x Group members can read and execute, but not write.
5 (others) r-x Others can read and execute, but not write.

So outsiders can read this directory but can’t write to it.
Well, my NAS is only open to me for mysterious reasons.
I’ll probably chmod 700 instead of 755 because I’m the sole user— explanation coming soon.

Add NAS users Where is “s”?

1
2
3
sudo useradd -M -s /usr/bin/nologin nasuser  #Change nasuser into anything you want for example worldvanquisher
sudo passwd nauser #set password
sudo smbpasswd -a nasuser # now give it a *Samba* password – this is what Windows/Mac will ask for

No need to explain more. If you cannot understand this, you are not even suitable for NAS deploying. Go back to The Linux Command Line by William Shots it’s even free online.

Minimal samba conf file

Arch Deleted a sample samba config file for some reason. That is to say, we have to write a minimal samba config file。

1
2
3
4
5
6
7
8
9
10
11
[global]
workgroup = WORKGROUP
server string = Samba Server
security = user
map to guest = Bad User

[Public]
path = /srv/samba/public
browseable = yes
read only = no
guest ok = yes

Wait wait wait what the hell is that?
No need to focus on that. This is the minimal script from Arch Wiki which would magically push samba to work.
If you do really care, check Arch Linux Wiki. It will help solve the problem.

Good. Now you should check the syntax of this strange document.

1
2
test parm
sudo systemctl restart smb

If nothing explodes, Conguatulations you have survived!

Exposing the share over Tailscale (lazy VPN method)

  1. Machine is already in my tailnet: tailscale up

  2. Friend types in \\100.x.y.z\Media from his dorm Wi-Fi.

  3. Done. Zero firewall rules, zero router headache.

Want the share public-public? Don’t. Put a reverse proxy in front or stick to Tailscale Funnel.

Then you have it!
Win + R ⇒ \\100.98.239.98\nas\share come to have a try!

What’s next?

-Enable recycle bin so accidental deletes go to .RecycleBin.
-Docker. The spirit of NAS system.
-Maybe more!

References

  • Title: NAS (Network Attached Storage) — simple build on Arch Linux
  • Author: Sirui Liu
  • Created at : 2025-05-25 18:50:20
  • Updated at : 2025-05-26 00:08:08
  • Link: https://worldvanquisher.github.io/2025/05/25/NAS-Network-Attached-Storage-simple-building-on-Arch-Linux/
  • License: This work is licensed under CC BY-NC-SA 4.0.