#787228 fsck: Fixed free cluster summary may not get written back

Package:
dosfstools
Source:
dosfstools
Description:
utilities for making and checking MS-DOS FAT filesystems
Submitter:
Yaroslav Halchenko
Date:
2015-06-04 23:27:04 UTC
Severity:
normal
#787228#5
Date:
2007-04-03 21:05:34 UTC
From:
To:
What is the point of asking a question if in the end, you just
"Leaving file system unchanged"?

# fsck.vfat /dev/sdc1
dosfsck 2.11, 12 Mar 2005, FAT32, LFN
/PALM/Programs/Plucker/dieyuanname300801132.pdb
  Duplicate directory entry.
  First    Size 1637 bytes, date 16:03:20 Mar 30 2007
  Second   Size 1794 bytes, date 11:18:22 Mar 02 2007
1) Drop first
2) Drop second
3) Rename first
4) Rename second
5) Auto-rename first
6) Auto-rename second
? 6
  Renamed to FSCK0000.REN
Leaving file system unchanged.
/dev/sdc1: 40 files, 44/7682 clusters

Also perhaps offer 7) Do nothing.

Oh, deep in the manual do we see

       If -a and -r are absent, the file  system  is  only  checked,  but  not
       repaired.

#787228#10
Date:
2011-09-22 20:35:57 UTC
From:
To:
severity 417639 important
thanks

in my case situation is similar - took time to dig out on how to "commit" the
changes but now they are not really committed since on subsequence runs -- the
same errors -- so what good about this utility (thus raised severity)

$> dosfsck -r -w /dev/sdb1
dosfsck 3.0.9, 31 Jan 2010, FAT32, LFN
There are differences between boot sector and its backup.
Differences: (offset:original/backup)
  1:63/58, 90:00/0e, 91:80/1f, 92:70/be, 93:b5/77, 94:65/7c, 95:00/ac
  , 96:00/22, 97:00/c0, 98:00/74, 99:00/0b, 100:ff/56, 101:fa/b4, 102:eb/0e
  , 103:05/bb, 104:f6/07, 105:c2/00, 106:80/cd, 107:74/10, 108:05/5e
 .....
  , 504:f7/00, 505:fe/00
1) Copy original to backup
2) Copy backup to original
3) No action
? 1
FATs differ but appear to be intact. Use which FAT ?
1) Use first FAT
2) Use second FAT
? 1
/boot/iso/.neurodebian-live_6.0.3_i386.iso.qA4V1K
  Contains a free cluster (490368). Assuming EOF.
/boot/iso/.neurodebian-live_6.0.3_i386.iso.qA4V1K
  File size is 201850880 bytes, cluster chain length is 186978304 bytes.
  Truncating file to 186978304 bytes.
/boot/iso/neurodebian-live_6.0.3_i386.iso
  File size is 750256128 bytes, cluster chain length is > 750256128 bytes.
  Truncating file to 750256128 bytes.
Reclaimed 1767 unused clusters (7237632 bytes).
Free cluster summary wrong (499143 vs. really 491142)
1) Correct
2) Don't correct
? 1
Perform changes ? (y/n) y
/dev/sdb1: 904 files, 1570618/2061760 clusters

$> dosfsck -r -w /dev/sdb1
dosfsck 3.0.9, 31 Jan 2010, FAT32, LFN
There are differences between boot sector and its backup.
Differences: (offset:original/backup)
  1:63/58, 90:00/0e, 91:80/1f, 92:70/be, 93:b5/77, 94:65/7c, 95:00/ac
  , 96:00/22, 97:00/c0, 98:00/74, 99:00/0b, 100:ff/56, 101:fa/b4, 102:eb/0e
  , 103:05/bb, 104:f6/07, 105:c2/00, 106:80/cd, 107:74/10, 108:05/5e
  , 109:f6/eb, 110:c2/f0, 111:70/32, 112:74/e4, 113:02/cd, 114:b2/16
  , 115:80/cd, 116:ea/19, 117:79/eb, 118:7c/fe, 119:00/54, 120:00/68
  , 121:31/69, 122:c0/73, 123:8e/20, 124:d8/69, 125:8e/73, 126:d0/20
....

#787228#17
Date:
2011-09-23 05:09:48 UTC
From:
To:
tried version from the experimental and this time it committed the
changes!  thanks! ;-)

#787228#22
Date:
2011-09-23 20:07:23 UTC
From:
To:
eh -- that was too early to celebrate...  rsync seems to be causing this
problem on vfat mounted partition and now I am stuck again without being
able to fix the partition despite saying 'y'es...

$> dosfsck -v -r -w /dev/sdb1
dosfsck 3.0.11 (24 Dec 2010)
dosfsck 3.0.11, 24 Dec 2010, FAT32, LFN
Checking we can access the last sector of the filesystem
Boot sector contents:
System ID "mkdosfs"
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
   8249344 bytes per FAT (= 16112 sectors)
Root directory start at cluster 2 (arbitrary size)
Data area starts at byte 16515072 (sector 32256)
   2061760 data clusters (8444968960 bytes)
32 sectors/track, 64 heads
         0 hidden sectors
  16526336 sectors total
/boot/iso/.neurodebian-live_6.0.3_i386.iso.IR3TfA
  Contains a free cluster (493696). Assuming EOF.
/boot/iso/.neurodebian-live_6.0.3_i386.iso.IR3TfA
  File size is 508559360 bytes, cluster chain length is 498892800 bytes.
  Truncating file to 498892800 bytes.
Checking for unused clusters.
Reclaimed 768 unused clusters (3145728 bytes).
Checking free cluster summary.
Free cluster summary wrong (341963 vs. really 344320)
1) Correct
2) Don't correct
? 1
Perform changes ? (y/n) y

$> dosfsck -v -r -w /dev/sdb1
dosfsck 3.0.11 (24 Dec 2010)
dosfsck 3.0.11, 24 Dec 2010, FAT32, LFN
Checking we can access the last sector of the filesystem
Boot sector contents:
System ID "mkdosfs"
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
   8249344 bytes per FAT (= 16112 sectors)
Root directory start at cluster 2 (arbitrary size)
Data area starts at byte 16515072 (sector 32256)
   2061760 data clusters (8444968960 bytes)
32 sectors/track, 64 heads
         0 hidden sectors
  16526336 sectors total
/boot/iso/.neurodebian-live_6.0.3_i386.iso.IR3TfA
  Contains a free cluster (493696). Assuming EOF.
/boot/iso/.neurodebian-live_6.0.3_i386.iso.IR3TfA
  File size is 508559360 bytes, cluster chain length is 498892800 bytes.
  Truncating file to 498892800 bytes.
Checking for unused clusters.
Reclaimed 768 unused clusters (3145728 bytes).
Checking free cluster summary.
Free cluster summary wrong (341963 vs. really 344320)
1) Correct
2) Don't correct
? 1
Perform changes ? (y/n) y
/dev/sdb1: 906 files, 1717440/2061760 clusters