Skip to content

A boilerplate project for setting up Arch linux on [headless] ARM5 hardware

License

Notifications You must be signed in to change notification settings

dmitrychebayewski/archlinuxarm-nsa325

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Project status

The project is not maintained anymore. It is here for historical reasons. Described solutions are for 1.2 GHz Marvell Kirkwood 6281 ARM-compatible CPU, a.k.a. Feroceon, ARMv5te architecture which is now abandoned platform. Still, you're able to use Arch Linux Arm, kernel 4.4 Super Long Term Support EOL February 2022 on this platform.

What it is

This documentation describes how to install and update Arch Linux Arm (alarm) server on ZyXEL NAS platform. I am using ZyXEL NAS device as Arch Linux Arm (alarm) for hobby projects. ZyXEL NSA-325

Purpose

The project goal is provding simple and reliable file storage service for a home office. If you're looking for an affordable solution for offloading your old pictures, documents, music, and if you want to access your documents, music, pictures occacionally, keeping them safe offline otherwise, this project could mean a good opportunity for you!

Features

This setup features simple file sharing over SMB / netbios protocol and provides administrative access over ssh.

Usage/examples

Once the NAS is started and connected to home network, one can login in to NAS using ssh:

ssh user@alarm

and complete some elementary Unix administration tasks such as managing system backups and updates, adding new hard drives, mounting hard drives, installing and configuring new software, adding new users, adding access rights and so on.

On your PC (Windows 10 or any other OS) just open exporer and go to shared resorce:

\\alarm\your_resource
\\alarm\your_home_directory

Installation

Installation is simple. Once you have decided to switch your ZyXEL from factory OS to Arch Linux arm (alarm), you will need to complete 2 tasks:

  • Download the Alarm package from Arch Linux ARM web and copy files from provided tar to your HDD or SSD. You can adapt the provided script, restore_root_fs for this kind of job.
  • Modify ZyXEL NAS bootloader options to boot from HDD. The procedure is reversible so that you can switch back to factory OS. The instruction is described in set_bootloader_options

There might be additional steps required to create bootable Alarm disk. I used Arch linux Vagrant image for virtualbox, available on the Vagrant Cloud, to make a bootable Alarm disk.

Partitioning a hard drive

See restore_roott_fs

Making bootable partitions

See restore_root_fs

Adding record(s) to /etc/fstab to mount the bootable partition at /boot

more about bootable partition mount

# <file system> <dir> <type> <options> <dump> <pass>                                                                          /dev/sda1     /boot        ext2 rw,relatime     0        2   
 

Installing HDD /SSD

Once bootable Alarm SSD / HDD is prepared, install it in Slot 0 of your NAS.

Starting NAS first time

  • Connect NAS to your LAN;
  • Switch on your NAS;
  • Wait for leds to settle.

Looking up NAS IP address

You can look up your NAS IP address with the following Windows 10 command:

arp -a

First ssh login

Login using the credentials provided with Alarm distributive:

> ssh alarm@alarm
alarm@alarm's password:
[alarm@alarm ~]$

Changing default passwords

Immediately change the passwords of root and alarm users:

[alarm@alarm ~]$ su
Password:
[root@alarm alarm]# passwd root
New password:

Synchronize the clock

Make sure the system clock is accurate.

#timedatectl set-ntp true

Signing packages

See provided script upgrade_system

Updating Arch linux

See provided script: upgrade_system

Installing packages

See provided script: install_packages

Add data volumes to your system

See provided script:

Adding sudo users

See proviced script: add_wheel_users

Setup tasks

Update Arch Linux

It is a best practice to update your server on a regular schedule for security and stability. Use this instruction to keep your Arch server updated. Visit the Arch Linux homepage, to see if there have been any breaking changes to packages that you have installed recently. If there are, there may be manual intervention required after the upgrade.

  1. Update Respoitories This will update the package databases for each of the repositories on your system.
$ sudo pacman --sync --refresh
  1. Update PGP Keys Update the local database of PGP keys used by the package maintainers. This step is optional, but may prevent problems later on with the upgrade if the database has not been updated for some time.
