4

I'm using a box with Debian that has gone through many updates (at least lenny, squeeze, wheezy).

After a long time, I wanted to mount a floppy again which didn't work as it used to. I found a tutorial explaining I had to comment out the line about /dev/fd0 in /etc/fstab because the floppy module was dropped from the kernel and isn't invoked during boot.

Link: How to enable your floppy driver, refers to Can't read Floppy Disks.

The fix works, I can mount the floppy just fine. But now, I'm curious.

The big question: Why does commenting out the line in /etc/fstab fix the problem? I thought the info in fstab just makes typing # mount commands easier, allows applications to find mounting info, and lets you omit stuff like -t and the mount point? Commenting out a line in /etc/fstab will surely not load a kernel module, or does it?! Do I really enable the floppy driver itself when modifying /etc/fstab?

EDIT, just to be sure...

After a good comment asked if this was really the behavior of my system, I double-checked.

With

/dev/fd0        /media/floppy0  auto    rw,user,noauto  0       0

in /etc/fstab, mounting doesn't work:

box:/home/zebonaut# mount -t vfat /dev/fd0 /media/floppy0/
box:/home/zebonaut# ls -l /media/floppy0
total 0
box:/home/zebonaut# umount /media/floppy0
umount: /media/floppy0: not mounted
box:/home/zebonaut#

With

#/dev/fd0        /media/floppy0  auto    rw,user,noauto  0       0

in /etc/fstab, I can mount the floppy just fine:

box:/home/zebonaut# mount -t vfat /dev/fd0 /media/floppy0/
box:/home/zebonaut# ls -l /media/floppy0
total 1241
-rwxr-xr-x 1 root root 340498 Sep  5  2002 file.01
-rwxr-xr-x 1 root root 410952 Sep  5  2002 file.02
-rwxr-xr-x 1 root root  43008 Jan 23  2000 file.03
-rwxr-xr-x 1 root root  26060 Jan  6  2005 file.04
-rwxr-xr-x 1 root root  20992 Jan 19  2000 file.05
-rwxr-xr-x 1 root root  54784 May 14  1999 file.06
-rwxr-xr-x 1 root root 217600 Apr 15  2005 file.07
-rwxr-xr-x 1 root root  32256 Mar 23  2005 file.08
-rwxr-xr-x 1 root root  32768 Jan 20  2000 file.09
-rwxr-xr-x 1 root root  91136 Jan 20  2000 file.10
box:/home/zebonaut# umount /media/floppy0
box:/home/zebonaut#

It really is this strange. I can turn on or off my ability to mount the floppy by opening /etc/fstab with an editor and putting a # in front of the line with the floppy info.

zebonaut
  • 1,115
  • 3
  • 16
  • 31
  • 3
    Are you _sure_ that commenting out the line is relevant? Can't you mount without commenting it out if you do it explicitly: `sudo mount -t msdos /def/fd0 /media/floppy0` ? It seems more likely that the problem is that the floppy won't mount automatically to boot via the `fstab` because the relevant module is not loaded so you need to do it manually. – terdon Jan 30 '14 at 19:32
  • @terdon One and the same mount command works one time and it doesn't the other. I added the relevant info as an edit to my original question. – zebonaut Feb 01 '14 at 17:34
  • Well, I'll be... Weird. – terdon Feb 01 '14 at 17:36
  • Does anything useful show up in `dmesg` when you try to mount it with the entry still in `fstab`? – Alex Layton Feb 06 '14 at 01:19
  • @AlexLayton The only thing I get in dmesg is `[ 6855.928083] FAT-fs (fd0): utf8 is not a recommended IO charset for FAT filesystems, filesystem will be case sensitive!`. Strangely, this shows up with the line in `fstab`, and without the line (or commented out). Which leads me to think it really isn't a driver issue because mount is at least doing something... – zebonaut Feb 06 '14 at 09:47
  • [This](https://lists.debian.org/debian-user/2010/12/msg00547.html) old thread mentions that udisks-daemon prevents mounting the drive. This very bug might not be the culprit in your case, but maybe something similar: a daemon that would somehow mess up with your attempts to mount the drive; and that would be enabled or disabled depending on the entries in fstab? – Olivier Cailloux Feb 18 '15 at 22:20

3 Answers3

0

Not a solution but a path for potentially determining why; you could use strace to debug what the difference is when doing this.

$ strace -s 1000 -o some.log mount -t vfat /dev/fd0 /media/floppy0/

Then look through the log file to see why the mount command is getting tripped up when the /dev/fd0 entry is uncommented in /etc/fstab.

slm
  • 363,520
  • 117
  • 767
  • 871
0

As unsatisfying as it is, I can not any more reproduce what I have mentioned in my question. Mounting the floppy works well either way now.

The only thing I have done was to edit the formatting of /etc/fstab, i.e. I have put tabs where spaces were and I may have modified some line breaks. I have tried to undo the edit, and still could not reproduce the strange behavior. I'm sorry I don't have an exact copy of the original file.

The most likely reason may have been a syntax error in /etc/fstab within the line for the floppy (too many spaces before the line break or something of similar strangeness). It may have been that during an update, a script may have looked at whatever it found in /etc/fstab, and it may have tried to parse it to some newer standard, breaking it in the process.

Sorry this is guesswork mostly, but for whatever reason, the problem is gone.

I'm fairly sure now it's really not a driver issue.

zebonaut
  • 1,115
  • 3
  • 16
  • 31
-1

Your 3rd column should be the file system type, I don't think auto is valid.

X Tian
  • 10,413
  • 2
  • 33
  • 48
  • I tried `/dev/fd0 /media/floppy0 vfat rw,user,noauto 0 0` in `/etc/fstab`, and mounting still doesn't work. Also, when I manually type a full mount instruction on the command line (`# mount -t vfat /dev/fd0 /media/floppy0`), it works with the line in `fstab` commented out, and it doesn't when the line is there. – zebonaut Feb 06 '14 at 16:56
  • 1
    `auto` is a valid option for file system type. – Alex Layton Feb 06 '14 at 17:29
  • @Alex Layton yes, have just seen auto is same as saying none, sorry. @zebonaut `mount -vvv ...` with #-in and #-out might help to debug. – X Tian Feb 06 '14 at 18:13