0

I'm trying to repair a SD card with FAT, but fsck doesn't write changes — even the magic -w option doesn't help

$ sudo fsck.fat -aw /dev/sda1 
fsck.fat 3.0.26 (2014-03-07)
0x41: Dirty bit is set. Fs was not properly unmounted and some data may be corrupt.
 Automatically removing dirty bit.
Free cluster summary wrong (240886 vs. really 241296)
  Auto-correcting.
Performing changes.
/dev/sda1: 3471 files, 240319/481615 clusters

Looks like repaired ↑. But every restart of fsck, it reports the same problems, and pretends that it fixes them with the same text.

Here's the verbose variant

$ sudo fsck.fat -awv /dev/sda1 
fsck.fat 3.0.26 (2014-03-07)
fsck.fat 3.0.26 (2014-03-07)
Checking we can access the last sector of the filesystem
0x41: Dirty bit is set. Fs was not properly unmounted and some data may be corrupt.
 Automatically removing dirty bit.
Boot sector contents:
System ID "mkfs.fat"
Media byte 0xf8 (hard disk)
       512 bytes per logical sector
      4096 bytes per cluster
        32 reserved sectors
First FAT starts at byte 16384 (sector 32)
         2 FATs, 32 bit entries
   1926656 bytes per FAT (= 3763 sectors)
Root directory start at cluster 2 (arbitrary size)
Data area starts at byte 3869696 (sector 7558)
    481615 data clusters (1972695040 bytes)
62 sectors/track, 61 heads
      2048 hidden sectors
   3860480 sectors total
Reclaiming unconnected clusters.
Checking free cluster summary.
Free cluster summary wrong (240886 vs. really 241296)
  Auto-correcting.
Performing changes.
/dev/sda1: 3471 files, 240319/481615 clusters
  • The card is damaged. Replace it. Btw, Android phone also accept ext2fs at least. – Rui F Ribeiro Mar 13 '16 at 12:02
  • @RuiFRibeiro but I still can mount it in the PC just fine, so it works, doesn't it? Btw, thank you for the hint about ext2, I'll try it the next time. – Hi-Angel Mar 13 '16 at 12:19
  • Working is not the same as not being damaged; the symptoms you describe is not a good sign. I would throw away the card. Do not use it for anything important. – Rui F Ribeiro Mar 13 '16 at 12:27
  • @RuiFRibeiro but if it is damaged, shouldn't I see in the fsck output some kind of IO errors? – Hi-Angel Mar 13 '16 at 12:31
  • 1
    Not necessarily, unfortunately, and I have seen those behaviour in different technologies, from memory cards, to hard disks, and god knows what else...the definition of a malfunction is something behaving in an unpredictable way, we are actually lucky when it throws an error. – Rui F Ribeiro Mar 13 '16 at 12:33
1

The fact the card behaves erratically and in a unpredictable way , the same errors surface again and again is not a good sign, and is actually a sure symptom of damaged media. It got nothing to do with FAT problems. I would discard the card, as it cannot be trusted. Unfortunately, the SD cards only last so much, and cards with extensive operations of writes have usually a shorter life.

Android also supports ext2fs filesystems. If you use the card exclusively in Linux, it might be an interesting alternative.

Be aware that whilst other Linux filesystems might be supported, it is not a good idea to use in SD cards transactional filesystems as ext3fs. The transactional support/writes on the filesystem will increase the wear and tear.

1

this command lookes correct, but you have to involve that there is also a firmawre in your sdcard which would propaly block write processes (for example do to broken flash chip) and dont reporting that correct to the operating system.

I would suggest to check the card with a software like dd and md5sum for read-write failors on different systems/cardreaders and if there is only one suspicion about that it is not acting correctly replace it. Also i would suggest to not buy the cheapest cards...

regards

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.