# Floppy drive with udev

## volinthius

It seems to be that different floppy devices are not created with udev. I am currently missing these: fd0u1040, fd0u1120, fd0u1440, fd0u1600, fd0u1680, fd0u1722, fd0u1743, fd0u1760, fd0u1840, fd0u1920, fd0u360, fd0u720, fd0u800, fd0u820, fd0u830. With devfs these are created. In udev I have only the /dev/floppy/0 and a symlink /dev/fd0.

The problem is that I cannot format floppies in fdformat (or kfloppy).

Can anyone suggest how do I create the missing devices? I think I only need the fd0u1440.

----------

## Cintra

you should have a /dev/floppy/0

```
# ls -la /dev/fd0

lrwxrwxrwx  1 root root 8 May  2 17:26 /dev/fd0 -> floppy/0

```

have you this in your .config file?

```
#

# Block devices

#

CONFIG_BLK_DEV_FD=y
```

mvh

edit: you could also check dmesg and see if you have a line like this

```
[   31.524505] Floppy drive(s): fd0 is 1.44M
```

----------

## volinthius

Now I have a partial solution. The floppies that I tried to format were low-level formatted to different type. Using the following commands I was able to format them:

```
setfdprm -p /dev/fd0 1440/1440

fdformat /dev/fd0
```

First line changes the floppy device to 1.44M type and the second low-level formats the disk.

Kfloppy is still broken.

----------

## Cintra

You are right, "cannot access /dev/fd0..."

I had never tried it on Gentoo before and it fails here too. (kde 3.4 monolithic)

mkdosfs btw can be found in sys-fs/dosfstools, I see..

I've now emerged the latter and kfloppy shows DOS as an option, but I get the same error.

mvh

edit: I should perhaps add that my kernel is vanilla-sources-2.6.12-rc3, I use the floppy every day to grub boot, and have no problems accessing it to change menu.lst.

btw what versions of kernel and util-linux are you using?

kenchreai: do you have 

```
RC_DEVICE_TARBALL="yes"
```

in /etc/conf.d/rc ?

Yet another edit: does anyone have kfloppy working?

----------

## rickj

gfloppy is also broken, under kernel 2.6.11.7.

At present, I'm booting an ancient 486/33 MS/DOS 6.2 system to format floppies. :oops: 

Works like a charm.

----------

## volinthius

 *Quote:*   

> btw what versions of kernel and util-linux are you using?

 

I am using gentoo-sources version 2.6.11-r7. For me it seems that in udev those extra floppy devices are not created while in devfs they are. I have tried the RC_DEVICE_TARBALL option both ways and it did not work.

If you want to use those extra floppy devices use the devfs. You can control which one is loaded with gentoo=noudev or nodevfs option in grub. See more in here.

----------

## Cintra

Right, I have 3 copies of Gentoo using udev with tarball=yes here (so that DVD+RW packet-writing didn't have to be setup each boot) and if I look at /dev on the partitions which aren't booted the collection of fdxxx are there, just not on any version when its booted! 

I'm not too worried about it, and I guess there aren't many others using the gui either...

Mvh

----------

## jdgill0

I just tried the 

```
fdformat /dev/fd0
```

and had no problems accessing the floppy disk.  I am using udev and have RC_DEVICE_TARBALL="no". My kernel is 2.6.11-gentoo-r7.

By chance do you all have floppy support in the kernel as a module?

[EDIT]

I also only have fd and fd0 in /dev, aside from having /dev/floppy/0.

----------

## Cintra

```
CONFIG_BLK_DEV_IDEFLOPPY=y
```

but are you able to format with the kfloppy gui?

mvh

edit: this was noted at the end of january over in debian

http://lists.debian.org/debian-qt-kde/2005/01/msg00723.html

but I have a feeling they want KDE to change their interface to forget about the multiple fd0* devices.

lol came across this on the ubuntu forum:

Just created a link to /dev/fd0 called /dev/fd0u1440

and kfloppy works...  :Very Happy: 

----------

## jdgill0

No, I can not use kfloppy ... it looks for /dev/fd0u1440.

Unpacking kfloppy's source and looking at format.cpp shows the following

```
const char *fd0H1440[] = { "/dev/fd0u1440", "/dev/floppy/0u1440", "/dev/fd0h1440", "/dev/fd0H1440", 0L } ;

const char *fd0D720[] = { "/dev/fd0u720", "/dev/floppy/0u720", "/dev/fd0D720", "/dev/fd0h720", 0L };

const char *fd0h1200[] = { "/dev/fd0h1200", "/dev/floppy/0h1200", 0L };

const char *fd0h360[] = { "/dev/fd0u360", "/dev/floppy/0u360", "/dev/fd0h360", "/dev/fd0d360", 0L };

const char *fd1H1440[] = { "/dev/fd1u1440", "/dev/floppy/1u1440","/dev/fd1h1440", "/dev/fd1H1440", 0L } ;

const char *fd1D720[] = { "/dev/fd1u720", "/dev/floppy/1u720", "/dev/fd1D720", "/dev/fd1h720", 0L };

const char *fd1h1200[] = { "/dev/fd1h1200", "/dev/floppy/1h1200", 0L };

const char *fd1h360[] = { "/dev/fd1u360", "/dev/floppy/1u360","/dev/fd1h360", "/dev/fd1d360", 0L };

const char *fd0auto[] = { "/dev/fd0", 0L };

const char *fd1auto[] = { "/dev/fd1", 0L };

```

Here you can see that kfloppy is hard coded for the devices. The fd0H1440 would be for the 1.44M 3.5 floppy "size option" in kfloppy, and as you can see it does not contain /dev/fd0.  Although the "auto" option in kfloppy  (for size) shows in this code to point to /dev/fd0 (the fd0auto line), it doesn't work because of the code that follows

```
        // device  drv blks trk flg

        { fd0H1440, 0, 1440, 80, 0 },

        { fd1H1440, 1, 1440, 80, 0 },

        { fd0D720,  0,  720, 80, 0 },

        { fd1D720,  1,  720, 80, 0 },

        { fd0h1200, 0, 1200, 80, 0 },

        { fd1h1200, 1, 1200, 80, 0 },

        { fd0h360,  0,  360, 40, 0 },

        { fd1h360,  1,  360, 40, 0 },

        { fd0auto,  0,    0, 80, 0 },

        { fd1auto,  1,    0, 80, 0 },

```

Here you see fd0auto has wrong numbers for 1.44 floppy, which are those listed for fd0H1440.

So, from what I see, kfloppy will not work with udev until patched.

----------

## Cintra

I found eventually http://bugs.kde.org/show_bug.cgi?id=94392

where this situation is recognized but little action being taken apparently..

mvh

I edited the wrong post, so here it is again:

lol - I came across this on the ubuntu forum:

"Just created a link to /dev/fd0 called /dev/fd0u1440"

```

lrwxrwxrwx   1 root root         8 May 29  2005 fd0u1440 -> /dev/fd0
```

and yes kfloppy works...  :Very Happy: 

----------

## linuxgeek

To format size of 1722 on a normal 1.44MB HD floppy

Do the following:

1. Add the following line to /etc/fdprm

1722/1440       3444    21   2  82    0 0x25 0x00 0xDF     0x0C

2. Format the diskette for 1722k 

setfdprm /dev/fd0 1722/1440 

fdformat /dev/fd0u1722   (or try)  fdformat -n /dev/fd0

----------

