Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid filesystem corruption #10

Open
vguttmann opened this issue Apr 24, 2022 · 17 comments
Open

Avoid filesystem corruption #10

vguttmann opened this issue Apr 24, 2022 · 17 comments

Comments

@vguttmann
Copy link

I would very much like to build the mower and help with development, but for me to build it, it needs to be foolproof long-term, as I will be moving out soon, and I don't think my parents have any interest in reinstalling the operating system on their lawn mower.

Raspberry Pis have a history of corrupting the file system on their SD cards, so I'd like to know if there are any mitigations for this, and if not, advocate for their implementation.

@Schaumi19
Copy link

As far as I know the OS is still Raspbian with ROS installed. The Problem with the SD-card is writing and in Raspbian there is a option to not write to SD. If that is selected it writes only to the RAM so if there is a power loss the system is set back to the point the option was selected.
Hope it helps

@ClemensElflein
Copy link
Owner

This might be a problem indeed, since I'm using Ubuntu on the Pi. I haven't gotten ROS to work with Raspbian in a stable way. But @Schaumi19 is right, there is an option which just writes to RAM and does not modify the SD. I haven't used it yet, though since I'm working on the software and therefore need write access to the SD

@scottishjohn1982
Copy link

scottishjohn1982 commented Apr 28, 2022 via email

@noobydp
Copy link

noobydp commented Apr 29, 2022

I got bored and read up on this problem, so I'm no expert.

This article suggests the problem has been resolved and may have been due to bad rpi hardware or cheap sd cards.

I've used 3 or 4 pi's over the past few years starting with a Pi B, and I've never had an issue.
I've always Used genuine samdisk cards, not sure if it helps.

That said the overlay fs/ read only sd card mode is handled at the os level in raspbian so might be an option.

@scottishjohn1982
Copy link

scottishjohn1982 commented Apr 29, 2022 via email

@Schaumi19
Copy link

Schaumi19 commented Apr 29, 2022

It is true that you have less problems with genuine sdcards whatever brand, but it is also a fakt that the life time of an sd card is limited tue to the write cycles(up to 10k some sources say 100k). Thats why the problem is not the normal usage. But if there is something like a log file that gets written every second you are done afer a few days. Or if the file gets writen less the problem occurs afer a longer period of time what could be worse.

@FilipBE
Copy link

FilipBE commented Apr 30, 2022

Some Raspberry Pi Compute Module 4 (CM4) boards come with a built-in eMMC flash chip for storing nonvolatile data. This chip replaces the need for a separate SD card, which can be useful if you want to avoid the use of SD cards.

@JoeKae
Copy link

JoeKae commented Apr 30, 2022

Just boot from a small ssd via usb. They last much longer than sdcards or emmc.

@FadeFx
Copy link

FadeFx commented Apr 30, 2022

i am not sure if adding an ssd inside the smal case of a mower.

@JoeKae
Copy link

JoeKae commented Apr 30, 2022

You can use small m2 type ssds.

@vguttmann
Copy link
Author

I did open this issue because I had a (as far as I can tell) genuine Samsung 64GB SD card go bad in a Pi that a personal project ran on.

I would agree that a CM4-based mower sounds like a good idea, given the onboard eMMC flash, and that it is intended with use in industrial settings in mind. Of course, that would mean sacrificing USB 3.0 connectivity, but as far as I can see, that's not really used here.
The CM4 DOES have a USB 2.0 interface, so no USB controller on the board would be necessary.

@pedromorgan
Copy link

At end of day we want machine to be 100% reliable.. with ..a failover etc...(line replacable)

maybe an SD raid ? or ssd RAID ?
as @JoeKae mentions, the m2 ssd's could be useful.. but expensive..

or a stpuid raid..
https://hackaday.com/2018/02/12/worlds-stupidest-solid-state-disk-drive-hack/

@Schaumi19
Copy link

ssds last longer but have the same problem. So just dont write do the ssd/sd or only write every few days. I don't think it is a real problem, that it gets reset a few days if the battery dies.

@wooter
Copy link

wooter commented Jun 21, 2022

I've been using Log2Ram, and endurance type SD cards. None of them have failed yet, in other applications like RPi dash cams and power monitoring.

@ClemensElflein
Copy link
Owner

We're working on having the software as docker images, so that we can use Raspbian as base system. This would allow us to use the overlayfs setting in raspi-config which should fix the sd corruption problem without much work.

@plopaur
Copy link

plopaur commented Aug 8, 2022

I would recommend looking at Tinycore Linux for Rasperry Pi. This is a minimal ramdisk only distribution with no automatic writing to sdcard which i have used in the past. A new package for openmower has to be created.
Configuration changes can be written to sdcard instantly.

http://www.tinycorelinux.net/ports.html

@docgalaxyblock
Copy link

@plopaur I could not find any information if ROS runs on TinyCore. If it does and it is stable that may be a way to do it

@vguttmann @pedromorgan I am planning to build my mower based on a CM4 w/ emmc and this adapter - It has a M.2 2230/42 slot too but I think a ssd is an overkill

It will take some time cause I accidentally ordered a CM4 w/o wifi so I am returning it and need to wait until my desired variant is available again.
Also I plan to take a look around the OS side of the project
Stay tuned 🤗

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests