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

I am getting this message on my Debian 10 VM:

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

So I need to check who is /dev/vda1

df -T /dev/vda1

My VM said:

Filesystem     Type 1K-blocks  Used Available Use% Mounted on
/dev/vda1      vfat    523248  6728    516520   2% /boot/efi

How do we check for vfat on Debian Linux 10?

I found fsck.vfat(8) — dosfstools — Debian testing — Debian Manpages and it said run:

fsck.vfat /dev/vda1

But I get new error now:

-bash: fsck.vfat: command not found


Further investigation said:

apt search dosfstool
Sorting... Done
Full Text Search... Done
dosfstools/stable 4.1-2 amd64
  utilities for making and checking MS-DOS FAT filesystems

So I installed the dosfstools as root

su -
apt install dosfstools
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following NEW packages will be installed:
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 98.4 kB of archives.
After this operation, 241 kB of additional disk space will be used.
Get:1 http://deb.debian.org/debian buster/main amd64 dosfstools amd64 4.1-2 [98.4 kB]
Fetched 98.4 kB in 0s (330 kB/s)
Selecting previously unselected package dosfstools.
(Reading database ... 35228 files and directories currently installed.)
Preparing to unpack .../dosfstools_4.1-2_amd64.deb ...
Unpacking dosfstools (4.1-2) ...
Setting up dosfstools (4.1-2) ...
Processing triggers for man-db (2.8.5-2) ...

Unmount /dev/vda1

umount /dev/vda1

Check for errors

fsck.vfat -v /dev/vda1
mount /dev/vda1
fsck.fat 4.1 (2017-01-24)
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.
1) Remove dirty bit
2) No action
? 1
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
    524288 bytes per FAT (= 1024 sectors)
Root directory start at cluster 2 (arbitrary size)
Data area starts at byte 1064960 (sector 2080)
    130812 data clusters (535805952 bytes)
32 sectors/track, 64 heads
      2048 hidden sectors
   1048576 sectors total
Checking for unused clusters.
Checking free cluster summary.
Perform changes ? (y/n) y
/dev/vda1: 10 files, 1682/130812 clusters

Now everything worked.


That was fast. Thank you for posting answer too.

Linux sysadmin blog - Linux/Unix Howtos and Tutorials - Linux bash shell scripting wiki