Thank you for your donation!


Cloudsmith graciously provides open-source package management and distribution for our project.


Operating system in RAM
#1
Hello all,

I have a request for you.
Would it feasible to load the entire operating system into RAM, at boot, and run it from there?
I'm asking because in my daily job, we use industrial windows 10 terminal (HMI) connected to our devices; since our customer power off the device through a hardware switch, we need to "protect" Windows 10 from errors.
What our terminals do is to load a saved image of Windows 10 from a read-only disk, at boot; every single modification, cache write, whatever are saved into the RAM copy of the O.S.; when the user switch off and then on again the machine, the original copy is loaded again from the disk.
I know we cannot have a read-only disk, but it would be great to have a copy of the O.S. in RAM.
This would be useful (at least for me), because now my moode box is powered on and off with the main switch of the power amplifier, so I cannot shutdown properly moode audio.
My fear is that one day, Moode audio will not boot anymore due to some write error on disk.

If the above request is not feasible, is there any other setting/modification to the O.S. I can implement to reduce the risk?
Reply
#2
The OS is already running entirely in RAM. The disk based memory swap file is disabled.

AFAIK the only solution to avoid abrupt power off is to have some sort of UPS or UPS HAT board that would provide enough time to do a power off from the Menu or via some sort of script attached to a GPIO pin.
Enjoy the Music!
moodeaudio.org | Mastodon Feed | GitHub
Reply
#3
Better than a UPS is Phill's wondrous Hypnic supply for controlled shutdowns and power management. Smile

https://www.diyaudio.com/forums/pc-based...-sbcs.html
----------
bob
Reply
#4
(08-18-2021, 09:04 PM)DRONE7 Wrote: Better than a UPS is Phill's wondrous Hypnic supply for controlled shutdowns and power management. Smile

https://www.diyaudio.com/forums/pc-based...-sbcs.html

Slick use of supercapacitors!
Reply
#5
Wow, this is really nice!
Reply
#6
(08-18-2021, 01:50 PM)Tim Curtis Wrote: The OS is already running entirely in RAM. The disk based memory swap file is disabled.

AFAIK the only solution to avoid abrupt power off is to have some sort of UPS or UPS HAT board that would provide enough time to do a power off from the Menu or via some sort of script attached to a GPIO pin.

This is really nice!
My original post lost its meaning, sinse you already had took the right steps to avoid corruption on a dirty shutdown.
So, do you feel the operating system is safe?
I mean, do you think I can securely power off my media player without shutting it down "correctly"?
Have you experienced any data loss or corruption in the past?
I could easily build something like the Hypnic power supply (I'm an electronic engineer, working with microcontrollers), but I would avoid it, if I can.
Reply
#7
(08-19-2021, 09:24 AM)croccodillo Wrote:
(08-18-2021, 01:50 PM)Tim Curtis Wrote: The OS is already running entirely in RAM. The disk based memory swap file is disabled.

AFAIK the only solution to avoid abrupt power off is to have some sort of UPS or UPS HAT board that would provide enough time to do a power off from the Menu or via some sort of script attached to a GPIO pin.

This is really nice!
My original post lost its meaning, sinse you already had took the right steps to avoid corruption on a dirty shutdown.
So, do you feel the operating system is safe?
I mean, do you think I can securely power off my media player without shutting it down "correctly"?
Have you experienced any data loss or corruption in the past?
I could easily build something like the Hypnic power supply (I'm an electronic engineer, working with microcontrollers), but I would avoid it, if I can.

I've been powering down two moOde systems for months by just pulling the power.  I control them both via an Android mpd client, which as far as I can tell has no way of powering down the server politely, and the moOde web interface is not usable on a phone.  Perhaps I've been lucky.  But I'm not sure what exactly could get corrupted.   Perhaps you'd catch the log writing in /var/log at a bad time, or the mpd playlist files?
Reply
#8
@Sehnsucht:

The same here, a moode system controlled by three different mobiles (three family members), using M.A.L.P.
it is working flawlessy for at least 6 moths.
Probably my fear is not justified, and feeded by what I experienced before with Windows 10 terminals.
But I know W10 and Raspbian are two different animals.
Reply
#9
(08-19-2021, 10:58 AM)croccodillo Wrote: @Sehnsucht:

The same here, a moode system controlled by three different mobiles (three family members), using M.A.L.P.
it is working flawlessy for at least 6 moths.
Probably my fear is not justified, and feeded by what I experienced before with Windows 10 terminals.
But I know W10 and Raspbian are two different animals.

I've read loads about Raspbian "corrupting" SD cards, but it's never been clear to me if it's meant a few files are corrupt, or the OS doesn't boot, or the SD card is physically damaged and unusable in any way.  If I were using a Pi in a way which required me to store a lot of info in a database/files I'd take great care to shut down nicely so that processes could be stopped properly; transactions allowed to complete; files get synced/flushed to SD card/USB drives.  I use M.A.L.P. too - it's great.  I delete/copy music over via Samba and I suspect that this is being written properly to the disk immediately.
Reply
#10
IME SD card failure is rare. I've maybe had 4 cards die in over 6 years. The cards in my test systems get completely slammed with writes during development and abrupt power offs happen often.
Enjoy the Music!
moodeaudio.org | Mastodon Feed | GitHub
Reply


Forum Jump: