You are not logged in.

#1 2025-06-09 20:20:41

archlynovice
Member
Registered: 2023-10-22
Posts: 32

Contradicting mount options in /etc/fstab

When I installed the system, I created the /etc/fstab file via

genfstab -U /mnt >> /etc/fstab

This is some time ago and I updated the system several times. I cannot remember manually adding any mount options to the file. I'm only learning about different mount options now and wouldn't have added anything that I don't (at least tangentially) understand.

My question is about the /etc/fstab entry of my /boot partition, which is in vfat filesystem on a UEFI system. I have an external /boot partition and full disk encryption via detached LUKS header (stored in said /boot partition). But these things shouldn't matter much.

The /etc/fstab entry includes both mount options iocharset=ascii AND utf8. These mount options contradict each other and I don't even know which of them overwrites the other. None of this has been a problem and I don't really have a problem right now. I just want to resolve this minor thing and learn something along the way.

The /boot partition typically contains only system files which do not include any of these special characters. There shouldn't be a need to enable UTF8, so I'd choose the safest, lowest-common-denominator encoding (ASCII).

Why would I need uft8 encoding for system files?

Anyways, here's the /etc/fstab entry:

# /dev/sdXY
UUID=XXXX-XXXX    /boot    vfat    rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=ascii,shortname=mixed,utf8,errors=remount-ro    0 2

One could read the mount(8) manual in a way that utf8 mount option for vfat is enabled by default and genfstab just wrote it out:

utf8
UTF8 is the filesystem safe 8-bit encoding of Unicode that is used by the console. It 
can be enabled for the filesystem with this option or disabled with utf8=0, utf8=no 
or utf8=false. If uni_xlate gets set, UTF8 gets disabled.

And later the more sensible option was added without removing the other option?

Maybe someone can shed some light on this.

Last edited by archlynovice (2025-06-09 20:24:46)

Offline

#2 2025-06-09 20:42:17

cryptearth
Member
Registered: 2024-02-03
Posts: 1,484

Re: Contradicting mount options in /etc/fstab

https://man.archlinux.org/man/mount.8#M … ns_for_fat

Character set to use for converting between 8 bit characters and 16 bit Unicode characters. The default is iso8859-1. Long filenames are stored on disk in Unicode format.

you have to look for the options under the specific filesystem subgroup

as you can see: FAT doesn't know the utf8 option while VFAT doesn't have the iocharset option

also:

Note: fat is not a separate filesystem, but a common part of the msdos, umsdos and vfat filesystems.

Last edited by cryptearth (2025-06-09 20:45:01)

Online

#3 2025-06-09 21:02:51

archlynovice
Member
Registered: 2023-10-22
Posts: 32

Re: Contradicting mount options in /etc/fstab

You linked the fat subgroup. This is about vfat.

For fat it explicitly says:

(Note: fat is not a separate filesystem, but a common part of the msdos, umsdos and vfat filesystems.)

And for the vfat filesystem:

First of all, the mount options for fat are recognized.

For vfat filesystems, both mount options are valid. The default you quote comes from the iocharset option - which is already changed from the default to ASCII. I know that. But my question is more targeted around the utf8 option.

I mean, thanks for your comment, but it didn't answer a question. Where does it come from? Why is it there? Does it make any sense to keep it? Who put it there?

Offline

#4 2025-06-09 21:20:14

seth
Member
Registered: 2012-09-03
Posts: 64,524

Re: Contradicting mount options in /etc/fstab

utf8 is not a 16bit format, the iocharset option deals with converting those, the utf8 one tells the driver to use utf8 encodings

cd /tmp
dd if=/dev/zero of=img.fat count=8k
mkfs.vfat img.fat
sudo mount -o defaults,uid=$UID img.fat vfat # Where does it come from?
mount | grep img.fat
touch vfat/äöü.test
ls vfat
sudo umount vfat
sudo mount -o defaults,uid=$UID,utf8=false img.fat vfat
mount | grep img.fat
ls vfat
sudo umount vfat
sudo mount -o defaults,uid=$UID,iocharset=iso8859-1 img.fat vfat
mount | grep img.fat
ls vfat
sudo umount vfat
rm img.fat

Where does it come from? Why is it there?

https://wiki.archlinux.org/title/Genfstab
https://gitlab.archlinux.org/archlinux/ … type=heads
https://gitlab.archlinux.org/archlinux/ … heads#L214

Offline

Board footer

Powered by FluxBB