[GUIDE] Argon EON NAS on Raspberry Pi OS Lite 64-bit (Trixie) – RAID1 + LVM cache, Samba, RTC, clean shutdown

I’ve rebuilt my Argon EON NAS (Raspberry Pi 4 8 GB) on a clean Raspberry Pi OS Lite 64-bit (Debian 13 Trixie) and wrote down the whole process. Highlights:

  • Official Argon40 script, downloaded and reviewed instead of piped to bash (with the apt upgrade / EEPROM block disabled), plus a check for broken downloads.
  • EON RTC (PCF8563) handled by the kernel via dtoverlay=i2c-rtc,pcf8563 instead of fake-hwclock.
  • RAID1 (2 × 16 TB) with an LVM writethrough cache on a second RAID1 of SSDs.
  • A small systemd service that unmounts, deactivates LVM and stops the md arrays before power-off. Without it my data array came up “not clean” after every shutdown and needed a full resync.

Replace YOUR_USERNAME, YOUR_HOSTNAME, YOUR_NAS_IP and the UUIDs with your own values. Feedback welcome!


0. Hardware

Component Model Role
Computer Raspberry Pi 4 Model B Rev 1.5, 8 GB RAM NAS server (arm64)
Case Argon EON, 4 bays Fan, OLED (I2C 0x3c), MCU (0x1a), PCF8563 RTC (0x51)
System disk (sda) Samsung SSD 980 250 GB NVMe M.2 Over USB with a Realtek RTL9210 adapter (ID 0bda:9210)
Data md0 2 × WDC Ultrastar DC HC550 16 TB (WUH721816ALE6L4) RAID1 → LVM → /mnt/STORAGE
Cache md1 2 × Intel SSD DC S3700 400 GB (SSDSC2BA400G3) RAID1 → LVM cache (writethrough)

Network: fixed IP through a DHCP reservation on the router (YOUR_NAS_IP); DNS is whatever the router hands out.

:warning: The names sdb/sdc/sdd/sde may differ on a new install. Before wiping or partitioning anything, identify each disk by model and serial number:

lsblk -o NAME,SIZE,MODEL,SERIAL

1. Flash Raspberry Pi OS Lite 64-bit (Trixie) to the NVMe SSD

  1. Flash the image with Raspberry Pi Imager to the NVMe (connected to the PC through the RTL9210 adapter): Raspberry Pi 4 → Raspberry Pi OS (other) → Raspberry Pi OS Lite (64-bit).
  2. In the customisation options set hostname YOUR_HOSTNAME, user YOUR_USERNAME + password, time zone, keyboard layout, and enable SSH (password or public key).
  3. Before ejecting the disk, edit config.txt and cmdline.txt on the boot partition (bootfs). On the running system they are /boot/firmware/config.txt and /boot/firmware/cmdline.txt.

config.txt — append at the end of the file:

[all]
#Argon EON RTC (PCF8563) handled by the kernel
dtoverlay=i2c-rtc,pcf8563
#Bluetooth disabled in firmware (not used)
dtoverlay=disable-bt

cmdline.txt — disable UAS on the RTL9210 NVMe adapter. cmdline.txt is one single line: append this to the end of that line, separated by a space, with no line breaks:

usb-storage.quirks=0bda:9210:u

For a different adapter, get its ID with lsusb (format xxxx:xxxx) and use usb-storage.quirks=xxxx:xxxx:u.


2. First boot, SSH and update

ssh YOUR_USERNAME@YOUR_HOSTNAME.local     # or: ssh YOUR_USERNAME@YOUR_NAS_IP
sudo apt update
sudo apt full-upgrade
sudo raspi-config      # Localisation (locales, WLAN country) · Interface Options -> I2C: Enable

Checks:

uname -r; cat /etc/os-release | head -3
lsusb -t        # the RTL9210 must use Driver=usb-storage (not uas)
timedatectl     # System clock synchronized: yes

Raspberry Pi OS Trixie manages the network with NetworkManager. Do not add a second DHCP client (dhcpcd) or entries in /etc/network/interfaces.

nmcli device status
ip route        # there must be ONE single "default" route

Persistent journal. Raspberry Pi OS keeps the journal in RAM (40-rpi-volatile-storage.conf), so it is lost at every shutdown. Make it persistent:

