I tell fsck to fix USB stick, it says "Leaving file system unchanged."

25

3

So I run fsck, and it reports

FATs differ but appear to be intact. Use which FAT ?
1) Use first FAT
2) Use second FAT

Choosing either one gives a long list of errors like

Cluster 1471730 out of range (164977891 > 1980013). Setting to EOF.
Cluster 1471732 out of range (252397720 > 1980013). Setting to EOF.
Cluster 1471734 out of range (18601458 > 1980013). Setting to EOF.

Then it says,

Reclaimed 93886 unused clusters (769114112 bytes).
Free cluster summary wrong (1034047 vs. really 1221912)
1) Correct
2) Don't correct

If I choose (1), it just exits with no action:

Leaving file system unchanged.
/dev/sdb1: 53 files, 758100/1980012 clusters

So how do I fix this?

Scott C Wilson

Posted 2012-04-28T13:23:22.270

Reputation: 2 210

Answers

23

After unmounting the USB volume, you'll want to use fsck with the '-w' switch which forces fsck to immediately write changes. Note that '-w' requires '-a' (auto mode) or '-r' (interactive mode).

user130302

Posted 2012-04-28T13:23:22.270

Reputation:

I really miss -w option! +1 – gavenkoa – 2013-11-25T22:22:09.667

9

man fsck.vfat says:

Note: If -a and -r are absent, the filesystem is only checked, but not repaired.

So, to have it actually write your changes use either -a or -r. The -w option modifies the behaviour of those two.

Gilead

Posted 2012-04-28T13:23:22.270

Reputation: 211

7

Look at the fsck man page. Maybe try -r option or leave the -n if you used it.

Another possibility is that the partition is completely full. Check this.

By the way, it would be very helpful to post the exactly command that you used.

jfreax

Posted 2012-04-28T13:23:22.270

Reputation: 71

0

In addition to passing -w -r like user130302 said, I had to run fsck.vfat with the partition mounted so that fsck would be able to write the found clusters (into FSCK000n.REC files).

David Faure

Posted 2012-04-28T13:23:22.270

Reputation: 161

0

I had the same issue. I eventually got it to work just by using the dosfsck command directly rather than using fsck (which is just a wrapper for all of the various fsck tools). I guess when fsck calls dosfsck it adds some options which cause it to fail to work correctly.

user258400

Posted 2012-04-28T13:23:22.270

Reputation: 1

0

I had the same problem, inspired of the answer from user258400 i used directly:

fsck.fat -r /dev/sde1

instead of:

fsck -r /dev/sde1

which did the trick

Marco Kinski

Posted 2012-04-28T13:23:22.270

Reputation: 1