SD-card becomes read only

790 views Asked by At

I am running my application on colibri-vf50 toradex(running over angstrom distribution) board having sqlite database resides on sd-card. My sd-card becomes read-only whenever I remove power-supply just after board boot up(same time my app start making connection with db). Due to this I getting error in dmesg like "FAT-fs (mmcblk0p1): error, clusters badly computed".

After this sqlite can not write in db. I also tried to repair using fsck using below command but found no success.

$ fsck.msdos -r -v /dev/mmcblk

Currently, only 1 or 2 FATs are supported, not 251.

I also tried with various journel_mode of sqlite but could not prevent. So How I can prevent my sd-card to become read-only and also how to repair on board?

Thanks in advance

2

There are 2 answers

0
MBajaria On

As dosfstools is not available in angstrom on which board is running. So unable to repair sd-card on board itself. But It is possible to repair on laptop using following command: sudo dosfsck -r -a /dev/sdb1

So To prevent issue, I have changed file system from FAT32 to ext4. In which fsck do recovery on boot.

0
Joee On

I used kparted, unmount the device before, then mark the partition, then at top, device, make new FAT. Then made a new partition and anything worked again.