sudo mkdir -p /etc/systemd/journald.conf.d
printf '[Journal]\nStorage=persistent\nSystemMaxUse=1G\n' | sudo tee /etc/systemd/journald.conf.d/90-persistent.conf
sudo systemctl restart systemd-journald
sudo journalctl --flush

3. Argon EON script (official Argon40)

:warning: Do not use curl ... | bash. The installer fetches more files without checking errors, so a failed download can silently leave a broken file (e.g. an argon-shutdown.sh containing “404: Not Found” → the case never cuts the power). Download, review, run, and then check the installed files.

Download and review:

mkdir -p ~/argon-new && cd ~/argon-new
curl -fL -o argoneon-official.sh https://download.argon40.com/argoneon.sh
head -5 argoneon-official.sh     # must start with #!/bin/bash

Disable the final block that runs apt-get upgrade -y and modifies the EEPROM (PSU_MAX_CURRENT, meant for the Pi 5):

grep -n 'eepromrpiscript' argoneon-official.sh
sed 's|^eepromrpiscript="/usr/bin/rpi-eeprom-config"|eepromrpiscript="/does/not/exist/rpi-eeprom-config"  # disabled|' \
    argoneon-official.sh > argoneon-modified.sh
diff argoneon-official.sh argoneon-modified.sh     # exactly ONE line must change

Install:

bash argoneon-modified.sh 2>&1 | tee install.log

Check that no file was left broken:

sudo grep -lE '404|Not Found|<html' -r /etc/argon /usr/lib/systemd/system-shutdown/ | grep -v '\.bin$' || echo "OK"
sudo find /etc/argon -type f -size 0
cat /usr/lib/systemd/system-shutdown/argon-shutdown.sh   # a real script that calls argononed.py SHUTDOWN
ls -l /etc/argon/argonone-ir                            # the hook only cuts the power if this file exists
systemctl is-active argononed

The RTC is handled by the kernel (step 1), so argoneond must not access the chip:

sudo systemctl disable --now argoneond
sudo systemctl mask argoneond

Note: with argoneond masked, do not use the “RTC Schedules” option in the Argon menus.

Fan curves:

sudo nano /etc/argononed.conf        # CPU:  55=30  60=55  65=100
sudo nano /etc/argononed-hdd.conf    # HDD:  30=25  35=50  40=100  45=100  50=100  55=100
sudo systemctl restart argononed

Non-interactive summary command (in the current version argon-status is a menu):

sudo tee /usr/local/bin/argon-summary >/dev/null <<'EOF'
#!/bin/sh
# Non-interactive Argon EON summary
[ "$(id -u)" -eq 0 ] || exec sudo "$0" "$@"
exec /usr/bin/python3 /etc/argon/argonstatus.py temperature "cpu usage" storage raid ram ip
EOF
sudo chmod 755 /usr/local/bin/argon-summary

argon-config opens the Argon configuration menu (OLED, IR…).

Button: hold ~3 s = clean shutdown · double press = reboot · 5 s or more = hard power cut (avoid).


4. RTC clock (kernel driver instead of fake-hwclock)

With the overlay from step 1 the kernel registers the RTC at boot:

sudo dmesg | grep -i pcf8563     # "registered as rtc0"
sudo i2cdetect -y 1              # 0x51 must show UU

Once the time is synced by NTP (timedatectl → synchronized: yes), store it in the RTC and remove fake-hwclock:

sudo hwclock -w
sudo hwclock -r; date            # must match (the RTC keeps UTC)
sudo apt purge fake-hwclock

From now on the kernel updates the RTC from the NTP time every 11 minutes.


5. Webmin

cd ~
curl -o webmin-setup-repo.sh https://raw.githubusercontent.com/webmin/webmin/master/webmin-setup-repo.sh
sudo sh webmin-setup-repo.sh
sudo apt-get install webmin --install-recommends

Open https://YOUR_NAS_IP:10000/ and log in as YOUR_USERNAME (it has sudo; no root password needed).

/tmp is a tmpfs (RAM) on Trixie, so keep Webmin’s temp files on disk:

sudo mkdir -p /var/tmp/.webmin && sudo chmod 700 /var/tmp/.webmin
echo 'tempdir=/var/tmp/.webmin' | sudo tee -a /etc/webmin/config
sudo systemctl restart webmin

6. Cockpit (optional)

sudo apt install cockpit

Open https://YOUR_NAS_IP:9090/.


7. RAID creation (mdadm)

