почему смонтированный том vfat чувствителен к регистру частично?

900
ardabro

У меня странное наблюдение. Я смонтировал файловую систему vfat так:

mount -t vfat -o loop vfat.vol mnt

Я ожидал, что это будет без учета регистра. И это до тех пор, пока длина имени файла не превышает 8! Я не могу создать два разных файла: x1234567 и X1234567, но я могу создать x12345678 и X12345678! Он на 100% воспроизводится с помощью простой команды echo "abc"> filename. Что здесь происходит? Как сделать объем жира 100% нечувствительным к регистру?

1

1 ответ на вопрос

2
Dmitry Grigoryev

This happens because file names longer than 8 characters are not supported by FAT directly, but via LFN extension. FAT is indeed case-insensitive, that's why you can't create x1234567 and X1234567 files. However, when you create files with long names, short file names are created instead, plus an LFN entry which holds the full name.

So when you create files x12345678 and X12345678, these files are given short names like X12345~1 and X12345~2, which are valid and different FAT names. Linux has a relaxed attitude towards checking the uniqueness of LFN entries, so you end up creating two entries which are differentiated only by case; something Windows wouldn't allow. But this is a limitation (or rather a feature) of Windows, not the FAT file system.

Sidenote: I bet you can also create a file named CON in linux on a FAT volume.

See vfat documentation for mount options which define how linux should work with file names.

Итак, я считаю это ошибкой в ​​драйвере Linux. Благодарю. ardabro 9 лет назад 0

Похожие вопросы