You are not logged in.

#1 2019-10-04 09:40:36

mcloaked
Member
From: Yorkshire, UK
Registered: 2012-02-02
Posts: 1,360

Dirty bit set in VFAT boot partition

On my system I have a VFAT /boot partition which the output from the df -h command gives:

/dev/sdb1       2.0G  1.4M  2.0G   1% /boot/efi

If I check the partition using:

# fsck -V /dev/sdb1
fsck from util-linux 2.34
[/usr/bin/fsck.vfat (1) -- /boot/efi] fsck.vfat /dev/sdb1
fsck.fat 4.1 (2017-01-24)
0x41: Dirty bit is set. Fs was not properly unmounted and some data may be corrupt.
1) Remove dirty bit
2) No action

? 1
Perform changes ? (y/n) y
/dev/sdb1: 128 files, 348/523262 clusters
[root@home1 ~]# fsck -V /dev/sdb1
fsck from util-linux 2.34
[/usr/bin/fsck.vfat (1) -- /boot/efi] fsck.vfat /dev/sdb1
fsck.fat 4.1 (2017-01-24)
/dev/sdb1: 128 files, 348/523262 clusters

Responding with 1 to the suggestion to remove the dirty bit, appears to correct the problem, and running the fsck command again shows no dirty bit set. However if I reboot then the fsck command shows the dirty bit has been set again.

If I respond with option 2 for no action then I see additional information:

# fsck -V /dev/sdb1
fsck from util-linux 2.34
[/usr/bin/fsck.vfat (1) -- /boot/efi] fsck.vfat /dev/sdb1
fsck.fat 4.1 (2017-01-24)
0x41: Dirty bit is set. Fs was not properly unmounted and some data may be corrupt.
1) Remove dirty bit
2) No action
? 2
There are differences between boot sector and its backup.
This is mostly harmless. Differences: (offset:original/backup)
  65:01/00
1) Copy original to backup
2) Copy backup to original
3) No action
?

I haven't allowed it to choose one or other of the Copy options.

Also I checked the log for any messages concerning the unmount before rebooting and it seems normal:

Oct 04 09:08:35 home1 systemd[1]: Unmounting /opt2...
Oct 04 09:08:35 home1 systemd[1]: Unmounting Temporary Directory (/tmp)...
Oct 04 09:08:35 home1 systemd[1]: boot-efi.mount: Succeeded.
Oct 04 09:08:35 home1 systemd[1]: Unmounted /boot/efi.
Oct 04 09:08:35 home1 systemd[1]: home.mount: Succeeded.
Oct 04 09:08:35 home1 systemd[1]: Unmounted /home.
Oct 04 09:08:35 home1 systemd[1]: opt2.mount: Succeeded.
Oct 04 09:08:35 home1 systemd[1]: Unmounted /opt2.
Oct 04 09:08:35 home1 systemd[1]: tmp.mount: Succeeded.
Oct 04 09:08:35 home1 systemd[1]: Unmounted Temporary Directory (/tmp).
Oct 04 09:08:35 home1 systemd[1]: Stopped target Swap.
Oct 04 09:08:35 home1 systemd[1]: Deactivating swap /dev/disk/by-id/ata-Crucial_CT525MX300SSD4_18021A6C678C-part3...
Oct 04 09:08:35 home1 systemd[1]: Unmounting /opt...

Does anyone else see this, and if so what is the best advice to resolve this issue?

Thanks.

Last edited by mcloaked (2019-10-04 12:07:26)


Mike C

Offline

#2 2019-10-04 22:49:41

xerxes_
Member
Registered: 2018-04-29
Posts: 1,065

Re: Dirty bit set in VFAT boot partition

I don't have that problem, nor UEFI vfat partition, but if I were you I would just choose option "2) Copy backup to original" when run fsck.vfat and see if dirty bit will not be set when you next reboot.

If something would go wrong, just change bit at offset 65 to 01 by any way, for example by "sudo hexedit /dev/sdb1" command, press enter to go to offset 65 and change it.

Last edited by xerxes_ (2019-10-04 22:55:05)

Offline

#3 2019-10-05 08:03:02

mcloaked
Member
From: Yorkshire, UK
Registered: 2012-02-02
Posts: 1,360

Re: Dirty bit set in VFAT boot partition

Thanks for your reply Xerxes. On searching for this issue more generally it seems that his has been an issue for quite a long time and there isn't any obvious solution. I found a number of references to other user's experiences of this in other linux distributions:

https://www.linuxquestions.org/question … 175609960/
https://superuser.com/questions/1398115 … -dirty-bit
https://forums.opensuse.org/showthread. … -unmounted

So perhaps this is something that has to be lived with!


Mike C

Offline

#4 2019-10-05 11:33:38

xerxes_
Member
Registered: 2018-04-29
Posts: 1,065

Re: Dirty bit set in VFAT boot partition

My bad: that "dirty bit" is at offset 0x41 on FAT32 volumes.

If you don't want to see this message then you may try to manually unmount vfat /boot partition before you shutdown/reboot system, as it set this bit to clean state by kernel when unmounting.
I have no idea why it is not doing it automatically when unmounting vfat partition at shutdown.

Offline

Board footer

Powered by FluxBB