Can't write to /dev/fd0 (openSUSE 11.3 x86_64)

Good evening,

I currently discovered a problem when using the floppy drive /dev/fd0: I can’t use it.
I can mount /dev/fd0 as normal, can create/write a file, but it is not written to the floppy disk. Instead of that the current program (eg vim) hangs (or is “uninterruptable”) until I remove the floppy disk from the drive. Because of the removal I get several errors in /var/log/messages.

What I’m doing:
== snip ==
mount /dev/fd0 /mnt
echo “TEST” > /mnt/test
sync → HANG until I remove the floppy disk]
[sync “completes”/terminates, insert floppy disk]
umount /mnt
== snap ==
(In this example I used echo instead of vim, because it behaves the same in this situation)

The errors I get are as follows:

dmesg | tail

2999.432797] floppy0: disk absent or changed during operation
2999.432802] end_request: I/O error, dev fd0, sector 34
2999.432825] floppy0: disk absent or changed during operation
2999.432830] end_request: I/O error, dev fd0, sector 1
2999.432834] Buffer I/O error on device fd0, logical block 1
2999.432838] lost page write due to I/O error on fd0
2999.432938] floppy0: disk absent or changed during operation
2999.432948] end_request: I/O error, dev fd0, sector 19
2999.432956] Buffer I/O error on device fd0, logical block 19
2999.432961] lost page write due to I/O error on fd0

/var/log/messages:
May 2 00:14:36 hostname kernel: 2999.431039] floppy0: disk removed during i/o
May 2 00:14:36 hostname kernel: 2999.431052] end_request: I/O error, dev fd0, sector 10
May 2 00:14:36 hostname kernel: 2999.431060] quiet_error: 3 callbacks suppressed
May 2 00:14:36 hostname kernel: 2999.431065] Buffer I/O error on device fd0, logical block 10
May 2 00:14:36 hostname kernel: 2999.431070] lost page write due to I/O error on fd0
May 2 00:14:36 hostname kernel: 2999.432739] floppy0: disk absent or changed during operation
May 2 00:14:36 hostname kernel: 2999.432748] end_request: I/O error, dev fd0, sector 19
May 2 00:14:36 hostname kernel: 2999.432755] Buffer I/O error on device fd0, logical block 19
May 2 00:14:36 hostname kernel: 2999.432760] lost page write due to I/O error on fd0
May 2 00:14:36 hostname kernel: 2999.432797] floppy0: disk absent or changed during operation
May 2 00:14:36 hostname kernel: 2999.432802] end_request: I/O error, dev fd0, sector 34
May 2 00:14:36 hostname kernel: 2999.432825] floppy0: disk absent or changed during operation
May 2 00:14:36 hostname kernel: 2999.432830] end_request: I/O error, dev fd0, sector 1
May 2 00:14:36 hostname kernel: 2999.432834] Buffer I/O error on device fd0, logical block 1
May 2 00:14:36 hostname kernel: 2999.432838] lost page write due to I/O error on fd0
May 2 00:14:36 hostname kernel: 2999.432938] floppy0: disk absent or changed during operation
May 2 00:14:36 hostname kernel: 2999.432948] end_request: I/O error, dev fd0, sector 19
May 2 00:14:36 hostname kernel: 2999.432956] Buffer I/O error on device fd0, logical block 19
May 2 00:14:36 hostname kernel: 2999.432961] lost page write due to I/O error on fd0

My system:

uname -a

Linux hostname.site 2.6.34.7-0.5-desktop #1 SMP PREEMPT 2010-10-25 08:40:12 +0200 x86_64 x86_64 x86_64 GNU/Linux

modprobe floppy

lsmod|grep floppy

floppy 68349 0

groups|grep --color floppy

root floppy

I think there’s a problem with the write caches, that can’t be flushed (-> sync). But that’s all I can say…

Suggestions would be appreciated,

aristokrates

Looks more like a floppy with bad blocks and hence a corrupted filesystem. Looks like you should reformat your floppy or toss it out.

