How to build a stable Volumio running 24/7

Hello
i’m not an expert so i probably write stupid things…
my post is two-fold

  • part 1 explains my “project of having a volumio running 24/7 safely”
  • part 2 is my questions to adress successfully part 1

my config = rpi b and volumio 2 version 1.001 ,i will try with my rpi 3 too

part 1 : volumio running 24/7 safely
i know there is a topic about the question of running volumio 24/7
it was mainly related about the size of logs ; https://volumio.org/forum/raspberry-and-volumio-left-t3097.html

in order to answer to the question “what should i do to have volumio running safely everyday”
i would list several topics i want to address

1/ some UPS solution that prevent volumio from being powered off and therefore damage SD card
for this, i found out some interesting informations
http://raspi-ups.appspot.com/en/hardware.jsp
the idea is pretty simple. you need
a- a battery that can charge and be plugged to 220V in the mean time, and switch instantly if there is a power outage. the reference of the battery is indicated into this web page listed above
b- a cron job that verify regurlarly if you’re online, because if there isnt any power for the raspberry, probably no more power for your intnernet access

2/ some maintenance tricks or setup that prevent my USB disk to run 24/7 when not used
i would have 2 needs
a- spin down the disk when not in use after X minutes : using hdparm (used it on rpi 1b with volumio 1,5, ok) , or may be hd-idle or sdparm (not sure)
b- monitor the health of the disk with smartmontools, specially because i do not want my usb music collection to crash
https://blog.shadypixel.com/monitoring-hard-drive-health-on-linux-with-smartmontools/

3/ some way to minimize the SD card access, in “write mode”
that’s the point of removing as much “log writing as possible”
https://volumio.org/forum/raspberry-and-volumio-left-t3097.html

4/ may be a way to boot on sd card and then to run volumio from a usb disk or usb key, to even minimize the SD card usage
i have understood it is possible, but i dont know how to apply it with volumio ?
may be do a root-fs image of volumio and then use berryboot, but i’m not sure i’m not mixing information ??

part 2 : my questions

my priority is to spin down my hard disk
i tried to follow the procedure described here
http://www.htpcguides.com/spin-down-and-manage-hard-drive-power-on-raspberry-pi/

and typed the command :
" sudo apt-get install hdparm -y"

i had an error

[code]"Reading package lists… Done
Building dependency tree
Reading state information… Done
Package hdparm is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package ‘hdparm’ has no installation candidate"[/code]

when i tried to fix this errog according to this source
https://www.blackmoreops.com/2014/12/13/fixing-error-package-packagename-not-available-referred-another-package-may-mean-package-missing-obsoleted-available-another-source-e-pa/
but it did not work

Question 1: is there any reason why we could not install this package on volumio 2 ?

Question 2 : googling “volumio hdparm”, i found some information on github and i was wondering if hdparm was installed in volumio 2
https://github.com/volumio/RootFS/blob/master/etc/default/hdparm
but i could not find any hdparm.conf file in /etc

question 3 : any way to configure volumio to run from a usb device (stick or partition in my usb disk) ? can we follow the procedure described below and if yes how ? or anything better ?
https://www.raspberrypi.org/forums/viewtopic.php?f=29&t=44177

question 4 : any other topics i would have forgot to make a 24/7 configuration more robust and stable ? any feedback from existing configurations that runs 24/7 ?

thanks for any feedback, posts or reply
regards
eric

Dear Eric,
I think you’ll be happy to know that we implemented already every possible measure in Volumio2 to run 24/7 and to minimize SD Card wear.

Some infos:

  • OS is loaded on Ram on each boot and writes to disk are synced very rarely (mainly on shutdown or when you apply configs or scan library)
  • Removing power will not result in any damage, worst case scenario the last setting you’ve applied would not persist
  • Logs are minimal and they are not written to SD Card

That being said, I would suggest to use rpi3, since it has 1GB of RAM. Running Volumio2 on devices with less than 1gig will require a swap file, which will decrease your SD Card duration.

