Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 63048 - e2fsprogs auto-detects vfat incorrectly
Summary: e2fsprogs auto-detects vfat incorrectly
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
: 82548 (view as bug list)
Depends on:
Blocks:
 
Reported: 2004-09-06 13:17 UTC by Martin Wegner
Modified: 2005-03-11 15:44 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Wegner 2004-09-06 13:17:05 UTC
After upgrading util-linux from 2.12-r4 to 2.12b the auto-detection of vfat does not work. I have an usb stick here with vfat as its filesystem. But when I mount it it is mounted as msdos filesystem which breaks long filenames, etc. . Only mounting with type forced (mount -t vfat) works. auto recognizes msdos which is definitely wrong.

Reproducible: Always
Steps to Reproduce:
1. emerge =util-linux-2.12b
2. mount /dev/sda1 /mnt/stick
3. mount

Actual Results:  
vfat mounted as msdos

Expected Results:  
Mounted as vfat

Portage 2.0.50-r10 (default-x86-1.4, gcc-3.3.4, glibc-2.3.4.20040808-r0, 2.6.8-ck4)
=================================================================
System uname: 2.6.8-ck4 i686 AMD Duron(tm)
Gentoo Base System version 1.5.3
distcc 2.17 i686-pc-linux-gnu (protocols 1 and 2) (default port 3632) [disabled]
Autoconf: sys-devel/autoconf-2.59-r4
Automake: sys-devel/automake-1.8.5-r1
ACCEPT_KEYWORDS="x86 ~x86"
AUTOCLEAN="yes"
CFLAGS="-march=i686 -O3 -pipe"
CHOST="i686-pc-linux-gnu"
COMPILER=""
CONFIG_PROTECT="/etc /usr/X11R6/lib/X11/xkb /usr/kde/2/share/config
/usr/kde/3.2/share/config
/usr/kde/3.3/share/config:/usr/kde/3.3/env:/usr/kde/3.3/shutdown
/usr/kde/3/share/config /usr/share/config /usr/share/texmf/dvipdfm/config/
/usr/share/texmf/dvips/config/ /usr/share/texmf/tex/generic/config/
/usr/share/texmf/tex/platex/config/ /usr/share/texmf/xdvi/ /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d"
CXXFLAGS="-march=i686 -O3 -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoaddcvs ccache sandbox"
GENTOO_MIRRORS="ftp://ftp.tu-clausthal.de/pub/linux/gentoo/
ftp://ftp.easynet.nl/mirror/gentoo/"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://rsync.de.gentoo.org/gentoo-portage"
USE="3dnow X aalib acl acpi acpi4linux alsa apache2 apm avi berkdb blender-game
bonobo bootsplash bzlib cdparanoia cdr clanVoice crypt cups dba dedicated dga
divx4linux doc dvd encode escreen esd fbcon foomaticdb freetype gd gdbm gif
gnome gpm gtk gtk2 imagemagick imlib java jpeg libg++ libwww mad mailwrapper
mbox mikmod mmx motif mpeg mysql ncurses net nls oggvorbis opengl oss pam pdflib
perl png python quicktime radeon readline rtc ruby samba sdl session silverxp
slang sockets spell spl sse ssl stencil-buffer svga tcltk tcpd tetex tokenizer
truetype usb videos wxwindows x86 xchattext xfs xml2 xmms xpm xv zlib"
Comment 1 SpanKY gentoo-dev 2004-10-30 14:48:26 UTC
works fine for me ...

root@vapier 0 ~ # mount /dev/hda1 /mnt/windows/
root@vapier 0 ~ # mount | grep windows
/dev/hda1 on /mnt/windows type vfat (rw)

and no, it is not listed in my /etc/fstab ...

how big is the usb stick ?
what if you try this:
dd if=/dev/sda1 of=disk count=1024
file disk

my windows partition looks like this:
root@vapier 0 ~ # dd if=/dev/hda1 of=disk count=1024
1024+0 records in
1024+0 records out
root@vapier 0 ~ # file disk
disk: x86 boot sector, code offset 0x58, OEM-ID "MSWIN4.1", sectors/cluster 8, Media descriptor 0xf8, heads 255, hidden sectors 63, sectors 13028652 (volumes > 32 MB) , FAT (32 bit), sectors/FAT 12700, rootdir cluster 315611, reserved3 0x1800000, reserved 0x1, serial number 0xa161f00, label: "      WH0RD"
Comment 2 SpanKY gentoo-dev 2004-10-30 14:50:18 UTC
this also works fine for me:
root@vapier 0 ~ # dd if=/dev/zero of=disk count=1024
1024+0 records in
1024+0 records out
root@vapier 0 ~ # mkfs.vfat -F 32 disk
mkfs.vfat 2.10 (22 Sep 2003)
root@vapier 0 ~ # file disk
disk: x86 boot sector, code offset 0x58, OEM-ID " mkdosfs", sectors 1024 (volumes <=32 MB) , Media descriptor 0xf8, heads 64, FAT (32 bit), sectors/FAT 8, serial number 0x41840ca9, label: "           "
root@vapier 0 ~ # mount -o loop disk /mnt/temp/
root@vapier 0 ~ # mount | grep disk
/root/disk on /mnt/temp type vfat (rw,loop=/dev/loop0)
Comment 3 Martin Wegner 2004-10-31 08:37:19 UTC
The size of the stick is 256 MB.

