Bug 492404

Summary: udev doesn't create /dev/fd0xxxx devices nodes
Product: [Fedora] Fedora Reporter: Thomas Meyer <thomas.mey>
Component: udevAssignee: Harald Hoyer <harald>
Status: CLOSED WONTFIX QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: low Docs Contact:
Priority: low    
Version: 12CC: harald, web582
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2010-12-05 06:58:35 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
grep on /var/log/messages none

Description Thomas Meyer 2009-03-26 18:13:30 UTC
Description of problem:
$ ls -ld /dev/fd*
lrwxrwxrwx. 1 root root     13 Mar 26 18:51 /dev/fd -> /proc/self/fd
brw-rw----+ 1 root floppy 2, 0 Mar 26 18:48 /dev/fd0

see man page from fdformat:
"DESCRIPTION
       fdformat  does  a low level format on a floppy disk.  device is usually one of the fol-
       lowing (for floppy devices, the major = 2, and the minor  is  shown  for  informational
       purposes only):

              /dev/fd0d360  (minor = 4)
              /dev/fd0h1200 (minor = 8)
              /dev/fd0D360  (minor = 12)"
and so on...

Version-Release number of selected component (if applicable):


How reproducible:
Always

Steps to Reproduce:
1.
2.
3.
  
Actual results:


Expected results:
I want my /dev/fd0xxx device nodes!
Anyone remembering Documentation/devices.txt?


Additional info:

Comment 1 Harald Hoyer 2009-03-27 09:09:37 UTC
Is this a USB floppy?

Comment 2 Thomas Meyer 2009-03-29 21:46:09 UTC
Non of this newish usb floppy drives. Plain old fd controller and driver.

Comment 3 Bug Zapper 2009-06-09 12:40:19 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 11 development cycle.
Changing version to '11'.

More information and reason for this action is here:
http://fedoraproject.org/wiki/BugZappers/HouseKeeping

Comment 4 Harald Hoyer 2009-06-30 10:23:22 UTC
Hmm, we have

/lib/udev/rules.d/50-udev-default.rules:KERNEL=="fd[0-9]", ACTION=="add", ATTRS{cmos}=="?*", RUN+="create_floppy_devices -c -t $attr{cmos} -m %M -M 0640 -G floppy $root/%k"


can you tell me the output of:

# find /sys/ -name cmos -print

Comment 5 Thomas Meyer 2009-06-30 18:23:21 UTC
$ find /sys/ -name cmos -print
/sys/devices/platform/floppy.0/cmos

Comment 6 Harald Hoyer 2010-03-17 11:35:29 UTC
oh.. forgot that I need the output of:
# cat /sys/devices/platform/floppy.0/cmos

Comment 7 Thomas Meyer 2010-03-23 20:45:48 UTC
$ cat /sys/devices/platform/floppy.0/cmos
4

Comment 8 Harald Hoyer 2010-03-24 10:02:46 UTC
what's the output of:

# create_floppy_devices -d -c -t 4 -m 2 -M 0640 -G floppy /dev/fd0

Comment 9 Thomas Meyer 2010-03-24 18:26:55 UTC
After a fresh boot I get this:

$ ls -ld /dev/fd*
lrwxrwxrwx. 1 root root 13 24. Mär 20:22 /dev/fd -> /proc/self/fd

$ lsmod |grep floppy

-> No floppy module loaded

Force load of floppy module:
$ sudo modprobe floppy
WARNING: Deprecated config file /etc/modprobe.conf, all config files belong into /etc/modprobe.d/.
WARNING: All config files need .conf: /etc/modprobe.d/forcedeth, it will be ignored in a future release.

$ ls -ld /dev/fd*
lrwxrwxrwx. 1 root root     13 24. Mär 20:22 /dev/fd -> /proc/self/fd
brw-rw----. 1 root floppy 2, 0 24. Mär 20:25 /dev/fd

$ /lib/udev/create_floppy_devices -d -c -t 4 -m 2 -M 0640 -G floppy /dev/fd0
/dev/fd0u1440 b 0640 2 28
/dev/fd0u1680 b 0640 2 44
/dev/fd0u1722 b 0640 2 60
/dev/fd0u1743 b 0640 2 76
/dev/fd0u1760 b 0640 2 96
/dev/fd0u1920 b 0640 2 100
/dev/fd0u1840 b 0640 2 116
/dev/fd0u1600 b 0640 2 124
/dev/fd0u360 b 0640 2 12
/dev/fd0u720 b 0640 2 16
/dev/fd0u820 b 0640 2 52
/dev/fd0u830 b 0640 2 68
/dev/fd0u1040 b 0640 2 84
/dev/fd0u1120 b 0640 2 88
/dev/fd0u800 b 0640 2 120

