Bug 161873

Summary: Problem determine filsystem type when mounting USB storage device
Product: [Fedora] Fedora Reporter: Uno Engborg <uno>
Component: e2fsprogsAssignee: Karel Zak <kzak>
Status: CLOSED RAWHIDE QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 4CC: sct
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2005-09-05 13:48:45 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
FAT filesystem detection improvement
none
Th right patch version ;-) none

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):
util-linux-2.12p-9.3

How reproducible:
Always

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
give:

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/blkid.tab       <-- 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/blkid.tab gives:

<device DEVNO="0x0301" TIME="1119974890" LABEL="/boot"
UUID="ff14ab9a-b896-4eed-bc82-a93ea200847d" SEC_TYPE="ext2"
TYPE="ext3">/dev/hda1</device>
<device DEVNO="0xfd00" TIME="1119140840"
UUID="0e810352-9712-4763-895a-7c99067ad857" SEC_TYPE="ext2"
TYPE="ext3">/dev/dm-0</device>
<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:
http://people.redhat.com/kzak/blkid/bz161873/fat-nomagic.img.gz

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.