As per hdparm, retry to install with this command

It was not installing before because you did not update sources list (apt-get update)

Hope that helps! Let me know how your project goes, running 24/7 for long periods of time is a priority for us! :wink:

Dear Michelangelo

that’s pretty cool all these improvements …
i must say i’ve been wondering what were all the improvements made with volumio 2 and i could not find the info,or may be i did not look at the right place.
i’m going to go on with 2 versions on volumio running on 2 differents pi
thanks again for the (very good) work done

so the UPS stuff, for is not necessary anymore AFAIU …

regards
eric

for the hdparm stuff for spinning down usb external disk after a certain time of inactivity
With volumio 2, if i get it right, there is no such feature ?

thanks
e

No, but we could add it in the future :wink:

ok
in the meantime,installed it according to your help
and it works ,spinning down after 10 min
thanks
eric

If you start playing some files after the hard drive was spinned down, does it work?

when my drive went into “standby” mode, or spinned down
i just need to press “play”, and it’s playing instantly (i cannot really see a difference with the drive “not spinned down”,although there surely is some difference).
so for me it’s perfect in terms of “saving my disk life” and “not decreasing the ease of use of volumio”

the next step , for me, will be to use smartmontools to monitor regularly the health of the hard disk, but this external disk does not support…so i’m sure my music library is monitored…

by the way, i have another question : how can i drop files from a windows PC into the USB hard disk attached to volumio. I could see it with volumio 1.5 and i dont see it anymore.

Just to give my two cents, I have Volumio running 24/7 for several weeks now without major issues. It plays and plays and plays, no problems whatsoever. So for me it certainly is not feature complete yet but it is very stable as in it does not crash (yet) and plays just fine. It is only rebooted every once in a while for updates.

Hi
Very useful post for me as I would like to spin down my usb hard disk after 10 minutes or so of inactivity. I have installed hdparm as instructed above. What should I do now? I would obviously like the command to be loaded automatically each time I boot up. Should I add something to rc.local?
Thanks for your help.
Ian

Hi Ian

the procedure is described in details here
https://www.htpcguides.com/spin-down-and-manage-hard-drive-power-on-raspberry-pi/

in particular, this section :
Time to make hdparm configurations permanent edit the configuration file

sudo nano /etc/hdparm.conf

The spindown_time value is multiplied by 5 and you have the total time in seconds. So a value of 120 yields 10 minutes (120*5=600).

Enable write cache and spindown time by adding this text to the bottom of the file

/dev/sda {
write_cache = on
spindown_time = 120
}

Restart the hdparm service

sudo service hdparm restart

this should now be permanent
regards
eric

Hi Eric,
Thanks for the prompt reply. Seems to be working fine. I did it a slightly different way (not sure if there are any disadvantages in this, I am far from a Linux expert) in that I entered:
hdparm -B127 -S120 /dev/sda2
into my rc.local file.
I checked with hdparm -C /dev/sda2 and it does return “standby” after a while.
Thanks again,
Ian
PS Enjoying “The Young and the Restless” by Tide Lines as I write - recommend them - great Scottish band.

hello Chinaski
dont worry for your english, i’m french too :wink:
i’m really not a linux expert so all i know is on this thread
did you follow the procedure described here https://www.htpcguides.com/spin-down-and-manage-hard-drive-power-on-raspberry-pi/

more precisely, when you type

sudo hdparm -y /dev/sda
sudo /usr/sbin/hdparm -y /dev/sda

You should get output like this indicating a successful standby command

**/dev/sda:**
** issuing standby command**

did you get this message ?
if yes, its a first step.
if not, you may have to use instead hd-idle or sdparm, but i have never used them.

last point : in my search of a 24/7 volumio with a usb drive, i must confess that it does not work yet, the last version installed 2.861 works perfectly for days without any drop out, but lasts not more than one day if i plug the usb drive and the hdparm setup.
i will investigate …

best regards (bonne chance)
eric