21

In order to create a contiguous space for my file system to grow, I created a new EFI System partition at sda1 so that I can migrate it from the current partition at sda5. The move itself has been successful except for a warning which says:

kernel: FAT-fs (sda1): Volume was not properly unmounted. Some data may be corrupt. Please run fsck.

I didn't notice the warning which has been there for two days when I first created the EFI partition. I unmounted the file system and performed a file system check as follows:

# umount /dev/sda1
# fsck -V /dev/sda1
fsck from util-linux 2.24
[/sbin/fsck.vfat (1) -- /boot/efi] fsck.vfat /dev/sda1 
fsck.fat 3.0.24 (2013-11-23)
0x25: Dirty bit is set. Fs was not properly unmounted and some data may be corrupt.
1) Remove dirty bit
2) No action
? 1
Leaving filesystem unchanged.
/dev/sda1: 14 files, 2435/51145 clusters

I thought removing the dirty bit would resolve this. But it didn't. What should actually be done?

donquixote
  • 461
  • 1
  • 4
  • 14
Question Overflow
  • 2,023
  • 7
  • 28
  • 44

1 Answers1

29

This is stupid. I find myself answering my own question again. It says,

Leaving filesystem unchanged.

suggesting that nothing is changed. This actually mean that typing 1 followed by pressing enter inside the fsck prompt did not work. Anyway, the following does work:

# fsck.vfat -v -a -w /dev/sda1

The above command automatically write changes to disk. It would be great if anyone can tell me whether this is a bug in fsck or it is due to something else.

Question Overflow
  • 2,023
  • 7
  • 28
  • 44
  • 5
    The man page for `fsck.vfat` explains that it only does a dry-run and changes nothing, unless you give either the `-a` or `-r` options. The same is true of the check tools for other filesystem types, though the specific options may vary. – Michael Hampton Feb 01 '14 at 12:52
  • 5
    @MichaelHampton, yes indeed. The sneaky footnote says `Note: If -a and -r are absent, the filesystem is only checked, but not repaired.`. Those looking at `man fsck` would never find out :p – Question Overflow Feb 01 '14 at 14:13
  • Actually, `-a` and `-r` are both mentioned in `fsck` man page. – Michael Hampton Feb 01 '14 at 14:15
  • 3
    @MichaelHampton, yeah, but nothing is mentioned about the dry-run. – Question Overflow Feb 02 '14 at 01:55
  • 1
    @MichaelHampton core `fsck` here (on debian 8.2) not only does not make that explicit - but also it quotes two contradictory meanings for the `-r` switch - just to complicate things further... – underscore_d Oct 30 '15 at 22:45
  • 1
    @underscore_d Not contradictory, just confusing. One of those is a general `fsck` option, the other is an fs-specific option. These appear after `--`, and get passed through to the fs-specific tool. – Michael Hampton Oct 30 '15 at 23:24
  • Thanks: I later noticed that on closer reading of the `man`, but I'm glad you noted it here as I might've forgotten to come back. Between this and the not-so-clear 'dry run' behaviour, the way these `man` pages are written really demands full attention. :) – underscore_d Oct 30 '15 at 23:38