Jump to content

Recommended Posts

Posted

 

Hi everyone,

 

Two Questions:

 

1) I have two Orange Pi 3 LTS boards at home. I installed AdGuard Home on one, serving as DHCP (I'll call it OP1),

and on the other, I left a Docker with other apps (qbittorrent, omv6, samba, etc. - I'll call it OP2).

 

Both are installed via SD card. But if there's a power outage, OP1 works normally again after, without any problems.

 

But OP2, on the other hand, has experienced data corruption several times.

Does anyone know why OP1 works fine and OP2 runs the risk of having to reinstall the system in such a case?

 

2) If I used a board with EMMC memory and unified all the systems on it, would the chances of this decrease, or is it unrelated?

I see other people with same problem. Only using a UPS to prevent the OP2 problem?

 

Thanks

Posted

data corruption can always happen when there is a power outage. Could be by chance that one device suffered while the other didn't.

Best way to prevent is as guessed a small PSU which ideally tells the device 'there is an outtage, please shut down before I run out of battery".

 

Having OS or data or microSD, eMMC or NVMe does not make a difference since the OS decides when and how often data is written. NVMe are even more fragile since they often come with an internal cache themselves that is emptied onto the actual flash asynchronously. 

Disabling write caches may lower chances for data corruption but for once can decrease performance a lot and for the other significantly decreases the lifetime of microSD cards.

Posted (edited)
14 hours ago, Horst said:

Does anyone know why OP1 works fine and OP2 runs the risk of having to reinstall the system in such a case?

I don't know, but what you describe is that OP1 is essentially able to run from RAM (network I/O mainly) so not so much storage I/O which then lowers the change of corruption. For OP2, is quite heavy disk I/O it seems, also torrents writing is tricky for some filesystems. 

 

If you want to know more why and how w.r.t. corruption, use Btrfs instead of Ext4. It still can be difficult if HW caches do the wrong thing, but you can make metadata duplicate and also play with commit time. I have a Pi3B running from SD-card and 4T 3.5i HDD via USB attached. It runs Debian Testing (Trixie now) , FAT bootfs and Btrfs rootfs with hourly snapper and also manual extra snapshots if I do upgrades. Also HDD is Btrfs formatted, 'dup' profile for metadata 'single' profile for data. I gets hard power cut every day at least once as solar powered. I do not do any UPS like noticing, also the power loss might be during a btrfs send|receive transfer, that will then fail, but in my script I delete read-write snapshots first as they should be read-only (so were correctly finished). No data loss or corruption during years. I just have a very simple guess about the amount of sunlight, which might be almost zero for days in winter.

 

On a Pi2B that seems to have damaged GPIO pin 4 and was using a bad brand SD-card, I could quite perfectly see when corruption started, which files you see when you do scrub. It was a logfile and some other file that were recently written, but unimportant, so I could still do a btrfs send of a snapshot of the rootfs to my local laptop new SD-card. I know how to create bootfs for Raspberries.

 

For my NanoPi-NEOs running Armbian I changed rootfs Ext4 into bootfs Ext4 + rootfs Btrfs. You can also use Armbian build to generate that off-the-shelf, I would now use FAT for bootfs as that matches how UEFI computers are organized. You also need extra write of U-Boot, that is not needed for RPi or UEFI.

 

An Ext4 filesystem can be turned into Btrfs in-place with tool btrfs-convert. If it is a rootfilesystem where the OS runs from, you still need to create an extra bootfs though and so also change fstab and also as a consequence the partition table and organisation.

Edited by eselarm
Posted

Thanks for the feedback. I'll research the tips further in the future. I'm not familiar with Linux and Armbian. I spent a lot of time in the past understanding the issues that occurred here.

 

I'd like to be able to leave OP2 on 24/7h if necessary, like OP1, without worrying about a power outage.

 

But Open Media Vault, Docker, Bittorrent, must perform frequent reads and writes to the SD card, and I have bad memories of it, with the system failing to boot up several times.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines