SD card life while using this OS

Raspberry Pi related support

SD card life while using this OS

Postby Samsonite801 » 10 Sep 2016, 22:41

Hello all,

I have a question about how the OS works on Rune Audio deployment for Raspberry Pi.

In the Raspberry Pi community, it has become popular by some who are using Linux (Raspbian, & others) in deployments where the system will be powered-on 24x7 that they perform modifications to the OS and grub bootloader to use tempfs (ram disk) to either load logging, swapping and other things which write to SD card, to write only to ram disk, or to simply copy the entire root fs on boot to the ram disk so that the SD card can be completely removed and the OS will function normally without it. Then usually there may be some procedure to copy configuration changes back to the SD card, could be on a schedule (common on enterprise OS implementations like with VMware ESXi on SD card boot), or by manual means by using 'remount rw' just to copy config changes back, and go back to 'remount ro' when running normally.

How does the RuneAudio OS handle writes to SD Card? I did notice that there is the setting to turn off logging, but what kinds of things make regular writes to the SD card on these?

Where can I learn more about this on the RuneAudio Linux implementation? I prefer to have the SD card only be used for booting, and saving configuration changes back manually or on some schedule, which would allow installing at remote location where SD card is not at risk of failing (where people cannot easily gain access to it for maintenance, for example).

Any thoughts?
Samsonite801
 
Posts: 13
Joined: 10 Sep 2016, 22:20

Re: SD card life while using this OS

Postby hondagx35 » 11 Sep 2016, 17:33

User avatar
hondagx35
 
Posts: 3042
Joined: 11 Sep 2014, 22:06
Location: Germany

Re: SD card life while using this OS

Postby johnbanks » 11 Sep 2016, 22:19

Frank ...
On an RPi I sometimes copy the second ext4 partition to a partition on a USB stick and adjust cmdline.txt to use this.
It 'protects' the SD card and is probably faster.
One can then use a small, low Class & cheap SD card
And in many cases, a large fast USB stick is already being used for the music files.
But perhaps I've got the wrong end of the stick ...
johnbanks
 
Posts: 124
Joined: 11 Jun 2014, 00:16

Re: SD card life while using this OS

Postby hondagx35 » 11 Sep 2016, 22:43

User avatar
hondagx35
 
Posts: 3042
Joined: 11 Sep 2014, 22:06
Location: Germany

Re: SD card life while using this OS

Postby johnbanks » 11 Sep 2016, 23:58

Frank ...
My thinking is ... Statistically the faster the write then the less time spent writing and the lower the chance of the sudden power off occurring during the actual write.
So if using a large fast USB stick for music files, why not use it also for the second ext4 partition?
Just a thought ...
PS: I have 3 NAS's (Debian with WebMin) each has the OS on a USB stick and a second copy USB stick hanging on a short lanyard as backup. Crude but effective has been my experience.
johnbanks
 
Posts: 124
Joined: 11 Jun 2014, 00:16

Re: SD card life while using this OS

Postby Samsonite801 » 12 Sep 2016, 00:30

So I haven't even installed the RuneAudio OS yet. I just found this website a couple days ago, and I am even fairly new to the Raspberry Pi even..

When you refer to ODROID C2, what build is this? Is it the RuneAudio v0.3-beta? I downloaded that one yesterday and am planning to install it on my RPi 3 which is in the mail. I do have an old RPi B, but it does not have much memory as its main purpose is a voltmeter over IP.

I really like the idea you mention about all writes going to SD on shutdown as with that aufs setup. I am not worried about a power loss, since I have battery backup and safe shutdown (upsmon shuts down everything in my environment gracefully in the event of power loss while still on battery power). For me, I am more worried about the life of the SD card since I've read a lot of articles about RPi owners losing SD cards all the time. I like to build set-and-forget solutions since I use many of these things in 'home production' and do not like to worry about having a support nightmare later on.

So you say the aufs setup saves the ramdisk stuff on shutdown? Is there a way to manually sync once in awhile? I know for example on ESXi when deployed on SD card it does not enable scratch or logging on the SD, but it still has automatic provision to save back key conf files every so many seconds, and in fact you can even pull out the SD card and ESXi will only throw error saying it's pulled, but will still run as the active root fs is running in ram. I guess with RuneAudio you have DB's and such which involve more writes and times when the DB could be left in an inconsistent state, but even if maybe once an hour or so it could quiesce and save-back everything?

I don't know, I guess I would be happy having something that at least can save back on shutdown. In that implementation, are all dependencies on the SD card removed? Can I pull the SD card out of the slot while the system is booted? I have pondered before (how I might implement Raspbian on my other RPi), making custom mods to entirely copy the root partition to ramdisk at boot time.. Is this possible or necessary with ODROID C2?
Samsonite801
 
Posts: 13
Joined: 10 Sep 2016, 22:20

Re: SD card life while using this OS

Postby Samsonite801 » 12 Sep 2016, 00:38

Oh nevermind, it looks like ODROID-C2 is something else (just Googled it). You did say that RuneAudio OS does copy some things to SD card.

Are there any plans in the future to use ODROID-C2 style implementation for this project?

Please correct me if I have it all mixed up, as I am still trying to get oriented here.


EDIT:
OK, I think I understand now.. Correct me if I am wrong, but the RuneAudio build made to be for ODROID-C2 hardware will support the aufs setup with sync on shutdown.. Is this what I am gathering? Not for RPi release of RuneAudio?

My thinking for optimal robustness would be to copy root fs and any other local partitions at boot from SD card to ramdisk, then have music files coming from a NAS share (or USB flash if desired), and when system gracefully shutdown, save it back to SD card, so there would be no dependency on the SD card during running. Perhaps scheduled dumps could be made once in awhile to the SD card so if hard shutdown occurred data changes would not result in big losses.
Samsonite801
 
Posts: 13
Joined: 10 Sep 2016, 22:20

Re: SD card life while using this OS

Postby hondagx35 » 12 Sep 2016, 21:00

User avatar
hondagx35
 
Posts: 3042
Joined: 11 Sep 2014, 22:06
Location: Germany

Re: SD card life while using this OS

Postby Samsonite801 » 13 Sep 2016, 03:35

Thanks for the info!

So on the normal build you said only 3 things write to the SD:

"There are only a few task that write directly to SD card:
- redis (our database)
- mpd (our main music player)
- Rune itself (only while in the settings menu)"

How intensive are those writes?

I wouldn't suppose it would be possible to port the ODROID-C2 aufs OS over to Raspberry at some point? I suppose not enough RAM.. Once I play around with RuneAudio for a bit if I like it, I may later buy an ODROID-C2 but for now I am just building POC's on the RPi to start with...
Samsonite801
 
Posts: 13
Joined: 10 Sep 2016, 22:20

Re: SD card life while using this OS

Postby hondagx35 » 13 Sep 2016, 14:25

User avatar
hondagx35
 
Posts: 3042
Joined: 11 Sep 2014, 22:06
Location: Germany

support RuneAudio Donate with PayPal

Next

Return to Raspberry Pi

Who is online

Users browsing this forum: No registered users and 2 guests