CM4 NAS

This is perhaps the most portable NAS you can put together. Paired with 5V/3A DC power supply like the ones [geekworm] makes (that don’t reset when input power is applied) it travels in the car well.

Configure as a Basic Server

One great use is to add some media, enable it as a HotSpot and share things up with plain-old SMB. Most tablets will easily connect and play with VLC.

  • Install RaspberryPI OS
  • Install Hardware Tools
  • Configure SMB
  • Add a HotSpot

Install RaspberryPI OS

If you have an EMMC based CM4, flip the switch on the back to put it in target mode and power it on while plugged into your PC. You’ll see it appear as a block device and you can image it.

After installation, run these commands on it to set it to US locale and settings.

sudo raspi-config nonint do_change_locale en_US-UTF-8
sudo raspi-config nonint do_configure_keyboard us
sudo raspi-config nonint do_wifi_country US
sudo timedatectl set-timezone America/New_York

Install Hardware Tools

These make the buttons and LCD work as intended. Refer to their wiki for installation - though this may be out of date and require some work as Raspberry Pi updates their OS.

Configure SMB

After you’ve configured the storage, with mdadm, btrfs or mergerfs, you’ll want to share it up simply.

Setup SMB

Add a HotSpot

The easiest way to create a hotspot is with nmcli. It’s already installed and will do the configuration for you. Here’s the command to add a 5GHz connection on channel 161.

sudo nmcli device wifi hotspot ssid SOMENAME band a channel 161 password SOMEPASSWORD ifname wlan0 
sudo nmcli connection modify Hotspot connection.autoconnect yes

This will give you about 72MBits of bandwidth. If you’re getting less, look to see if anything else is using 161 and change as needed.

# What channels can I use?
iw phy phy0 info | grep "MHz \[" | grep -v "no IR" | grep -v "disabled"

# What other things are around me?
sudo nmcli device wifi

# Try on of the ones that might be free
sudo nmcli connection modify Hotspot wifi.channel 149

Not every channel is available in every country. In fact, if you tried to use the default when creating the AP you’d get these errors1.

Error: Connection activation failed: 802.1X supplicant took too long to authenticate brcmfmac: brcmf_set_channel: set chanspec 0xd022 fail, reason -52

If you want to use it as a router as well, say because you’ve plugged it into a LAN cable, you can enable masquerade.

Configure LibreELEC

You can double-down and use this as a media player, in addition to serving up content over the network. A great way to do this is with LibreELEC

Though as Jeff Geerling found you may be doing something dangerous or harmful, so be careful!

Installation

Flashing the OS

This requires either flashing the SD card, or putting the CM4 into USB target mode and using rpiboot to mount the eMMC as a drive so you can use the Raspberry Pi Imager to flash the LibreELEC image.

The LibreELEC folks recently added AHCI support to their CM4 image so you don’t have to re-spin things.

Installing Hostapd

You may want to increase the WiFi performance by installing hostapd, but some assembly is required.

Configuration

You can also install services like Jellyfin. For large libraries, you may want to switch it’s metadata directory by editing:

/storage/.kodi/userdata/addon_data/service.jellyfin

Speeding up Rsync

For smaller CPUs, it can help to use the rsync daemon on-demand to remove the overhead of SSH. Establish SSH keys and write a simple script like below.

Setup Rsync Daemon

Troubleshooting

The USB port isn’t working

Check that the config.txt file contains

dtoverlay=dwc2,dr_mode=host

Jellyfin transcoding is slow

Yes, this is just a Pi4. But you can find versions of ffmpeg optimized for the pi4 hardware and rest replacing the shipped version. Though you’d think that one was already optimized.


Last modified May 8, 2026: Fixed links (04b3f1e)