惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

博客园 - 三生石上(FineUI控件)
G
Google Developers Blog
Vercel News
Vercel News
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
N
Netflix TechBlog - Medium
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
Engineering at Meta
Engineering at Meta
B
Blog
博客园_首页
量子位
博客园 - 叶小钗
L
LangChain Blog
T
The Blog of Author Tim Ferriss
云风的 BLOG
云风的 BLOG
Blog — PlanetScale
Blog — PlanetScale
F
Fortinet All Blogs
S
SegmentFault 最新的问题
宝玉的分享
宝玉的分享
D
DataBreaches.Net
雷峰网
雷峰网
The Cloudflare Blog
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
Last Week in AI
Last Week in AI
P
Proofpoint News Feed
TaoSecurity Blog
TaoSecurity Blog
罗磊的独立博客
MongoDB | Blog
MongoDB | Blog
The GitHub Blog
The GitHub Blog
I
Intezer
H
Help Net Security
The Hacker News
The Hacker News
The Register - Security
The Register - Security
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
AWS News Blog
AWS News Blog
V
V2EX
Microsoft Security Blog
Microsoft Security Blog
T
Tenable Blog
Spread Privacy
Spread Privacy
A
Arctic Wolf
P
Proofpoint News Feed
T
Threat Research - Cisco Blogs
Schneier on Security
Schneier on Security
C
CERT Recently Published Vulnerability Notes
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
The Last Watchdog
The Last Watchdog
Latest news
Latest news
T
Troy Hunt's Blog
L
LINUX DO - 热门话题

FreeBSD Foundation

BSDCan 2026 Travel Report – Novković | FreeBSD Foundation BSDCan 2026 Travel Report – Patrick McEvoy | FreeBSD Foundation BSDCan 2026 Trip Report – ShengYi Hung | FreeBSD Foundation Understanding the Foundation Board’s Role in the FreeBSD Ecosystem | FreeBSD Foundation FreeBSD Foundation Welcomes New Board Member: Dave Cottlehuber | FreeBSD Foundation Represent FreeBSD in Your Community | FreeBSD Foundation EuroBSDCon 2026 Travel Grant Application Now Open | FreeBSD Foundation FreeBSD Graphics Port Upgraded to Linux 6.12 | FreeBSD Foundation FreeBSD AI-assisted Vulnerability Discovery Project launch | FreeBSD Foundation Recap of the April 2026 Frankfurt Area FreeBSD Hackathon – Sven Ruediger | FreeBSD Foundation Cleaning Up Critical Infrastructure in FreeBSD | FreeBSD Foundation AsiaBSDCon 2026 Trip Report – Saikeo | FreeBSD Foundation AsiaBSDCon 2026 Trip Report – Minsoo Choo | FreeBSD Foundation Call for testing: introducing the Laptop Integration Testing project | FreeBSD Foundation Getting ready for the Cyber Resilience Act | FreeBSD Foundation FreeBSD Foundation Q4 2025 Status Update | FreeBSD Foundation The Q4 2025 Issue of the FreeBSD Journal is Now Available! | FreeBSD Foundation Powering the Future of FreeBSD | FreeBSD Foundation 2025: Software Development and Infrastructure Support. | FreeBSD Foundation Infrastructure Modernization – commissioned by the Sovereign Tech Agency | FreeBSD Foundation FreeBSD Closes the Laptop Gap: Year One Project Update | FreeBSD Foundation 2025: A Year of Advocacy, Community, and Growth | FreeBSD Foundation
Build a NAS using FreeBSD on a Raspberry Pi | FreeBSD Foundation
Mark Phillips · 2026-03-18 · via FreeBSD Foundation
March 17, 2026

FreeBSD runs on this…

FreeBSD runs on this…

and FreeBSD runs on this…!

It’s easy to get FreeBSD running on a Raspberry Pi. It’s easy to manage multiple hard drives with ZFS. So we were wondering if it’s possible to make a simple NAS out of a Pi…

I’m using the latest 15.0 Release here — the project automatically generates images for the Pi, which makes life much easier. Download the FreeBSD-15.0-RELEASE-arm64-aarch64-RPI.img.xz image from here and transfer it to a micro SD card for the Pi. If you’re already au fait with putting images onto physical media, I’ll not say another word. If you’re new to it though, the ‘dd‘ command on any Unix-a-like operating system is your friend, or a GUI tool like Balena Etcher will also suffice.