# file img
img: x86 boot sector, code offset 0x3c, OEM-ID " mkdosfs", sectors/cluster 8, root entries 512, Media descriptor 0xf8, sectors/FAT 250, heads 16, sectors 511456 (volumes > 32 MB) , serial
 number 0x413cc3e1, label: "           ", FAT (16 bit)

So, obviously it is a FAT-16 but I made it with mkfs.vfat!! So it also should be recognized as vfat! When I mount it with 2.12b it is auto-detected as msdos filesystem and therefore the filenames have that bad 8.3 format. When mounted explicitely as vfat I have the full filenames again. The mount of 2.12-r4 detected the fs type of the stick as vfat, too - as it should be.

I have several sticks with different file systems that I want to mount via one fstab entry and therefore auto is required.
Comment 4 SpanKY gentoo-dev 2004-10-31 11:18:34 UTC
ah, i can reproduce it now ... see what happens when you provide more info ? :)

root@vapier 0 ~ # dd if=/dev/zero of=disk count=256 ibs=1M
256+0 records in
524288+0 records out
root@vapier 0 ~ # mkfs.vfat -F 16 disk 
mkfs.vfat 2.10 (22 Sep 2003)
root@vapier 0 ~ # file disk
disk: x86 boot sector, code offset 0x3c, OEM-ID " mkdosfs", sectors/cluster 8, root entries 512, Media descriptor 0xf8, sectors/FAT 256, heads 64, sectors 524288 (volumes > 32 MB) , serial number 0x41853a80, label: "           ", FAT (16 bit)
root@vapier 0 ~ # mount -o loop disk /mnt/temp/
root@vapier 0 ~ # mount | grep disk
/root/disk on /mnt/temp type msdos (rw,loop=/dev/loop0)
Comment 5 Martin Wegner 2004-10-31 12:43:07 UTC
Sry, but I did not know what additional information was needed and how to retrieve it. For example, the file command on an image created with dd was unknown to me ... So I hope that this issue can be resolved now ...
Comment 6 Martin Wegner 2004-10-31 13:58:07 UTC
Hm, I'm a bit confused now. I've just re-formatted the stick with

mkfs.vfat -F 32 /dev/sda1

and it works fine now. I saw that you used the -F option with mkfs.vfat . So I looked in the manual page and found this:

--- man mkfs.vfat ---
[...]
       -F FAT-size
              Specifies  the type of file allocation tables used (12, 16 or 32
              bit).  If  nothing  is  specified,  mkdosfs  will  automatically
              select  between  12  and  16  bit,  whatever fits better for the
              filesystem size.  32 bit FAT  (FAT32  format)  must  (still)  be
              selected explicitly if you want it.
[...]
---

By the way mkfs.vfat is only a link to mkdosfs so that it may be right - considering the man page quotation - that the "new" mount recognized FAT16 as msdos.

Now I wonder if FAT16 means "8.3 format is forced" or does it allow longer filenames? (Remember, FAT16 mounted as vfat had longer filenames.)

So, is it right that the "new" mount regognizes FAT16 as msdos or is it not?
Comment 7 SpanKY gentoo-dev 2004-10-31 17:32:02 UTC
right, it looks like FAT32 is auto detected properly but FAT16 isnt

in what man page do you see the quote 'that the "new" mount recognized FAT16 as msdos'

FAT16 supports long filenames, the fact that it's showing up in the 8.3 format is because mount detected the partition as msdos instead of vfat
Comment 8 Martin Wegner 2004-11-01 00:00:54 UTC
As I said I wasn't sure if FAT16 supported long filenames. I had the conclusion that you quoted from the fact that FAT16 is created by mk _msdos_ fs by default and therefore FAT16 should be detected as msdos. As I said I was confused whether FAT16 should be mounted as msdos or vfat.

To sum it up: I know now that FAT16 should be detected as vfat, not as msdos, and therefore it's obviously a bug in the auto-detection.
Comment 9 SpanKY gentoo-dev 2004-11-11 18:40:38 UTC
ok, this seems to be a bug with blkid_get_tag_value()

util-linux has its own fs guessing code, but if it detects that the system supports BLKID, it'll use that instead

so in reality, the util-linux mount does this now:
char *do_guess_fstype(const char *device) {
    return blkid_get_tag_value(blkid, "TYPE", device);
}
Comment 10 SpanKY gentoo-dev 2005-02-25 06:18:35 UTC
*** Bug 82548 has been marked as a duplicate of this bug. ***
Comment 11 SpanKY gentoo-dev 2005-03-09 15:39:52 UTC
could you try e2fsprogs-1.36-r1 ?
Comment 12 Martin Wegner 2005-03-10 22:54:55 UTC
Will test it this afternoon (GMT+1 ;) ) and then give feedback.
Comment 13 Martin Wegner 2005-03-11 15:44:43 UTC
Sry, for me being late, ...

I've just tested it with e2fsprogs-1.36-r2 and it works fine! FAT16 is correctly detected as type vfat.

Closing this bug.