Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 161873 - Problem determine filsystem type when mounting USB storage device
Summary: Problem determine filsystem type when mounting USB storage device
Alias: None
Product: Fedora
Classification: Fedora
Component: e2fsprogs
Version: 4
Hardware: i386
OS: Linux
Target Milestone: ---
Assignee: Karel Zak
QA Contact:
Depends On:
TreeView+ depends on / blocked
Reported: 2005-06-27 23:44 UTC by Uno Engborg
Modified: 2007-11-30 22:11 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2005-09-05 13:48:45 UTC

Attachments (Terms of Use)
FAT filesystem detection improvement (deleted)
2005-07-07 14:54 UTC, Karel Zak
no flags Details | Diff
Th right patch version ;-) (deleted)
2005-07-07 15:32 UTC, Karel Zak
no flags Details | Diff

Description Uno Engborg 2005-06-27 23:44:06 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; sv-SE; rv:1.7.8) Gecko/20050524 Fedora/1.0.4-4 Firefox/1.0.4

Description of problem:
When a MS-DOS formated floppy is connected this entry is autogenerated in /etc/fstab

/dev/sda                /media/floppy           auto pamconsole,exec,noauto,managed 0 0

However, it doesn't seam like the "auto" for filsystemtype is understood. I.e. a mount /media/floppy will not mount the filesystem even if vfat is listed in /etc/filesystems 

mount should try to use /etc/filesystems but as far as i can see from an strace that file is never accessed.

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1. Use Gnome, (the bug is independent of Gnome, but this description is not)
2. Attach USB floppy or USB hard drive containing something mounaable as vfat
3. Watch fildailog saying it need to know the filesystem type

Actual Results:  Filesystem not mounted, but an fstab entry as described abowe is generated.
The floppy can be mounted from the command line using mount -t vfat /dev/sda /media/floppy. However this is not exactly good usabilty

Expected Results:  Floppy drive mounted, as it did in FC3

Additional info:

The USB floppy drive used is of unkown brand, as I can't read the logo but it could be something like ISA
However, there is a model code on the bottom reading: YD-8U10

Comment 1 Karel Zak 2005-06-28 07:19:43 UTC
Please, try:

- connect you USB floppy
- send me result from: dmesg | grep sda
- remove /dev/sda entry from fstab
- try mount it without '-t' option

    mount /dev/sda /media/floppy

it means the mount must itself detects filesystem type from device.

Comment 2 Uno Engborg 2005-06-28 17:04:14 UTC
dmesg|grep sda gives:

SCSI device sda: 2880 512-byte hdwr sectors (1 MB)
sda: Write Protect is off
sda: Mode Sense: 00 46 94 00
sda: assuming drive cache: write through
SCSI device sda: 2880 512-byte hdwr sectors (1 MB)
sda: Write Protect is off
sda: Mode Sense: 00 46 94 00
sda: assuming drive cache: write through
 sda: unknown partition table
Attached scsi removable disk sda at scsi0, channel 0, id 0, lun 0

When the fstab entry is removed,  mount /dev/sda /media/floppy

mount: you must specify the filesystem type

Comment 3 Karel Zak 2005-06-29 11:11:56 UTC
Please, send me results from 
  cat /proc/partitions
  cat /etc/       <-- after mount call

BTW, mount with option '-v' provides more information. 

This looks like problem:
   sda: unknown partition table

Comment 4 Uno Engborg 2005-06-29 13:09:26 UTC
cat /proc/partitions with usb drive connected gives:

major minor  #blocks  name

   3     0   58605120 hda
   3     1     104391 hda1
   3     2   58500697 hda2
 253     0   57278464 dm-0
 253     1    1179648 dm-1
  33     0       7872 hde
  33     1       7152 hde1
   8     0       1440 sda

Then I do:
mount -v -t vfat /dev/sda /media/floppy
/dev/sda on /media/floppy type vfat (rw)

As you can see the disk is now mounted.
Then cat /etc/ gives:

<device DEVNO="0x0301" TIME="1119974890" LABEL="/boot"
UUID="ff14ab9a-b896-4eed-bc82-a93ea200847d" SEC_TYPE="ext2"
<device DEVNO="0xfd00" TIME="1119140840"
UUID="0e810352-9712-4763-895a-7c99067ad857" SEC_TYPE="ext2"
<device DEVNO="0xfd01" TIME="1119140840"
UUID="168b29d3-5582-4b8e-b8df-e96582698d70" TYPE="swap">/dev/dm-1</device>
<device DEVNO="0x1600" TIME="1119910784" TYPE="iso9660">/dev/hdc</device>

If I remove the disk and reataches it and then
do mount -v /media/floppy I get:

mount: you didn't specify a filesystem type for /dev/sda
       I will try all types mentioned in /etc/filesystems or /proc/filesystems
mount: you must specify the filesystem type

But vfat, is listed in both /etc/filesystems and /proc/filesystems

Comment 5 Karel Zak 2005-07-07 14:54:32 UTC
Created attachment 116477 [details]
FAT filesystem detection improvement

The problem is in the libblkid from e2fsprogs that uses very limited FAT
filesystem detection by magic strings only. It seems that valid FAT superblock
could be without "FAT12", "FAT16" or "FAT32" string. An example HAL has better
heuristic for FAT detection. 

This patch should be fix the problem. A test FAT image:

Comment 6 Karel Zak 2005-07-07 15:17:29 UTC
Comment on attachment 116477 [details]
FAT filesystem detection improvement

Oops.. I sent old version of the patch. Sorry.

Comment 7 Karel Zak 2005-07-07 15:32:47 UTC
Created attachment 116478 [details]
Th right patch version ;-)

Comment 8 Karel Zak 2005-09-05 13:48:45 UTC
Fixed in FC5 (devel tree). I don't expect fix in FC4 now -- it's minor problem
and the fix should be tested first.

Note You need to log in before you can comment on or make changes to this bug.