View: 8179|Reply: 6

Prevent sd card corruption - create read only root FS

[Copy link]

3

threads

7

posts

33

credits

Novice

Rank: 1

credits
33
Published in 2022-8-31 06:08:38 | Show all floors |Read mode
This post was finally edited by Nadalia at 2022-8-31 06:10

I'm looking to prevent sd card corruption.

I thought the best way is to have a readonly fs, so I tried following the instructions here, but it failed on following step:
    $sudo mount -o move /etc /mnt/etc/
    mount: /mnt/etc/root-ro: bad option; moving a mount residing under a shared mount is unsupported.

My goal is to prevent sd card corruption.
1. Is there a better way of creating a readonly fs?
2. Are there other options of reducing corruption? e.g. automatically running fsck?

Hardware: Zero 2
OS: Debian (official Orangepizero2_3.0.6_debian_bullseye_server_linux5.16.17)
If sound and gpio work good on Ubuntu I can move to that OS (unfortunately sound and gpio seem to be problematic on Armbian).

I'm a "simple" programmer and not familiar with mounting/fs/overlay - Any help is very much appreciated.



1

threads

24

posts

107

credits

Registered member

Rank: 2

credits
107
Published in 2022-9-16 03:23:54 | Show all floors
You wont get SD card corruption on an Orange Pi.

The reason is it does NOT uses a FAT32 partition for /boot

The Raspberry Pi, as good as it is, fails because it uses weak windows file systems for the boot partition. The / partition
is a linux ext4 but the boot partition allows windows users to edit the config files.

If you're running a distribution like Armbian, then your system has all the advantages of a raspberry Pi but none of its disadvantages.

In addition, when choosing a SD card for your Orange Pi make sure its from a reliable vendor like Sandisk.

I read write to my Orange Pi zero  most days and it has no problem.

A power cut or failure results in failure to FAT file systems. This happened to my Orange Pi, result  no corruption
just a reboot and in the log was a message about an invalid inode entry that was corrected.

Hope that helps

0

threads

1

posts

10

credits

Novice

Rank: 1

credits
10
Published in 2023-11-29 01:42:33 | Show all floors
This post was finally edited by andrey-sh at 2023-11-29 01:44

I found a good version of instructions only for ubuntu. For debian there was also an attempt to use the overlayroot package, but as far as I understand, other solutions or workarounds need to be used there.

Run the following commands only for Ubuntu based Armbian (official Ubuntu for orange pi zero 2 is also suitable)
  1. sudo apt update
  2. apt-get remove unattended-upgrades
  3. mv /usr/lib/apt/apt.systemd.daily /usr/lib/apt/apt.systemd.daily.DISABLED
  4. apt-get install overlayroot
  5. echo 'overlayroot="tmpfs"' > /etc/overlayroot.conf
Copy code

Use overlayroot-chroot to make edits to the system:
  1. cd /media/root-ro
  2. mount -t proc proc proc/
  3. mount -t sysfs sys sys/
  4. mount -o bind /dev dev/
  5. overlayroot-chroot
Copy code

Check and minimize space in RAM used by overlay files
  1. df -h /media/root-rw
  2. rm -rf /media/root-rw/overlay/var/
Copy code
Published in 2025-9-19 18:36:54 | Show all floors
I actually stumbled upon http://news-araby.com while searching for updates on regional conflicts in the Arab world. I was impressed that the coverage didn’t feel too generic—it had specifics that tied directly to local situations. That’s what kept me reading. It’s always tricky to find sources that cover both political and social sides in balance, but this one managed to hold my attention without going overboard.
Published in 6 daybefore | Show all floors
This is simply the info I'm discovering almost everywhere. Many thanks for the weblog, I simply sign up your site. This can be a good weblog. inch.        IPTV Sverige
Published in 5 daybefore | Show all floors
Excellent publish, Thanks with regard to discussing This particular understanding. Wonderfully created post, if perhaps just about all writers provided exactly the same degree of content material while you, the web will be a far better location. Make sure you continue the good work!        đá gà cpc1 – trường đấu đẳng cấp bậc nhất tại đông nam á đá gà cpc2 – đấu trường gà campuchia đỉnh cao năm 2025
Published in byday 22:56 | Show all floors
Appreciate it intended for giving new messages the matter, When i count on understand far more.        쩜오룸싸롱        Literally Document look at the software yesterday evening still I had produced a lot of emotions relating to this now I needed to read the software once as it is relatively well crafted.        pucuk138 slot
You need to log in before you can reply login | Register

Points Rule

Quick reply Top Return list