$ ls -ld /dev/fd*
lrwxrwxrwx. 1 root root     13 24. Mär 20:22 /dev/fd -> /proc/self/fd
brw-rw----. 1 root floppy 2, 0 24. Mär 20:25 /dev/fd0

Comment 10 Harald Hoyer 2010-03-24 20:30:58 UTC
did you run this as root?

Comment 11 Thomas Meyer 2010-03-25 17:45:30 UTC
no. only "$ sudo modprobe floppy" were ran as root.

Comment 12 Harald Hoyer 2010-03-25 18:53:24 UTC
ok, then please run as root:

# modprobe -r floppy
# udevcontrol --log-priority=debug
# modprobe floppy
# udevadm settle
# udevcontrol --log-priority=err


# grep udev /var/log/messages > messages_udev.txt

and attach messages_udev.txt

also see, if the device nodes are created, after you run as root:

# /lib/udev/create_floppy_devices -d -c -t 4 -m 2 -M 0640 -G floppy /dev/fd0

Comment 13 Thomas Meyer 2010-03-25 19:23:58 UTC
yes, when running "/lib/udev/create_floppy_devices -d -c -t 4 -m 2 -M 0640 -G floppy /dev/fd0" as root, i get this:

# ls -ld /dev/fd*
lrwxrwxrwx. 1 root root       13 25. Mär 19:21 /dev/fd -> /proc/self/fd
brw-rw----. 1 root floppy 2,   0 25. Mär 21:22 /dev/fd0
brw-r-----. 1 root floppy 2,  84 25. Mär 21:23 /dev/fd0u1040
brw-r-----. 1 root floppy 2,  88 25. Mär 21:23 /dev/fd0u1120
brw-r-----. 1 root floppy 2,  28 25. Mär 21:23 /dev/fd0u1440
brw-r-----. 1 root floppy 2, 124 25. Mär 21:23 /dev/fd0u1600
brw-r-----. 1 root floppy 2,  44 25. Mär 21:23 /dev/fd0u1680
brw-r-----. 1 root floppy 2,  60 25. Mär 21:23 /dev/fd0u1722
brw-r-----. 1 root floppy 2,  76 25. Mär 21:23 /dev/fd0u1743
brw-r-----. 1 root floppy 2,  96 25. Mär 21:23 /dev/fd0u1760
brw-r-----. 1 root floppy 2, 116 25. Mär 21:23 /dev/fd0u1840
brw-r-----. 1 root floppy 2, 100 25. Mär 21:23 /dev/fd0u1920
brw-r-----. 1 root floppy 2,  12 25. Mär 21:23 /dev/fd0u360
brw-r-----. 1 root floppy 2,  16 25. Mär 21:23 /dev/fd0u720
brw-r-----. 1 root floppy 2, 120 25. Mär 21:23 /dev/fd0u800
brw-r-----. 1 root floppy 2,  52 25. Mär 21:23 /dev/fd0u820
brw-r-----. 1 root floppy 2,  68 25. Mär 21:23 /dev/fd0u830

Comment 14 Thomas Meyer 2010-03-25 19:27:28 UTC
Created attachment 402656 [details]
grep on /var/log/messages

Comment 15 John Williams 2010-03-30 19:03:26 UTC
Hi 

This problem exists with kernel 2.6.32.9-70.fc12.i686.PAE
and  udev-145-19.fc12 (i686)

Floppy devices are not created.

I have tried putting modprobe floppy in /etc/rc.d/rc.local and also I've tried creating floppy-pnp.conf in modprobe.d

In both cases I get /dev/fd0 and a 'Floppy Drive' icon in 'Computer' on the Gnome desktop. However the icon is unusable (I can't right-click and mount a floppy without using the terminal). I've reported this in bug 533543

Please tell me if I can provide any info. I'd like to get all floppy drives working for everyone.

Thanks
John.

Comment 16 Bug Zapper 2010-04-27 13:19:54 UTC
This message is a reminder that Fedora 11 is nearing its end of life.
Approximately 30 (thirty) days from now Fedora will stop maintaining
and issuing updates for Fedora 11.  It is Fedora's policy to close all
bug reports from releases that are no longer maintained.  At that time
this bug will be closed as WONTFIX if it remains open with a Fedora 
'version' of '11'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version prior to Fedora 11's end of life.

Bug Reporter: Thank you for reporting this issue and we are sorry that 
we may not be able to fix it before Fedora 11 is end of life.  If you 
would still like to see this bug fixed and are able to reproduce it 
against a later version of Fedora please change the 'version' of this 
bug to the applicable version.  If you are unable to change the version, 
please add a comment here and someone will do it for you.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events.  Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

The process we are following is described here: 
http://fedoraproject.org/wiki/BugZappers/HouseKeeping

Comment 17 Thomas Meyer 2010-05-05 19:28:27 UTC
So what is the problem here?
a) running "/lib/udev/create_floppy_devices -d -c -t 4 -m 2 -M 0640 -G
floppy /dev/fd0" as root works.
b) but when started from udevd-work process it doesn't. What UID is udevd-work running under?

Is this some securtiy problem?

Comment 18 Harald Hoyer 2010-05-06 08:25:17 UTC
UID=0, no security problem...

Can you replace /lib/udev/create_floppy_devices with a shell script?

# mv /lib/udev/create_floppy_devices /lib/udev/create_floppy_devices.bin
# cat >/lib/udev/create_floppy_devices << EOF
#!/bin/sh
exec >/dev/shm/floppy.log 2>&1
set -x
/lib/udev/create_floppy_devices.bin -d "\$@"
EOF
# chmod 0755 /lib/udev/create_floppy_devices

and then attach /dev/shm/floppy.log ?

Comment 19 Thomas Meyer 2010-05-06 16:42:33 UTC
Ah! Content of /dev/shm/floppy.log

# cat /dev/shm/floppy.log
+ /lib/udev/create_floppy_devices.bin -d -c -t '' -m 2 -M 0640 -G floppy /dev/fd0

The "-t" parameter seems to passed wrongly!

Comment 20 Harald Hoyer 2010-05-06 16:53:34 UTC
very strange... we have

/lib/udev/rules.d/50-udev-default.rules:KERNEL=="fd[0-9]", ACTION=="add",
ATTRS{cmos}=="?*", RUN+="create_floppy_devices -c -t $attr{cmos} -m %M -M 0640
-G floppy $root/%k"

with ATTRS{cmos}=="?*" we check if "cmos" has a value and pass it with "$attr{cmos}"

Comment 21 Harald Hoyer 2010-05-06 16:55:11 UTC
(In reply to comment #7)
> $ cat /sys/devices/platform/floppy.0/cmos
> 4    

and it really has a value

Comment 22 Harald Hoyer 2010-05-06 17:00:42 UTC
can you try to replace it with:

KERNEL=="fd[0-9]", ACTION=="add", ATTRS{cmos}=="?*", ENV{CMOS_TYPE}="$attr{cmos}", RUN+="create_floppy_devices -c -t $env{CMOS_TYPE} -m %M -M 0640 -G floppy $root/%k"

Comment 23 Thomas Meyer 2010-05-06 17:33:51 UTC
No success; arg[3] still is ''

May  6 19:31:45 localhost udevd-work[13564]: 'create_floppy_devices -c -t $env{CMOS_TYPE} -m %M -M 0640 -G floppy $root/%k' -> 'create_floppy_devices -c -t  -m 2 -M 0640 -G floppy /dev/fd0' (964)
May  6 19:31:45 localhost udevd-work[13564]: 'create_floppy_devices -c -t  -m 2 -M 0640 -G floppy /dev/fd0' started
May  6 19:31:45 localhost udevd-work[13564]: arg[0] 'create_floppy_devices'
May  6 19:31:45 localhost udevd-work[13564]: arg[1] '-c'
May  6 19:31:45 localhost udevd-work[13564]: arg[2] '-t'
May  6 19:31:45 localhost udevd-work[13564]: arg[3] ''
May  6 19:31:45 localhost udevd-work[13564]: arg[4] '-m'
May  6 19:31:45 localhost udevd-work[13564]: arg[5] '2'
May  6 19:31:45 localhost udevd-work[13564]: arg[6] '-M'
May  6 19:31:45 localhost udevd-work[13564]: arg[7] '0640'
May  6 19:31:45 localhost udevd-work[13564]: arg[8] '-G'
May  6 19:31:45 localhost udevd-work[13564]: arg[9] 'floppy'
May  6 19:31:45 localhost udevd-work[13564]: arg[10] '/dev/fd0'
May  6 19:31:45 localhost create_floppy_devices[13570]: custom logging function 0xcab030 registered
May  6 19:31:45 localhost create_floppy_devices[13570]: selinux=1
May  6 19:31:45 localhost udevd-work[13564]: 'create_floppy_devices -c -t  -m 2 -M 0640 -G floppy /dev/fd0' returned with exitcode 0
May  6 19:31:45 localhost udevd-work[13564]: monitor 0x1ccb110 created with '@/org/freedesktop/hal/udev_event'

Comment 24 Thomas Meyer 2010-05-06 17:41:57 UTC
ok. I missed one part of your new rule. Using the correct syntax makes the rule work!

May  6 19:40:33 localhost udevd-work[23446]: 'create_floppy_devices -c -t $env{CMOS_TYPE} -m %M -M 0640 -G floppy $root/%k' -> 'create_floppy_devices -c -t 4 -m 2 -M 0640 -G floppy /dev/fd0' (963)
May  6 19:40:33 localhost udevd-work[23446]: 'create_floppy_devices -c -t 4 -m 2 -M 0640 -G floppy /dev/fd0' started
May  6 19:40:33 localhost udevd-work[23446]: arg[0] 'create_floppy_devices'
May  6 19:40:33 localhost udevd-work[23446]: arg[1] '-c'
May  6 19:40:33 localhost udevd-work[23446]: arg[2] '-t'
May  6 19:40:33 localhost udevd-work[23446]: arg[3] '4'
May  6 19:40:33 localhost udevd-work[23446]: arg[4] '-m'
May  6 19:40:33 localhost udevd-work[23446]: arg[5] '2'
May  6 19:40:33 localhost udevd-work[23446]: arg[6] '-M'
May  6 19:40:33 localhost udevd-work[23446]: arg[7] '0640'
May  6 19:40:33 localhost udevd-work[23446]: arg[8] '-G'
May  6 19:40:33 localhost udevd-work[23446]: arg[9] 'floppy'
May  6 19:40:33 localhost udevd-work[23446]: arg[10] '/dev/fd0'
May  6 19:40:33 localhost create_floppy_devices[23452]: custom logging function 0x1667030 registered
May  6 19:40:33 localhost create_floppy_devices[23452]: selinux=1
May  6 19:40:33 localhost create_floppy_devices[23452]: context 0x1667030 released

Comment 25 Fedora Update System 2010-09-21 14:40:04 UTC
udev-145-22.fc12 has been submitted as an update for Fedora 12.
https://admin.fedoraproject.org/updates/udev-145-22.fc12

Comment 26 Fedora Update System 2010-09-22 00:34:34 UTC
udev-145-22.fc12 has been pushed to the Fedora 12 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update udev'.  You can provide feedback for this update here: https://admin.fedoraproject.org/updates/udev-145-22.fc12

Comment 27 Bug Zapper 2010-11-04 11:25:01 UTC
This message is a reminder that Fedora 12 is nearing its end of life.
Approximately 30 (thirty) days from now Fedora will stop maintaining
and issuing updates for Fedora 12.  It is Fedora's policy to close all
bug reports from releases that are no longer maintained.  At that time
this bug will be closed as WONTFIX if it remains open with a Fedora 
'version' of '12'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version prior to Fedora 12's end of life.

Bug Reporter: Thank you for reporting this issue and we are sorry that 
we may not be able to fix it before Fedora 12 is end of life.  If you 
would still like to see this bug fixed and are able to reproduce it 
against a later version of Fedora please change the 'version' of this 
bug to the applicable version.  If you are unable to change the version, 
please add a comment here and someone will do it for you.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events.  Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

The process we are following is described here: 
http://fedoraproject.org/wiki/BugZappers/HouseKeeping

Comment 28 Bug Zapper 2010-12-05 06:58:35 UTC
Fedora 12 changed to end-of-life (EOL) status on 2010-12-02. Fedora 12 is 
no longer maintained, which means that it will not receive any further 
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of 
Fedora please feel free to reopen this bug against that version.

Thank you for reporting this bug and we are sorry it could not be fixed.