the data stored are 2 CSV into the microsd card:DougieLawson wrote:What sort of data? Where's it being written?
You may be safer using a USB attached hard disk as the data storage medium and just having /boot on your SDCard (as that's read-only). If you write to an SQL database engine which maintains a journal then your data should be consistent to the last commit() call (because that's what the journal is there for).
it is a big relief to expect the system will always work even when being shutoff by supply cut off many times a day, I guess that is what you meanDougieLawson wrote:If you never write to the device that holds the kernel, /bin, /sbin, /etc and /lib it will always boot.
uhmmm so I guess you are not completely 100% sure if will cause dmg to the filesystem, don't worryDougieLawson wrote:I don't hit them hard very often, but pulling the power doesn't do any damage if the filesystem isn't being written.
I think that the other poster is saying that if you mount the os itself on its own drive and never write to it, you won't mess that up and therefore it should continue to boot. You would then write to another drive, say a thumb drive in one of the USB ports.annlee wrote:uhmmm so I guess you are not completely 100% sure if will cause dmg to the filesystem, don't worry
this decission is very important for the design of the system, having it the whole time connected to a battery or like it is now getting cut off several times a day, I'm confused now
If there's any warm body anywhere near the machine then sending a replacement SDCard by the postal service is cheap and easy and simple to implement. The warm body can pull power, swap cards, plug power back in and send the damaged SDCard back for analysis, recovery and reformatting.SonOfAMotherlessGoat wrote:The reason I mentioned a UPS or a battery systems is because you said that the Pi would be located in an isolated location. I took that to mean that it would be difficult to get to in order to swap out the cards if you ended up with corruption due to power loss.
Point well taken.DougieLawson wrote:If there's any warm body anywhere near the machine then sending a replacement SDCard by the postal service is cheap and easy and simple to implement. The warm body can pull power, swap cards, plug power back in and send the damaged SDCard back for analysis, recovery and reformatting.
my system has a grovepi+ with tons of sensors so rpi is pretty much best solution for ease implementationpanik wrote:It's not possible to call a proper `shutdown` command whenever the Pi is done with whatever it's doing? How often does it need to shut down and start up?
Maybe a Pi isn't the best tool for the job. A micro controller pulls micro amps when it's in sleep mode. 3 seconds is an eternity, and the only sleep mode on a Pi is (indeed) to shut it down.
An Adafruit Adalogger for example, has an SD card and 3.7V LiPo battery connection ready to go: https://www.adafruit.com/products/2795
Have it `sleep()` all the time and trigger an interrupt every 3 seconds. Runs on a battery forever.
your data could be lost anyway.Killertechno wrote:To do this I could use dedicated Raspberry SD card partition or external USB flash drive.
In theory you can lose a few last records at worst. But in practice there are no warranties. It could be broken file, broken filesystem or broken device.Let's suppose I'll update daily file (if I'll append 200 bytes at time, 200 bytes every 30 seconds are 576'000 Bytes file), if power fails during writing?
I've read ext4 is journaling filesystem, but next boot may I find corrupted data file?
Or simply non-updated file?
I have a similar requirements. I've used USB flash on hundred devices for several years, it is unreliable solution.Now, it has been said I have to make OS read-only to extend SD card life and avoid filesystem corruption from improper shutdown (I'm working in 12V system, so using 12C to 5V DC/DC).
I'm confused, what about data?