-
1Get Pi running and install OpenMediaVault
Follow the instructions in this excellent video which shows you how to install OMV on a Raspbian Buster Lite OS.
I cannot emphasise enough the need to use a microSD card from a reputable source (e.g. physical shop). I have wasted hours on this project battling with low quality and/or fake cards! There, I told you.
Probably best not to use the RPi4 image on the OMV website, as the folk on there point out that it's based on an unsupported Armbian OS.
Also, before plugging the microSD card in, write a blank file called "ssh" to the /boot folder, to enable ssh without needing a keyboard and screen plugged in. This saved me heaps of time!
Once OMV is installed, do all the updates, configure the disks/shares etc. according to the OMV documentation.
-
2Configure the Pi power management
ssh in and edit /boot/config.txt using e.g. pico:
sudo pico boot/config.txt
...then add the following two lines to the end and save:
dtoverlay=gpio-shutdown,gpio_pin=17,active_low=1,debounce=1500 dtoverlay=gpio-poweroff,gpiopin=27,active_low=1,input=1
While you're at it, maybe consider commenting out some of the other unwanted stuff, like audio and 3D support.
In conjunction with the little circuit I described, PGOOD and nSHDN connected to pins GPIO17 and GPIO27 respectively you should be protected against power outages.
-
3Make the SSDs behave!
I had loads of problems with the NAS appearing and disappearing from remote connections (e.g. from Windows), pausing during audio/video playback, hanging, etc. It seems that the SSDs were not happy, and getting repeatedly reset. This article explains what to do in detail.
tl;dr version here:
Edit boot/cmdline.txt and add the following to the start of the line that's there:
usb-storage.quirks=aaaa:bbbb:u
...where aaaa and bbbb are the idVendor and idProduct codes for your SSD(s).
-
4Permit logging to RAM to prolong the life of the microSD card
Install Log2Ram approximately following the instructions here (but installing git first, and with a few more sudo's). Logging is a key source of regular writes to SD card, so this forces the log to be written into RAM and then only moved onto SD card once per hour.
Increase time between commits from the default (every 5 seconds) by adding something like
commit=60
...to the line corresponding to the SD card in /etc/fstab. This apparently reduces the likelihood of small writes (and the accompanying erasure and re-writing of the associated whole blocks) in favour of aggregating writes into larger chunks (i.e. fewer whole blocks are erased and rewritten), reducing the wear on the SD card.
-
5Check the 'power button' functionality is correct
in OMV, go to System->Settings->Power Button and make sure 'Shutdown' is selected. (I think the default is 'Nothing'). Without this, the GPIO-initiated shutdown will be ignored. That took many hours and the folks at the Raspberry Pi forum to work out!
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.