badhon_raj Posted Thursday at 05:34 PM Posted Thursday at 05:34 PM I have a Rock64 I'm using for about 3-4 years. last month November, '24, due to a power failure issue, the Memory card got corrupted and won't boot anymore. I backed up the memory card using win32disk imager to rock64_corrupted.img now if I insert the memory card in a debian 12 machine, then I can see all files. root@debian:~# lsblk sdb 8:16 1 29.8G 0 disk └─sdb1 8:17 1 29.5G 0 part /media/user/ddc95179-99af-4380-b45b-fa41999ac3d0 root@debian:~# fdisk -l /dev/sdb Disk /dev/sdb: 29.81 GiB, 32010928128 bytes, 62521344 sectors Disk model: Mass-Storage Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disklabel type: dos Disk identifier: 0xce7a88b0 Device Boot Start End Sectors Size Id Type /dev/sdb1 32768 61896127 61863360 29.5G 83 Linux root@debian:~# cat /media/user/ddc95179-99af-4380-b45b-fa41999ac3d0/etc/os-release PRETTY_NAME="Armbian 24.2.1 bookworm" NAME="Debian GNU/Linux" VERSION_ID="12" VERSION="12 (bookworm)" VERSION_CODENAME=bookworm ID=debian HOME_URL="https://www.armbian.com" SUPPORT_URL="https://forum.armbian.com" BUG_REPORT_URL="https://www.armbian.com/bugs" ARMBIAN_PRETTY_NAME="Armbian 24.2.1 bookworm" root@debian:~# umount /media/user/ddc95179-99af-4380-b45b-fa41999ac3d0 root@debian:~# fsck.ext4 /dev/sdb1 e2fsck 1.47.0 (5-Feb-2023) /dev/sdb1: clean, 448797/1914432 files, 5384081/7732920 blocks Is it possible to fix this? Please let me know if I should provide any more info. Any help is greatly appreciated. I have a backup img file from February, '24 which works fine when written into the memory card. But that one is very old. 0 Quote
eselarm Posted Thursday at 06:31 PM Posted Thursday at 06:31 PM e2fsck checks only the metadata, it cannot know if data inside your files is corrupted or not. So I would use the old backup and think hard about what files could be needed and are newer from the corrupted image. Can be timeconsuming. It might be that the SD-card was in some blocked state doing wearleveling or whatever, so maybe the image you made later is maybe correct. You could try to write it back and see if it boots. But to prevent such issues, use Btrfs as rootfs. It has checksums for all data blocks and would have listed you in this case where which files the corruption is. It also also allows you fast incremental online backups, so every hour or so, what you want. And because Copy on Write, no problems with sudden powerloss, assuming it is not a bad or half-dead SD-card. 1 Quote
badhon_raj Posted Thursday at 09:04 PM Author Posted Thursday at 09:04 PM 2 hours ago, eselarm said: e2fsck checks only the metadata, it cannot know if data inside your files is corrupted or not. So I would use the old backup and think hard about what files could be needed and are newer from the corrupted image. Can be timeconsuming. It might be that the SD-card was in some blocked state doing wearleveling or whatever, so maybe the image you made later is maybe correct. You could try to write it back and see if it boots. But to prevent such issues, use Btrfs as rootfs. It has checksums for all data blocks and would have listed you in this case where which files the corruption is. It also also allows you fast incremental online backups, so every hour or so, what you want. And because Copy on Write, no problems with sudden powerloss, assuming it is not a bad or half-dead SD-card. Thanks for the suggestion regarding btrfs. I'll keep that in mind. I did try writing the image file in multiple memory card, it shows the same error. At this point I just want to make the image/memory card bootable. is that possible? Using the older backup will be useless, It will be better to just reinstall and setup everything again. I was trying to avoid that if possible. I'm not sure how I can fix the corrupted one so that it boots at least, preferably with all installed programs, so that I don't have to redo everything. If some file is corrupt, making some app not to work, I can live with that. 0 Quote
eselarm Posted Thursday at 09:31 PM Posted Thursday at 09:31 PM 21 minutes ago, badhon_raj said: At this point I just want to make the image/memory card bootable. is that possible? It depends what has been corrupted. If you are lucky it is maybe 1 file and you figure it out fast. But if many, what is more likely, then it is a dead end. 0 Quote
Recommended Posts
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.