sudo apt install -y mdadm        # also installs exim4 for e-mail alerts
lsblk -o NAME,SIZE,MODEL,SERIAL  # IDENTIFY the disks: HC550 (16 TB) for md0, DC S3700 (400 GB) for md1

Expected layout before partitioning:

NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sda      8:0    0 232,9G  0 disk
├─sda1   8:1    0   512M  0 part /boot/firmware
└─sda2   8:2    0 232,4G  0 part /
sdb      8:16   0 372,6G  0 disk
sdc      8:32   0  14,6T  0 disk
sdd      8:48   0  14,6T  0 disk
sde      8:64   0 372,6G  0 disk

:warning: The next commands erase everything on the disks. Double-check every letter before running them. Never run them on sda.

sudo wipefs --all --force /dev/sdb?; sudo sgdisk --zap-all /dev/sdb
sudo wipefs --all --force /dev/sdc?; sudo sgdisk --zap-all /dev/sdc
sudo wipefs --all --force /dev/sdd?; sudo sgdisk --zap-all /dev/sdd
sudo wipefs --all --force /dev/sde?; sudo sgdisk --zap-all /dev/sde

One partition per disk, of type “Linux RAID” (FD00):

sudo sgdisk -n 1:0:0 -t 1:FD00 /dev/sdb
sudo sgdisk -n 1:0:0 -t 1:FD00 /dev/sdc
sudo sgdisk -n 1:0:0 -t 1:FD00 /dev/sdd
sudo sgdisk -n 1:0:0 -t 1:FD00 /dev/sde
lsblk     # sdb1, sdc1, sdd1 and sde1 must exist

Create the RAID1 arrays:

sudo mdadm --create --verbose /dev/md0 --level=1 --raid-devices=2 /dev/sdc1 /dev/sdd1   # data
sudo mdadm --create --verbose /dev/md1 --level=1 --raid-devices=2 /dev/sdb1 /dev/sde1   # cache
watch cat /proc/mdstat    # Ctrl-C to exit. The initial sync of md0 takes ~38 h
sudo mdadm --detail /dev/md0
sudo mdadm --detail /dev/md1

Save the configuration (first check that mdadm.conf has no duplicate ARRAY lines) and rebuild the initramfs, which is required so the arrays assemble correctly at boot:

sudo mdadm --detail --scan | sudo tee -a /etc/mdadm/mdadm.conf
sudo update-initramfs -u

The added lines look like this:

ARRAY /dev/md0 metadata=1.2 name=YOUR_HOSTNAME:0 UUID=xxxxxxxx:xxxxxxxx:xxxxxxxx:xxxxxxxx
ARRAY /dev/md1 metadata=1.2 name=YOUR_HOSTNAME:1 UUID=xxxxxxxx:xxxxxxxx:xxxxxxxx:xxxxxxxx

Send mdadm alerts (addressed to root) to your user’s mailbox and test them:

echo 'root: YOUR_USERNAME' | sudo tee -a /etc/aliases
sudo newaliases
sudo apt install bsd-mailx                      # "mail" command to read them
sudo mdadm --monitor --scan --oneshot --test    # one TestMessage per array must arrive (read with: mail)

Note: the mdadm 4.4 monitor logs DeviceDisappeared /dev/md/md0 + NewArray /dev/md0. It is harmless (no e-mail is sent). Do not rename the arrays, or md0/md1 would break.

:warning: Until the clean-stop service is installed (step 10), do not reboot or shut down while md0 is syncing.


8. LVM with SSD cache (writethrough)

sudo apt -y install lvm2

sudo pvcreate /dev/md0
sudo pvcreate /dev/md1
sudo vgcreate VG /dev/md0 /dev/md1
sudo lvcreate -l 100%FREE -n DATA_PiNAS VG /dev/md0
sudo lvcreate -L 360G -n lv_cache VG /dev/md1
sudo lvcreate -L 360M -n lv_cache_meta VG /dev/md1
sudo lvconvert --type cache-pool --cachemode writethrough --poolmetadata VG/lv_cache_meta VG/lv_cache
sudo lvconvert --type cache --cachepool VG/lv_cache VG/DATA_PiNAS

sudo lvs -a -o+devices,cache_mode   # DATA_PiNAS cached in writethrough mode

Resulting layout (sdd and sde look like sdc and sdb):

sdb                             8:16   0 372,6G  0 disk
└─sdb1                          8:17   0 372,6G  0 part
  └─md1                         9:1    0 372,5G  0 raid1
    ├─VG-lv_cache_cpool_cdata 253:1    0   360G  0 lvm
    │ └─VG-DATA_PiNAS         253:0    0  14,6T  0 lvm
    └─VG-lv_cache_cpool_cmeta 253:2    0   360M  0 lvm
      └─VG-DATA_PiNAS         253:0    0  14,6T  0 lvm
sdc                             8:32   0  14,6T  0 disk
└─sdc1                          8:33   0  14,6T  0 part
  └─md0                         9:0    0  14,6T  0 raid1
    └─VG-DATA_PiNAS_corig     253:3    0  14,6T  0 lvm
      └─VG-DATA_PiNAS         253:0    0  14,6T  0 lvm

File system:

sudo mkfs.ext4 -m 0 -E lazy_itable_init=0,lazy_journal_init=0 /dev/VG/DATA_PiNAS
sudo mkdir -p /mnt/STORAGE
sudo blkid /dev/VG/DATA_PiNAS     # copy the UUID
sudo nano /etc/fstab

Add this line to /etc/fstab (with the real UUID):

UUID=<DATA_PiNAS-UUID> /mnt/STORAGE ext4 nosuid,nodev,nofail,x-gvfs-show 0 0

Mount it:

sudo systemctl daemon-reload
sudo mount -a
df -h /mnt/STORAGE
sudo chmod 777 /mnt/STORAGE   # full access for every user on the network: consider whether this suits you

9. Samba

--no-install-recommends avoids installing winbind (AD domain), which hooks into PAM/NSS and is not needed here:

sudo apt install --no-install-recommends samba samba-common-bin
dpkg -l | grep -E 'winbind|samba-ad-dc' || echo "OK: no winbind or samba-ad-dc"
sudo cp /etc/samba/smb.conf /etc/samba/smb.conf_backup
sudo nano /etc/samba/smb.conf

Append at the end of smb.conf:

[STORAGE]
   comment = STORAGE on Argon EON
   path = /mnt/STORAGE
   read only = no
   writeable = yes
   browseable = yes
   guest ok = yes

guest ok = yes gives access without a password to anyone on the local network. Use guest ok = no if you don’t want that.

Samba user (your PC connects as YOUR_USERNAME):

sudo smbpasswd -a YOUR_USERNAME

Make Samba always start after the mount and stop before the unmount (the mount uses nofail):

sudo mkdir -p /etc/systemd/system/smbd.service.d
printf '[Unit]\nAfter=mnt-STORAGE.mount\n' | sudo tee /etc/systemd/system/smbd.service.d/storage.conf
sudo systemctl daemon-reload
testparm -s
sudo systemctl restart smbd nmbd
systemctl is-active smbd nmbd

10. Clean RAID stop on shutdown/reboot (essential)

Without this, md0 can come up “not clean” after a shutdown or reboot (non-fresh member / bitmap out of date → a resync of up to ~38 h). blk-availability does not guarantee a clean stop with an LVM cache spanning two RAID arrays. This service unmounts, deactivates LVM and stops the arrays in order before power-off.

The script:

sudo tee /usr/local/sbin/nas-clean-stop >/dev/null <<'EOF'
#!/bin/sh
# Clean stop on shutdown/reboot: /mnt/STORAGE -> LVM (VG) -> md0/md1
PATH=/usr/sbin:/usr/bin:/sbin:/bin
log() { echo "nas-stop: $*"; }

for m in md0 md1; do
  [ -e /sys/block/$m/md ] && log "$m before: $(cat /sys/block/$m/md/array_state) / $(cat /sys/block/$m/md/sync_action)"
done

if mountpoint -q /mnt/STORAGE; then
  log "WARNING: /mnt/STORAGE was still mounted; unmounting it"
  fuser -vm /mnt/STORAGE 2>&1 | sed 's/^/nas-stop: /'
  umount /mnt/STORAGE || { log "ERROR: could not unmount /mnt/STORAGE"; exit 1; }
fi

vgchange -an VG || { log "ERROR: vgchange -an VG failed"; exit 1; }
mdadm --wait-clean --scan
for m in md0 md1; do log "$m after deactivating LVM: $(cat /sys/block/$m/md/array_state 2>/dev/null)"; done
mdadm --stop /dev/md0 /dev/md1 && log "OK: md0 and md1 stopped and clean"
sync
EOF
sudo chmod 755 /usr/local/sbin/nas-clean-stop

The systemd unit:

sudo tee /etc/systemd/system/nas-clean-stop.service >/dev/null <<'EOF'
[Unit]
Description=Clean stop of STORAGE, LVM and RAID (NAS)
DefaultDependencies=no
Conflicts=shutdown.target
Before=shutdown.target mnt-STORAGE.mount
After=blk-availability.service lvm2-monitor.service

[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/usr/bin/true
ExecStop=/usr/local/sbin/nas-clean-stop
TimeoutStopSec=300

[Install]
WantedBy=multi-user.target
EOF

sudo systemd-analyze verify /etc/systemd/system/nas-clean-stop.service
sudo systemctl daemon-reload
sudo systemctl enable --now nas-clean-stop.service

About the ordering: at shutdown systemd stops units in reverse start order, so Before=mnt-STORAGE.mount makes the script run after the unmount, and After=blk-availability.service makes it run before blkdeactivate.

Test without rebooting:

sudo systemctl stop smbd nmbd
sudo systemctl stop mnt-STORAGE.mount
sudo systemctl stop nas-clean-stop.service
journalctl -u nas-clean-stop -b --no-pager | tail   # must end with "OK: md0 and md1 stopped and clean"

Undo the test:

sudo mdadm --assemble --scan
sudo vgchange -ay VG
sudo systemctl start mnt-STORAGE.mount
sudo systemctl start smbd nmbd nas-clean-stop

Real test — reboot, then check:

sudo reboot
sudo dmesg | grep -E 'md/raid1|not clean|out of date'   # only "active with 2 out of 2 mirrors"
journalctl -b -1 -u nas-clean-stop --no-pager

11. Unneeded services

Check what is active and disable what you don’t use (depending on the image, some may not be installed):

for s in ModemManager bluetooth hciuart cups cups-browsed rng-tools-debian; do
  printf '%-18s %-9s %s\n' "$s" "$(systemctl is-enabled $s 2>/dev/null)" "$(systemctl is-active $s 2>/dev/null)"
done
sudo systemctl disable --now ModemManager.service                 # no modem
sudo systemctl disable --now bluetooth.service hciuart.service    # Bluetooth already off in firmware
  • If CUPS (printing) is present: sudo systemctl disable --now cups.service cups.socket cups.path cups-browsed.service
  • rng-tools-debian is not needed: the kernel uses the Pi’s hardware RNG directly.
systemctl --failed
sudo ss -tulpn    # ports: 22 SSH, 139/445 Samba, 10000 Webmin, 9090 Cockpit, 5353 avahi

12. Day-to-day use

Action Command
Shut down sudo poweroff (or button ~3 s): clean stop, then the case cuts the power by itself
Reboot sudo reboot
Scheduled shutdown / cancel sudo shutdown -h +10 / sudo shutdown -c

After each backup, unmount the STORAGE share on the PC.


13. Utilities

Argon EON summary and menu:

argon-summary    # temperatures, CPU, storage, RAID, RAM, IP
argon-status     # interactive Argon menu (0 to exit)

Temperatures:

vcgencmd measure_temp
for d in sdb sdc sdd sde; do echo -n "$d: "; sudo smartctl -d sat -A /dev/$d | awk '/Temperature_Celsius/ {print $10 " °C"}'; done
sudo smartctl -d sntrealtek -A /dev/sda | grep -i temperature    # NVMe behind the RTL9210

S.M.A.R.T.:

sudo smartctl -d sntrealtek -a /dev/sda   # Samsung 980 NVMe behind the RTL9210 adapter
sudo smartctl -d sat -a /dev/sdb
sudo smartctl -d sat -a /dev/sdc
sudo smartctl -d sat -a /dev/sdd
sudo smartctl -d sat -a /dev/sde
for d in sdb sdc sdd sde; do sudo smartctl -d sat -H /dev/$d | grep overall; done

RAID and cache:

cat /proc/mdstat    # md0 and md1 at [UU]
sudo mdadm --detail /dev/md0
sudo lvs -a -o+cache_mode,cache_dirty_blocks,cache_read_hits,cache_read_misses

Troubleshooting:

journalctl -b -1 --no-pager | tail -50       # end of the previous boot (the shutdown)
journalctl -p err -b --no-pager | tail -30   # errors in the current boot
mail                                         # mdadm alerts (message number to open, q to quit)
timedatectl; sudo hwclock -r                 # system time and RTC time (UTC)