Intro
I have had a new Raspberry Pi 4 sitting in a drawer and an urge to look at Linux again so I thought it would be a good time to set it up. The particularly good feature of RPI4 is that it doesnt need a fan. I have a smart electric blue metal case for it which can dissipate heat and keep it safe. As usual I will run it headless. I could probably have a reasonable experience using a desktop but I have an RPI5 waiting which will be better suited.
I want PI43 to do something useful for me and I aim to leave it as a server switched on and unattended. I already have a web server, application server and database server.
A few ideas come up repeatedly, a media server (jellyfin), a backup server (rsync), NAS (openmediavault), cloud server (OpenCloud) and containerised applications (docker).
As OpenMediaVault will potentially work well as a backup or cloud server and allows me to use docker I will set it up and see whether it meets my needs. It will need external USB HDD or SSD. If I had an M.2 hat for PI43 I could have faster SSD storage, but I dont think I need it. I will use an existing Samsung 1TB HDD. I was concerned this wouldn't be appropriate for a NAS, but confirmed that it wont be spinning continually so it should be fine.
OMV Install
pidiylab.com and pimylifeup have simple detailed tutorials on setting up OMV. I mainly followed the pimylifeup tutorial as it mentioned that I need to use RPI OS Bookworm version (rather than Trixie, the latest version) with the current release OMV7 in November 2025. (OMV8 supporting Trixie, the latest version came out in December).
Using RaspberryPi Imager, I created a new Bookworm SD card build and set PI43 up with an ethernet static address.
OMV is installed using a couple of scripts. It has a very simple web interface allowing me to configure disks, file-systems, sharing protocols, shared folders users and permissions.
I connected a 1TB Samsung M3 USB portable HDD which have previously used for backups.
I then enabled Samba in OMV, setup a shared folder on the samsung drive and created a backup user.
I also set the "spin down" time to 5 minutes and enabled S.M.A.R.T. drive monitoring.
Review
At its simplest, all I have done is setup a Samba folder on PI43 which I can easily access from Windows. I can also use it on iPad (using Files), Android (Samsung MyFiles) and Linux (mount command). OMV improves on basic Samba by letting me setup multiple shared folders on the same drive through a simple interface. I can easily setup users and permissions for appropriate access. Usually with Samba I faff around each tiime I need to access a drive. OMV makes Samba a lot more friendly.
The OMV install hasn't "taken over" the server, I still have the usual PI OS capabilities available to me. It is a bit more than an app and a less than an OS.
Backup
My first use for the OMV NAS is to improve my existing RPI backup arrangements. Until now backups have been totally inadwuate based on very occasional rpi-clone system copies and sometimes copying zipped directory structures to other systems. Even if a backup exists I have trouble finding it.
rsync is a widely used command line utilitiy for linux backups. It is used to copy directory structures to another drive. A regular backup will only copy any changed files across, so it doesn't use very amounts of storage. It is perfectly suited to use Samba shares on a remote devices.
I found a suitable simple tutorial at jumpcloud and started to setup a backup for PI40, which is most in need of attention. You specify a starting directoy (/home/pi in the example), folders you want to exclude and the target Samba folder.
You can run this script as often as you like and it will mirror any file/folder additions/changes/deletions across. You can also specify a "dry-run" option which just shows you what would be backed up. This makes it very easy to get the syntax and arguments just like you want them.
However there is a better way to use rsync. rync can use ssh to communicate with the backup server. I just needed to make sure that PI40 had ssh credentials for automatic signon to PI43. After that I didn't need to worry about Samba shares. Veronica Explains provided an enjoyable tutorial.
I quickly setup a simple backup.
After a little more trial and error I setup script to backup important PI40 folders that I didn't want to lose.
They backup to a folder PI40 on the samsung_backup share.
Finally I added this script as a CRON job to run monthly
Outro
We now have a new server which makes its storage available for easy use by other systems.
We also have a solid backup system which makes it easy to backup RPI files on a regular basis.
No comments:
Post a Comment