Package: mount, umount, udev, kernel-2.6.21-5-686
Distribution: Debian 6.0.2.1-i386-DVD, Updated to Debian 6.0.3-i386-DVD, Using
Debian 6.0.3-i386-Update-DVD-Volumes 1 and 2
Hardware: MSI MS-7108 Motherboard with Intel Pentium 4, LGA 775, 3.0 GHz, Dual
Processor CPU,
Intel 848P, ICH5, 2 GB of 400 MHz DDR SDRAM, Floppy drive, 8 USB 2.0 ports (USB
1.1 compatible)
Original problem: As shown in detail in my previous message included below
under "----- Original Message ----- ".
Follow-up: I have traced the problem down to the system command "mount". The
floppy drive is recognized
by "udevadm", "mkdosfs", "fsck" and "dd" in creating a file system on a floppy
disk, in checking the file system just
created and in reading the entire floppy in, as shown below. "mount" claims
that the floppy is mounted, but the
supposedly "mounted" file system does not show up in "/proc/mounts" or in
"/etc/mtab". The directory entry
the file system is supposedly "mounted" on, does not show the "mounted" file
system contents. A subsequent
"umount" command results in a "file system was not mounted" error, despite the
claim made by "mount". Attempting
to mount the floppy through the "Gnome Display Manager" brings up a "Media not
found" error message,
despite the fact that the media has been located by "mkdosfs", "fsck" and "dd".
Trace follows:
---------------
root@yg-pc-linux:~# udevadm info --query=all --name=fd0
P: /devices/platform/floppy.0/block/fd0
N: fd0
S: block/2:0
E: UDEV_LOG=3
E: DEVPATH=/devices/platform/floppy.0/block/fd0
E: MAJOR=2
E: MINOR=0
E: DEVNAME=/dev/fd0
E: DEVTYPE=disk
E: SUBSYSTEM=block
E: UDISKS_PRESENTATION_NOPOLICY=0
E: ID_DRIVE_FLOPPY=1
E: DEVLINKS=/dev/block/2:0
root@yg-pc-linux:~#
A test with no floppy disk in the floppy disk drive:
--------------------------------------------------
root@yg-pc-linux:~# mkdosfs -v -v -F 12 /dev/fd0
mkdosfs 3.0.9 (31 Jan 2010)
/dev/fd0: No such device or address
root@yg-pc-linux:~#
A writable floopy disk is inserted into the drive:
-----------------------------------------------
root@yg-pc-linux:~# mkdosfs -v -v -F 12 /dev/fd0
mkdosfs 3.0.9 (31 Jan 2010)
Boot jump code is eb 3c
Using 1 reserved sectors
Disabling alignment due to tiny filesystem
Trying with 1 sectors/cluster:
FAT12: #clu=2847, fatlen=9, maxclu=3072, limit=4080
FAT16: #clu=2841, fatlen=12, maxclu=3072, limit=65520
FAT16: would be misdetected as FAT12
FAT32: not enough clusters (65529)
FAT32: #clu=0, fatlen=23, maxclu=2944, limit=268435440
/dev/fd0 has 2 heads and 18 sectors per track,
logical sector size is 512,
using 0xf0 media descriptor, with 2880 sectors;
file system has 2 12-bit FATs and 1 sector per cluster.
FAT size is 9 sectors, and provides 2847 clusters.
There is 1 reserved sector.
Root directory contains 224 slots and uses 14 sectors.
Volume ID is f5142585, no volume label.
root@yg-pc-linux:~#
root@yg-pc-linux:~# fsck -v -v /dev/fd0
fsck from util-linux-ng 2.17.2
dosfsck 3.0.9 (31 Jan 2010)
dosfsck 3.0.9 (31 Jan 2010)
dosfsck 3.0.9, 31 Jan 2010, FAT32, LFN
Checking we can access the last sector of the filesystem
Boot sector contents:
System ID "mkdosfs"
Media byte 0xf0 (5.25" or 3.5" HD floppy)
512 bytes per logical sector
512 bytes per cluster
1 reserved sector
First FAT starts at byte 512 (sector 1)
2 FATs, 12 bit entries
4608 bytes per FAT (= 9 sectors)
Root directory starts at byte 9728 (sector 19)
224 root directory entries
Data area starts at byte 16896 (sector 33)
2847 data clusters (1457664 bytes)
18 sectors/track, 2 heads
0 hidden sectors
2880 sectors total
Checking for unused clusters.
/dev/fd0: 0 files, 0/2847 clusters
root@yg-pc-linux:~#
root@yg-pc-linux:~# dd if=/dev/fd0 of=floppy_data
2880+0 records in
2880+0 records out
1474560 bytes (1.5 MB) copied, 40.5315 s, 36.4 kB/s
root@yg-pc-linux:~#
A file is placed in the floppy mount point directory PRIOR to mounting:
-----------------------------------------------------------------------
root@yg-pc-linux:~# ls -tal /media/floppy0
total 12
drwxr-xr-x 2 root root 4096 Nov 12 17:55 .
-rw-r--r-- 1 root root 3339 Nov 12 17:55 BIOS_ODDLY_READ
drwxr-xr-x 14 root root 4096 Nov 11 13:36 ..
root@yg-pc-linux:~#
After the successful mount, the file that was in the directory should not show
up,
as the directory then would be pointing to the just cleanly formatted, empty
floppy file system:
--------------------------------------------------------------------------------------------
root@yg-pc-linux:~# mount -v -v -tvfat /dev/fd0 /media/floppy0
/dev/fd0 on /media/floppy0 type vfat (rw)
root@yg-pc-linux:~#
The file in the directory still shows, indicating that "mount" has not
performed well at all:
---------------------------------------------------------------------------------------
root@yg-pc-linux:~# ls -tal /media/floppy0
total 12
drwxr-xr-x 2 root root 4096 Nov 12 17:55 .
-rw-r--r-- 1 root root 3339 Nov 12 17:55 BIOS_ODDLY_READ
drwxr-xr-x 14 root root 4096 Nov 11 13:36 ..
root@yg-pc-linux:~#
root@yg-pc-linux:~# more /proc/mounts
rootfs / rootfs rw 0 0
none /sys sysfs rw,nosuid,nodev,noexec,relatime 0 0
none /proc proc rw,nosuid,nodev,noexec,relatime 0 0
none /dev devtmpfs rw,relatime,size=1032876k,nr_inodes=218469,mode=755 0 0
none /dev/pts devpts rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000 0 0
/dev/disk/by-uuid/d1879d4e-42c2-48f3-8fed-d1ecbbdb9cd1 / ext3
rw,relatime,errors=remount-ro,data=ordered 0 0
tmpfs /lib/init/rw tmpfs rw,nosuid,relatime,mode=755 0 0
tmpfs /dev/shm tmpfs rw,nosuid,nodev,relatime 0 0
/dev/sdb1 /Backup ext3 rw,relatime,errors=continue,data=ordered 0 0
/dev/sdc2 /Old_files ext2 rw,relatime,errors=continue 0 0
/dev/sda1 /tmp ext3 rw,relatime,errors=continue,data=ordered 0 0
fusectl /sys/fs/fuse/connections fusectl rw,relatime 0 0
binfmt_misc /proc/sys/fs/binfmt_misc binfmt_misc
rw,nosuid,nodev,noexec,relatime 0 0
nfsd /proc/fs/nfsd nfsd rw,relatime 0 0
root@yg-pc-linux:~# more /etc/mtab
/dev/sdc1 / ext3 rw,errors=remount-ro 0 0
tmpfs /lib/init/rw tmpfs rw,nosuid,mode=0755 0 0
proc /proc proc rw,noexec,nosuid,nodev 0 0
sysfs /sys sysfs rw,noexec,nosuid,nodev 0 0
udev /dev tmpfs rw,mode=0755 0 0
tmpfs /dev/shm tmpfs rw,nosuid,nodev 0 0
devpts /dev/pts devpts rw,noexec,nosuid,gid=5,mode=620 0 0
/dev/sdb1 /Backup ext3 rw 0 0
/dev/sdc2 /Old_files ext2 rw 0 0
/dev/sda1 /tmp ext3 rw 0 0
fusectl /sys/fs/fuse/connections fusectl rw 0 0
binfmt_misc /proc/sys/fs/binfmt_misc binfmt_misc rw,noexec,nosuid,nodev 0 0
nfsd /proc/fs/nfsd nfsd rw 0 0
root@yg-pc-linux:~#
"umount" claims that /dev/fd0 was not mounted:
------------------------------------------------
root@yg-pc-linux:~# umount -v /dev/fd0
Could not find /dev/fd0 in mtab
umount: /dev/fd0: not mounted
root@yg-pc-linux:~#
-- Yekta
Yekta Gursel, Ph. D.
Address:
5444 Baldwin Avenue
Temple City
California, 91780-2624
Phone: (626) 454-4029
E-mail: [email protected]
----- Original Message -----
From: yekta.gursel
To: [email protected]
Cc: yekta.gursel
Sent: Monday, October 24, 2011 4:41 PM
Subject: Floppy driver kernel module does not work in Debian Squeeze 6.0.2.1...
Distribution: Debian Squeeze 6.0.2.1
Kernel module: /lib/modules/2.6.32-5-686/kernel/drivers/block/floppy.ko
Device: /dev/fd0
Device major: 2
Device minor: 0
Bug: Attempting to mount a 1.44 MB, 3.5" floppy in the floppy drive on
/dev/fd0 fails
with "No media found in the drive".
Software clues: "/usr/bin/floppymeter" does spin the drive with media in it.
"/usr/bin/floppycontrol" also
spins the drive, but also fails to detect the media. Note that the device
minor number USUALLY corresponds
to the floppy disk density with 0 as "double density (dd)", 1 as "high density
(hd, 1.44 MB)" and 2 as
"extra density (ed)". This is obviously not the case in this kernel module.
It somehow has linked the minor device
number 0 to the (hd) floppy format. I tried other minor device numbers, they
did not work at all.
Hardware test:
Hardware: Processor: Intel Pentium 4, 3.0 GHz LGA 775, Motherboard: MSI
MS-7108 Neo2-V, 848P support.
Test: I set the BIOS to boot only from the floppy device. I used a bootable
MS-DOS disk made by Microsoft
Corporation's Microsoft Windows Vista. I booted the machine with no floppy
disk in the drive and when
the " No bootable media found, insert media and press any key" message
appeared on the screen, I inserted the
MS-DOS bootable floppy into the drive. The machine successfully booted into
MS-DOS, with a "A:>" prompt.
I verified the floppy-disk read operation with the "A:> DIR" command to the
MS-DOS which listed the directory
of files on the disk. I then used the MS-DOS "A:> COPY COMMAND.COM TEST123"
command to make
a copy of the COMMAND.COM file on the same disk to verify the floppy-disk write
operation. The machine
performed this operation successfully as well. The last two test commands
were: "A:> DEL TEST123" which
deleted the redundant test file, and "A:> DIR" which verified that the floppy
disk was not garbled by the file
delete operation.
-- Yekta
Yekta Gursel, Ph. D.
Address:
5444 Baldwin Avenue
Temple City
California, 91780-2624
Phone: (626) 454-4029
E-mail: [email protected]