View: 10116|Reply: 14

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-10-29 19:05:38 | Show all floors
bathroom towels should be maintained with a good fabric conditioner so that they will last longer.        GOOD88
Published in 2025-10-30 19:03:21 | Show all floors
Awesome! I appreciate your input to this matter. It has been insightful. my blog: how to eat a girl out        S666
Published in 2025-10-30 19:31:14 | Show all floors
I like all the content articles, I really cherished, I would like more information concerning this, due to the fact it is extremely great., Thank you regarding talking about.        비아그라 구매
Published in 2025-10-31 18:41:39 | Show all floors
Wonderful post, thanks for discussing the data. It isn’t all too often that you simply read articles where the poster knows what they’re running a blog regarding. Grammar and punctuational are spot on too, only trouble We seemed to possess had been mentioning the website, seemed sluggish. Looks like additional visitors experienced exactly the same difficulty?        갤럭시가라오케
Published in 2025-10-31 20:33:21 | Show all floors
This article was written by a real thinking writer.  I agree many of the with the solid points made by the writer.  I’ll be back.        소액결제 현금화
Published in 2025-11-1 18:49:52 | Show all floors
소액결제 현금화의 개념, 절차, 방법(상품권/정보이용료/교통카드/게임캐시), 2025년 수수료 비교와 절약 팁, 안전한 업체 고르는 법, 주의사항까지 한 번에 정리.        소액결제 현금화
Published in 2025-11-6 18:38:57 | Show all floors
Furthermore this is aside from that an awesome put up that we all unquestionably preferred perusing. It is far from normal i enjoy the odds to work out a product.        Fitspresso
You need to log in before you can reply login | Register

Points Rule

Quick reply Top Return list