$ sudo pacman --sync --needed archlinux-keyring
  1. Update the System Upgrade all system packages. Be sure to note the upgraded packages and any output that requires your attention during the upgrade process.
$ sudo pacman --sync --sysupgrade

Set up SSH

Please study Arch Linux documentation. The documentation that I found on Vultr is excellent, too! You might need to change default values, provided in /etc/sshd_conf

Match User secret
PasswordAuthentication yes

Installing and setting up Samba

Please study Arch Linux documentation.

Adjust SMB browsing behavior in macOS

Speed up browsing on network shares

To speed up SMB file browsing, you can prevent macOS from reading .DS_Store files on SMB shares. This makes the Finder use only basic information to immediately display each folder's contents in alphanumeric order. Use this Terminal command:

defaults write com.apple.desktopservices DSDontWriteNetworkStores -bool TRUE

Then log out of your macOS account and log back in. To reenable sorting, use this command:

defaults write com.apple.desktopservices DSDontWriteNetworkStores -bool FALSE

Update strategy

Citaton from Vultr documentation

Because Arch is a "rolling release", you can upgrade all packages you have installed whenever you'd like. Users may upgrade on their own schedule, daily, weekly and so on. If you upgrade often, not many packages will need to be upgraded at once, and any potential problems you may run into will be easier to pinpoint. It is important to upgrade all packages at once, as the following command will do. It's easy to imagine why upgrading something like "glibc" alone, without the programs that use it, would cause problems.

The choice of mine is bi-weekly update schedules. This way I am able to keep system updates not huge, and keep risks of update conflicts reasonably low.

Backup strategy

Before upgrading all packages, it is crucial that you make full system backup. "Full ssystem backup with tar" strategy, explained in details on Arch linux documentation page, apeared to be effective and very useful for a small project like this. Sample script which makes things done could look like backup_root_fs. Tar backup, produced with above script, is very quickly restored to boot HDD/SSD with the following script: restore_root_fs It is very recommendable to restore your backup on your second HDD drive immediately, as your backup job is done. Then, you always have a swap bootable HDD.

Scheduled backup

Create the following files in /etc/systemd/system/

Start backup.timer and enable it on boot.

#systemd-analyze verify /etc/systemd/system/backup.*
#systemctl start backup.timer
#sudo systemctl enable backup.timer

Productivity

Using tmux

It is very convenient to run long during processes (copying files etc.) in tmux.

Take more of your hardware

Docker

You can install Docker and let Docker run endless useful services packaged as Docker containers!

Asking questions

Q. What are benefits of NAS for home office over external USB drive?

External USB drive cannot be set up as a small file server. So, using NAS, you can collaborate on hobby projects with your partners, and no one needs to use a private computer as file server.

Q. What are advantages of Arch Linux ARM over factory ZyXEL Nas OS?

Arch Linux Arm is one of a few maintained OS (kernel 4.4) that supports ARMv5te architecture.

Q. What were disadvantages of Arch Linux Arm customisation compared to factory ZyXEL Nas OS?

Factory ZyXEL NOS was reportedly an assembly, based on "Das U-Boot" and Arch Linux Arm (see the article, "Building the Zyxel NAS326" on Craig Amos's blog). But factory configuration uses a ramdisk to load the Linux kernel, leaving 2 SATA slots available for RAID1 setup. Arch Linux Arm (alarm) rootfs needs one SATA interface for a drive with boot and rootfs partitions, leaving 1 slot available for user data hard drive. It is not the optimal use of your system as you cannot configure RAID1, with potential of 2 HDD connections.

Contributing

Feel free to ask questions, make branches and submit pull requests.

Authors/maintainers

Authorship is always mentioned in the scripts directly, when it is known. Otherwise, I, Dmitry Chebayewski is the author and maintainer of this project

License

MIT License is applicable

About

A boilerplate project for setting up Arch linux on [headless] ARM5 hardware

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages