View: 2493|Reply: 10

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

105

credits

Registered member

Rank: 2

credits
105
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 2024-2-26 17:59:19 | Show all floors
Needed to post you the little bit of note to be able to give thanks once again over the pleasing advice you’ve contributed on this page. This is really wonderfully open-handed with people like you in giving without restraint what some people would have sold as an e book to end up making some bucks for themselves, particularly now that you might have tried it if you wanted. The ideas also served to provide a good way to understand that most people have the same passion like my own to know the truth more on the topic of this matter. Certainly there are some more pleasant times ahead for individuals that view your site.        get paid playing games
Published in 2024-3-10 04:54:20 | Show all floors
Some times its a pain in the ass to read what website owners wrote but this site is very user friendly!        webpage
Published in 2024-3-17 01:53:41 | Show all floors
hair restoration should be more natural in the years to come because of stem cell research~        topcer88 slot
Published in 2024-3-22 02:17:30 | Show all floors
I haven’t checked in here for some time as I thought it was getting boring, but the last few posts are good quality so I guess I’ll add you back to my daily bloglist. You deserve it  friend        오피쓰
Published in 2024-3-26 05:45:59 | Show all floors
I do not even know how I stopped up here, however I believed this post used to be great. I do not recognize who you are but certainly you’re going to a well-known blogger should you are not already   Cheers!        login topcer88
Published in 2024-3-28 06:32:24 | Show all floors
Fantastic read, I just passed this onto a friend who was doing a little study on that. And he actually bought me lunch because I discovered it for him smile So let me rephrase that: Thanks for lunch!        login topcer88
Published in 2024-4-15 23:34:09 | Show all floors
Thanks  for this  tremendous  post, I am glad I  noticed this website   on yahoo.        Fintech Zoom
You need to log in before you can reply login | Register

Points Rule

Quick reply Top Return list