Before we boot the Pi, there are a few things we need to be aware of. We all know FreeBSD as a rock solid server operating system, although over the last year or so there has been a lot of work going on to bring that stability to laptops and desktops. WiFi support is getting better, but as it’s not historically the connectivity of choice for servers, the Pi’s WiFi is currently not supported. That’s all to say, you’re going to want to connect your Pi to ethernet.

Secondly, monitoring the Pi’s boot before we have network connectivity is helpful — so plug a monitor in to the Pi’s HDMI port. The Pi I have here (a 4b) didn’t want to display anything initially, and I found (from this helpful Wiki page) that I had to edit config.txt on the boot SD card. Before we do that, one final caveat — FreeBSD doesn’t support the latest Pi 5 very well.  For now it’s better to stick with the Pi4.

The EFI partition is MS-DOS format; mount it (if your OS hasn’t mounted it automatically) and change the [pi] section in config.txt to look like this:

[pi4]
hdmi_safe=0
armstub=armstub8-gic.bin
max_framebuffers=2
hdmi_force_hotplug=1
hdmi_group=1
hdmi_drive=2
hdmi_mode=16

Provided you’ve connected the ethernet to your network, and you have DHCP, it will get an IP address automatically when it boots.

By default the image has a ‘freebsd’ account, with a password of ‘freebsd’, and a root account with a password of … you get the idea. You can only ssh in with the freebsd account though, and su to root.

Let’s build a NAS

I was curious to know if I could make use of a couple of old hard drives I had sitting around, and if I could turn the Pi into a NAS by sharing files over the network. 

Not a recommendation for production

Plugging the USB caddy in and tailing /var/log/messages:

Mar  6 17:04:25 generic kernel: ugen0.4: <ASMedia ASM1156> at usbus0
Mar  6 17:04:25 generic kernel: umass0 on uhub0
Mar  6 17:04:25 generic kernel: umass0: <ASMedia ASM1156, class 0/0, rev 3.20/1.00, addr 3> on usbus0
Mar  6 17:04:25 generic kernel: umass0:  SCSI over Bulk-Only; quirks = 0x0
Mar  6 17:04:25 generic kernel: umass0:0:0: Attached to scbus0
Mar  6 17:04:25 generic kernel: da0 at umass-sim0 bus 0 scbus0 target 0 lun 0
Mar  6 17:04:25 generic kernel: da0: <ASMedia ASM1156 0> Fixed Direct Access SPC-4 SCSI device
Mar  6 17:04:25 generic kernel: da0: Serial Number AAAABBBB0490
Mar  6 17:04:25 generic kernel: da0: 400.000MB/s transfers
Mar  6 17:04:25 generic kernel: da0: 3815447MB (7814037168 512 byte sectors)
Mar  6 17:04:25 generic kernel: da0: quirks=0x2<NO_6_BYTE>
Mar  6 17:04:25 generic kernel: da1 at umass-sim0 bus 0 scbus0 target 0 lun 1
Mar  6 17:04:25 generic kernel: da1: <ASMedia ASM1156 0> Fixed Direct Access SPC-4 SCSI device
Mar  6 17:04:25 generic kernel: da1: Serial Number AAAABBBB0490
Mar  6 17:04:25 generic kernel: da1: 400.000MB/s transfers
Mar  6 17:04:25 generic kernel: da1: 3815447MB (7814037168 512 byte sectors)
Mar  6 17:04:25 generic kernel: da1: quirks=0x2<NO_6_BYTE>

Let’s create our storage pool with those two drives. I think we’ll mirror them:

root@generic:~ # zpool create -f store mirror da0 da1
root@generic:~ # zfs list
NAME    USED  AVAIL  REFER  MOUNTPOINT
store   384K  3.51T    96K  /store

Yes, it’s that easy!

We’ll want that zpool to come back on reboot, so let’s ensure zfs loads:

root@generic:~ # service zfs enable
zfs enabled in /etc/rc.conf

If we want our storage to be Network Attached, the obvious solution is Samba. Network shares over SMB will be available to all manner of operating systems, including Windows and macOS. 

Because this is a fresh installation, the pkg command itself isn’t yet installed. But helpfully, it can bootstrap itself:

root@generic:~ # pkg update
The package management tool is not yet installed on your system.
Do you want to fetch and install it now? [y/N]: y
Bootstrapping pkg from pkg+https://pkg.FreeBSD.org/FreeBSD:15:aarch64/quarterly, please wait...