I tried several floppies (formatted and working under WinXP), so they’re ok. I don’t think that it’s the filesystem, because I get the same errors when eg. trying to
mkfs.vfat /dev/fd0.
I can hear the “Clack” + light goes on, then ~2 times that there are operations on the floppy and then mkfs hangs as the other programs.
When I use dd if=/dev/zero of=/dev/fd0 bs=512 count=2880 I can hear the ususal sound of a floppy beeing written (several times), until it comes to a point (I think: the end of the write process or the last blocks) and dd hangs.

I already checked the cable and floppy drive (from 2nd PC, WinXP, there working) without changes.
Legacy Floppy A is set to “1.44M, 3.5 in” in BIOS (MB: M4A87T-E, P: AMD Phenom II X4 945)
I can backup the BIOS to floppy from BIOS, so the problem is on openSUSE’s side.

Nonetheless I think you have hardware or floppy problems, the symptoms are typical of that. You should try it with the same hardware with a different OS. It’s not a real test if you format the floppies on a different machine that has WinXP. It could be that your floppy drive on the Linux machine has bad alignment or just bad. Or maybe the floppy controller.

Have several Linux partitions on the same desktop, and I start getting similar floppy problems with the newer kernels but not on older kernels:
Floppy problems: SuSE 11.4 64-bit 2.6.37.6-0.5, Fedora 14 32-bit 2.6.35.12-88.fc14.i686.PAE, Kubuntu 11.04 64-bit 2.6.38-8-generic
No floppy problem: Mandriva 2010.2 2.6.33.7-desktop-2mnb, Kubuntu 10.04 2.6.32-25-generic-pae
Also the floppy drive works fine with Windows 7 and Windows XP on the the same PC

On 05/02/2011 09:06 AM, hallergard wrote:
>
> Have several Linux partitions on the same desktop, and I start getting
> similar floppy problems with the newer kernels but not on older kernels:

sounds like a bug to me, please do it here: http://tinyurl.com/nzhq7j


CAVEAT: http://is.gd/bpoMD
[openSUSE 11.3 + KDE4.5.5 + Thunderbird3.1.8 via NNTP]
HACK Everything → http://www.youtube.com/watch?v=j5b4CCe9pS8&NR=1

Hmm… I tried several systems (usb drive, live cd) with the same result (floppy problem):
Knoppix 6.2.1, 2.6.32.6
Scientific Linux 5.4 (i686), 2.6.18

I will recheck my hardware…
Thanks for your replies!

My problem above was not identical, but was solved by changing the entry in /etc/fstab from /dev//fd0 to /dev/fd0u1440 After this change I can now mount floppies again

ok. I exchanged the floppy drive, but I still can’t write to the floppy.
I think, it must be a linux problem: I created a Windows Boot Floppy (from WinXP) and could boot from it, create and read files on the floppy.
Any ideas what I could try next/how to continue? I’m using openSUSE for some years now and it’s the best OS I’ve been using, but with that thing I don’t have further ideas and don’t know how to localize the problem…

On 05/06/2011 08:36 PM, aristokrates wrote:
>
> I don’t have further ideas and don’t know how to localize the problem…

did you try the work around /dev/fd0u1440 in fstab as mentioned in this
thread??


CAVEAT: http://is.gd/bpoMD
[openSUSE11.3 + KDE4.5.5 + Firefox3.6.17 + Thunderbird3.1.10 via NNTP]
HACK Everything → http://www.youtube.com/watch?v=j5b4CCe9pS8&NR=1

I tried /dev/fd0u1440 but not in fstab. I always used mount directly (“mount /dev/fd0u1440 /mnt”. Does that make any difference?

On 05/07/2011 12:06 AM, aristokrates wrote:
>
> Does that make any difference?

try it (what ‘hallergard’ wrote) and see…

and, let us know if it works for you also…


CAVEAT: http://is.gd/bpoMD
[openSUSE11.3 + KDE4.5.5 + Firefox3.6.17 + Thunderbird3.1.10 via NNTP]
HACK Everything → http://www.youtube.com/watch?v=j5b4CCe9pS8&NR=1

I now tried the fstab version. No difference.
/dev/fd0 /mnt auto noauto,user,sync 0 0 --OR–
/dev/fd0u1440 /mnt auto noauto,user,sync 0 0

I also tried to acces the floppy from WindowsXP in Virtualbox: no success.
After some seconds, Windows asked to format A: but could not continue.

I tried the M-Tools with an example floppy:

# mcheck 
 Volume in drive A has no label
 Volume Serial Number is C034-7C16
Directory for A:/

dab      jar     29041 2009-07-19   9:46 
j2cpplib dll     53248 2009-07-17  22:03 
launch   exe     36864 2009-07-17   7:07 
progra~1 exe    225280 2008-11-04  17:04  ProgramLauncher.exe
pict00~1 jpg    832315 2006-08-22  18:45  PICT0002_1.JPG
        5 files           1 176 748 bytes
                            280 576 bytes free


Verifying files on drive A:...
Disk in drive A: is OK.

I tried to copy a file with “mcopy A:/dab.jar A:/db.jar”. I could hear the drive working for some seconds, but then it stopped. I think it copied some blocks of the file, but couldn’t finish copying or release the floppy…

As you can see with mcheck, reading seems not to be a problem (mdir is working too, whereas mdel fails like mcopy).

On 05/07/2011 12:06 PM, aristokrates wrote:
>
> I now tried the fstab version. No difference.

options to trouble shoot (you pick the order):

-if the floppy shares a cable with a (say) hard drive or CD/DVD put it
on its own cable (or unhook the other device)

-plug the floppy drive cable into the other IDE slot on the motherboard

-replace the floppy drive cable and try again

-replace the floppy drive and try again

-replace the floppy drive and cable and try again

-replace the motherboard and try again

-replace the operating system and try again

-(there may be others, i’m “shooting from the hip”)

a definitive answer to “What is broken?” will not be reached until
success is found…


CAVEAT: http://is.gd/bpoMD
[openSUSE11.3 + KDE4.5.5 + Firefox3.6.17 + Thunderbird3.1.10 via NNTP]
HACK Everything → http://www.youtube.com/watch?v=j5b4CCe9pS8&NR=1

Of course there is the good old algorithm:

foreach part in computer
do
   take out part
   hammer it to pieces
   now it's definitely broken
   replace with new part
   if computer working
     you're finished
done

I’m not liable for your expenses if you take my advice. :wink:

I installed Windows 7 (x86) on an other HD – the floppy worked well (copy/delete/edit/…)

So, now we know that it’s a linux issue…
How can I change the floppy driver? Are there other drivers? How can I query the driver’s version?

It’s been pointed out to me that there’s another, cheaper algorithm.

foreach part in computer
do
   take out part
   replace with new part
   if computer working
     append part to musthammer list
     exit loop
   replace old part
done
foreach part in musthammer
do
   hammer it to pieces
done

However this algorithm is still inadequate in the face of simultaneous failure of multiple parts, but it is assumed that such a coincidence is rare.

Also where the part is software you can symbolically hammer it using a delete program instead of a shredder on the CD.

The main drawback remains the linear search of the first loop. :wink:

On 05/07/2011 07:06 PM, aristokrates wrote:

>
> So, now we know that it’s a linux issue…

so (back at’cha), you might try an earlier linux kernel version…easy
way would be to boot from a live cd from openSUSE 11.2, 11.1, 10.3, 10.2
etc.

when you find which kernel works well with your floppy then add that
info into that thing i suggested way back (five days ago) in
http://tinyurl.com/3z7kn5e


CAVEAT: http://is.gd/bpoMD
[openSUSE11.3 + KDE4.5.5 + Firefox3.6.17 + Thunderbird3.1.10 via NNTP]
HACK Everything → http://www.youtube.com/watch?v=j5b4CCe9pS8&NR=1

Hi, I found the solution on Floppy Drive doesn’t write to disk…
I added “floppy=nodma” and it’s working now as expected.

Seems to be an unresolved kernel issue with the Asus M4A78T-E mainboard.

Thanks again!

Glad you found the hardware issue. It would have been expensive to substitute a motherboard using my diagnosis algorithm. :slight_smile: