WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: basic questions  (Read 2745 times)

Offline LazyLarry

  • Newbie
  • *
  • Posts: 42
basic questions
« on: August 22, 2013, 12:48:57 PM »
bit of a noob here, but i have some hopefully simple questions. I need an embedded system that will survive a powerfail and am looking at ram based linux. TC seems particularly sweet. I have my own application that writes to a mysql DB and i wonder if TC is the correct platform for me. Having everything in RAM is great, but how are any changes to the DB saved if the power is unplugged from the motherboard? (ie not an orderly shutdown). THe problem we've been having running ubuntu from a CF card is that we sometimes get a corrupted CF card when the plug is pulled.

Thanks.

Offline gerald_clark

  • TinyCore Moderator
  • Hero Member
  • *****
  • Posts: 4254
Re: basic questions
« Reply #1 on: August 22, 2013, 12:59:24 PM »
There is nothing magical about TC.  It is not immune to the laws of physics nor safe computing practices.
Not everything is in RAM.
Loaded extensions are loop mounted ( Read Only ) from persistent storage.
Likewise, you would have to have your MySQL database reside another server, or on persistent storage
and deal with possible database corruption that may occur during a power failure.


Offline thane

  • Hero Member
  • *****
  • Posts: 697
Re: basic questions
« Reply #2 on: August 22, 2013, 04:32:07 PM »
FWIW, I run TC apps in RAM only (no persistent home/opt) booting from and saving to a USB stick (no hard disk). I've been through several power failures with no apparent corruption of the stick. HOWEVER, I've also been lucky that none of them happened while I was actually accessing the stick. And of course I lost whatever was in RAM at the time.

If you've got something that critical maybe a UPS would be a better solution?

Offline andyj

  • Hero Member
  • *****
  • Posts: 1036
Re: basic questions
« Reply #3 on: August 22, 2013, 04:56:13 PM »
What sort of embedded system is it? I'm using one that has internal battery backed RAM, though it's only one meg. The company has Linux drivers available as source code. If you had something like that, you could put the transaction log files there. You would also want to disable write caching system wide. That's where your corruption comes in. Use journaling where you can. This is exactly the sort of situation that it is made for.

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 11049
Re: basic questions
« Reply #4 on: August 23, 2013, 05:23:43 AM »
A RAM-based system won't help if the power cuts in the middle of your writing to the DB. It would only help with not corrupting the system (if the DB was on a separate partition/media).

As others suggest, you need UPS or some other method of guaranteeing the power won't cut when you're writing.
The only barriers that can stop you are the ones you create yourself.

Offline LazyLarry

  • Newbie
  • *
  • Posts: 42
Re: basic questions
« Reply #5 on: August 23, 2013, 09:13:02 AM »
Thanks for the replies so far.

I've only ever had corruption with the linux system files, not DB, so I'm prepared to run that risk. DB writes are minimal in any case.

OK, I'm not sure if this is possible, but can mysql running in RAM access the DB if I keep the DB on the CF card? Can I mount the CF card seperately ? There will be no network access on the pcb when installed, therefore no remote DB. A UPS is too expensive, so has already been ruled out.

Secondly, is there a procedure for getting my own app into RAM? It's not jumping out at me from the forum.


Offline andyj

  • Hero Member
  • *****
  • Posts: 1036
Re: basic questions
« Reply #6 on: August 23, 2013, 02:23:26 PM »
Your first choice should be to make your app into an extension. There are other options, but try that first. TC is very read-only media friendly, so you shouldn't be having corruption with system files like you would with one of the fat distros. Is the CF card your only media, or could you have a separate boot source like a USB stick?

Offline LazyLarry

  • Newbie
  • *
  • Posts: 42
Re: basic questions
« Reply #7 on: August 26, 2013, 06:35:26 AM »
I have 256MB of RAM and then the CF card (4GB). TC currently boots from the CF card into RAM