Now we can install Samba. I’ve chosen the latest version available:

root@generic:~ # pkg install -y samba423
Updating FreeBSD-ports repository catalogue...
FreeBSD-ports repository is up to date.
Updating FreeBSD-ports-kmods repository catalogue...
FreeBSD-ports-kmods repository is up to date.
All repositories are up to date.
Updating database digests format: 100%
The following 82 package(s) will be affected (of 0 checked):

New packages to be INSTALLED:
[snip]

Give that a couple of minutes, depending on your network speed.

Once it’s installed, we’ll need to create Samba’s configuration file, /usr/local/etc/smb4.conf (I just followed the handbook):

[global]
workgroup = FOUNDATION
server string = Pi Samba Version %v
netbios name = RaspberryPi
wins support = Yes
security = user
passdb backend = tdbsam

[store]
path = /store
valid users = freebsd
writable  = yes
browsable = yes
read only = no
guest ok = no
public = no
create mask = 0666
directory mask = 0755

Run testparm to check the configuration is ok:

root@generic:~ # testparm
Load smb config files from /usr/local/etc/smb4.conf
Loaded services file OK.
Weak crypto is allowed by GnuTLS (e.g. NTLM as a compatibility fallback)

Server role: ROLE_STANDALONE

Press enter to see a dump of your service definitions

# Global parameters
[global]
        netbios name = RASPBERRYPI
        security = USER
        server string = Pi Samba Version %v
        wins support = Yes
        workgroup = FOUNDATION
        idmap config * : backend = tdb


[store]
        create mask = 0666
        path = /store
        read only = No
        valid users = freebsd

If you restrict the share to given user(s), you’ll need to create them for Samba with pdbedit:

root@generic:~ # pdbedit -a -u freebsd
new password:
retype new password:
Unix username:        freebsd
NT username:
Account Flags:        [U          ]
User SID:             S-1-5-21-2694234615-196936691-1629692636-1000
Primary Group SID:    S-1-5-21-2694234615-196936691-1629692636-513
Full Name:            FreeBSD User
Home Directory:       \\RASPBERRYPI\freebsd

To have the Pi appearing on the mDNS/Bonjour .local network, I also enable and run the avahi-daemon:

root@generic:~ # service dbus enable && service avahi-daemon enable && service dbus start && service avahi-daemon start
dbus enabled in /etc/rc.conf
avahi_daemon enabled in /etc/rc.conf
Starting dbus.
Starting avahi-daemon.

That’s probably not pertinent in a datacentre. But then again, neither is a storage pool attached to a Raspberry Pi by USB… 😉

Everything looks good enough to enable the share:

root@generic:~ # service samba_server enable
samba_server enabled in /etc/rc.conf
root@generic:~ # service samba_server start
Performing sanity check on Samba configuration: OK
Starting nmbd.
Starting smbd.

Lastly, on a Pi 4, which this example is, I run sysrc ntpdate_enable=”YES” because there’s no realtime clock. You can buy RTC modules for the older Pis, but see previous paragraph.

Let’s see if a computer on the network can see it:

Sorted!

Closing

If we want to disconnect the pool it’s also very simple:

root@generic:~ # service samba_server stop
Stopping smbd.
Waiting for PIDS: 6629.
Stopping nmbd.
Waiting for PIDS: 6622.
root@generic:~ # zpool export store
root@generic:~ # zpool status
no pools available

The USB caddy can be pulled from the running Pi now. And added back later as required:

root@generic:~ # zpool list
no pools available
root@generic:~ # zpool import store
root@generic:~ # zpool list
NAME    SIZE  ALLOC   FREE  CKPOINT  EXPANDSZ   FRAG    CAP  DEDUP    HEALTH  ALTROOT
store  3.62T   596K  3.62T        -         -     0%     0%  1.00x    ONLINE  -

It’s back!

This was a quick look at how easy it is to use FreeBSD on a Raspberry Pi, which is a great little device for testing ideas, or learning some operating system fundamentals. It was also a demonstration of just how easy it is to use ZFS at a basic level — with volume and filesystem management built in. Hopefully it’s whetted your appetite to go experiment a little too.

We’re dropping new posts — and videos — for technical topics regularly. So make sure you’re subscribed to the YouTube channel and following this feed in your favorite RSS reader. There’s also the newsletter, if you’d like to receive updates by email.

We’d like this content series to be interactive too — so what would you like to see us cover? What FreeBSD questions can we help you tackle?  Get in touch with your ideas.