0

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

eyllanesc
  • 235,170
  • 19
  • 170
  • 241
MBajaria
  • 19
  • 1
  • 3
  • Use a storage technology that does not corrupt everything when power is removed. This is not a software problem. – CL. Oct 14 '17 at 09:14

2 Answers2

0

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.

MBajaria
  • 19
  • 1
  • 3
0

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.

Joee
  • 1