Jump to content

SD Card corrupt after hard power off!


Recommended Posts

The topic is no longer new, but I have not found the reason and its solution!


If you turn off the power (just pull out the wire) then you can get a non-working system. 

As I noticed, the files opened at the time of launch are broken. And some files such as /etc/boot/armbianEnv.txt in general, they are recorded with some kind of garbage!!!


Because of this, your settings fly off! For example, I use ttys1 and this option is registered armbianEnv.txt , but after the power loss, there is just terrible garbage in this file, as if the memory dump fell there!!! For example, I still use dotnet, so it also breaks down and does not start anymore!! When you try to run dotnet from the command line, you get a bus error! Of course, deleting and reinstalling it solves the problem. You may also get problems with apt!


I certainly expected this from windows. But for linux to be somewhat unreliable is a tin and a disappointment!!

Why does this happen and how to treat it???


Now I have made a sh script to check the integrity of files and restore them. But these are crutches and a shame for linux!!! Maybe arabian is crooked and unreliable? 

or is it a disease of all systems???

I must say right away that the SD card is normal! This has been tested on 10 minicomputers. It's the same problem everywhere!

Link to comment
Share on other sites

I make Serjaru's words mine.

1) I use Armbian Bulleyes on an orangepi 3 lts because I need Open Media Vault.

The system works well when I install it, I spend hours and hours configuring it.

2) I also use another orangepi 3 lts with Armbian and AdGuard and DHCP.

But every time there is a power outage in my region (something unexpected due to several factors), the OMV goes into space.

It literally becomes hell trying to resolve something.

You start to dig into the subject and only make the problems worse.

Incredible, how easily a damn SdCard corrupts. While on the other orangepi with ADGuard the most I need to do is restart it and everything works fine.
Any solution, idea?

Honestly, I'm amazed at how easy it is to corrupt a system like this after hours of configuring it. Isn't there a scandisk, or something like that that can be done?

Link to comment
Share on other sites

@HorstIIRC fsck it already part of initrd and will run on boot. You have mentioned that you are using Bullseye. Its been almost a year since we generated any bullseye based image. I would recommend you to either use the latest bookworm based image or generate a new bullseye image yourself using the build framework. Instructions for generating new images can be found here - https://docs.armbian.com/Developer-Guide_Build-Preparation/

Link to comment
Share on other sites

Actually, the SD card is fine! Linux itself breaks files (writes garbage), I already had to write a script that checks its integrity before launching applications. This is a disgrace for Linux. Even Windows does not allow itself to do this. I have not found the reason for such stupid antics in Linux, perhaps it is buried deep somewhere, maybe at the kernel level. But this of course nullifies the stability of the system. At startup, I always check /boot/armbianEnv.txt , because it breaks first, well, if you get something like a bus error when you try to run the file, then do not rush to throw out the flash drive - this is a 99% corrupted file! And if you overwrite it, then everything will work. I think all sorts of scandisk do not solve the problem here, because the file is normal, it's just that garbage is already written in its body

Link to comment
Share on other sites


Gunjan Gupta

I can't. I try to update firmware and packages from armbian-config and now my eth0 port is not working anymore.

Seems like a kernel update. Im stuck on Armbian 23.02.2 Bullseye with Linux 6.1.63-current-sunxi64. 

On armbian-config : warning configuration cannot work properly without a working internet connection


I dont understand why so many problem appear since this update. Its difficult to describe many things that happen.

Im tryng to fix since 8 hour ago. But no lucky, no result. 

Link to comment
Share on other sites

@Serjaru You have still avoided my question and haven't answered what Image you are using? How can we try to help you without knowing what you are using. Only thing I know is you probably are using Orange Pi Zero as you have posted with that label. Last full week I was un-pluging power off my own Orange Pi Zero as I was trying to check working of my own project. I would have done it 50 times atleast and not a single time I had corrupt sd card.


So please stop avoiding questions and provide details. Otherwise no one can help you.

Link to comment
Share on other sites

Gunjan, sorry. Not I see the ethernet problem was my swicth 8/1000. Since I have a power down on my house, something hang on it and now its working again my local ip.

I dont know many commands in armbian, like this neofetch. If you know others commands in a url for I study this, I appreciate. 

Now I will looking for a tutorial to install OMV on a usb HD, after corrupted boots on sd card. Thanks

Link to comment
Share on other sites

@HorstNeofetch is not Armbian specific command. Its used in a lot of distributions to show device information. For Armbian specific things, go through the https://docs.armbian.com/User-Guide_Getting-Started/ make sure to check all of the links given in the sidebar on the left. Those informations will definitely come in handy.

Link to comment
Share on other sites

Hi @Gunjan Gupta I am helping a client with an issue on their nanopi neo where armbianEnv.txt and other files are seen to be corrupted.  The symptoms resemble the various complaints seen over the years on this forum.  A system restart generally seems to be involved.  I am speculating that they are removing power without a safe shutdown.

You mentioned earlier in the discussion on Dec 2023:


We made some changes in the filesystem options we use recently thats supposed to help in cases like this.

Do you recall which commit the changes to filesystem options were made so that we can code review?

My client is using a build from May 2023.  So I am wondering if they are missing some critical changes that would make the file system more reliable.  Please let me know if you remember what filesystem options were changed and when they were made.  A link into Git would be very helpful here.

My customer is not ready to upgrade, but would be open to have me patch in upstream fixes.

Chris N.

Link to comment
Share on other sites

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.

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.

  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines