Bug 129671

Summary: k3b does not find SCSI drives on first startup
Product: [Fedora] Fedora Reporter: Ralf Ertzinger <redhat-bugzilla>
Component: k3bAssignee: Harald Hoyer <harald>
Status: CLOSED DUPLICATE QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: rawhideCC: 64bit_fedora
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2006-02-21 19:05:05 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:
Bug Depends On:    
Bug Blocks: 123268    
Attachments:
Description Flags
strace -f -e trace=open,ioctl
none
Output of the commands requested above none

Description Ralf Ertzinger 2004-08-11 18:49:01 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.2)
Gecko/20040809

Description of problem:
When starting k3b for the first time after system startup, drives
connected to the SCSI bus are not found. IDE drives show up fine.

Quitting k3b and restarting makes the SCSI drives reappear, as does
selecting the "Refresh" button in the devices tab of the configuration.
Using the last method does not make the drives appear in the directory
tree in the upper left corner of the k3b window, though.

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

How reproducible:
Always

Steps to Reproduce:
1. Start k3b for the first time after system startup
2. Look if all drives are detected
3.
    

Actual Results:  SCSI drives are missing from the directory tree and
the configuration->devices tab, IDE drives show up.

Expected Results:  All drives show

Additional info:

Comment 1 Harald Hoyer 2004-08-20 12:11:25 UTC
which kernel version?

Comment 2 Ralf Ertzinger 2004-08-21 21:47:06 UTC
Last tested version was kernel-2.6.7-1.515. I am downloading the
latest updates now.

Comment 3 Ralf Ertzinger 2004-08-23 15:23:05 UTC
Can't test currently due to device node problems related to udev.

Comment 4 Harald Hoyer 2004-08-24 15:16:01 UTC
update to the newest udev

Comment 5 Ralf Ertzinger 2004-08-24 23:37:35 UTC
Doing so and building a new initrd brought back the SCSI device nodes.

The behaviour is still there with 2.6.8-1.526, but I noticed something
helpful.

k3b does not detect the SCSI drives if the sr_mod kernel module is not
loaded when starting k3b (the module is loaded on demand, and is often
not needed before). k3b causes the module to be loaded, but seemingly
not early enough to actually detect the drives. When quitting k3b, the
module is loaded, and so the next start detects the SCSI drives.
Manually unloading sr_mod confirms this behaviour (no SCSI drives on
next k3b startup).

Comment 6 Harald Hoyer 2004-09-03 10:19:40 UTC
ok, new k3b, new cdrtools and new dvd+rw-tools should be worth a retry :)

Comment 7 Ralf Ertzinger 2004-09-03 10:54:39 UTC
With a system current as of today (kernel, udev, k3b...), k3b does not
see any drives at all on startup. This is mainly due to udev
weirdness, the /dev/cdrom*, /dev/cdwriter* et al links are missing,
and because of this the permissions on the devices are not set
correctly by /etc/security/console.perms. In addition, the SCSI CDROM
driver is not being loaded, so the SCSI device nodes are missing, too.

When loading sr_mod manually, and setting the permissions on all CDROM
device nodes to enable read/write access by every user, k3b detects
the DVD writer connected to /dev/hdc. This device is detected
correctly as a writer, the writing modes displayed in the config
dialog are correct, as are the "writes ..." and "reads ..." entries.

The SCSI drives, however, remain invisible. sr_mod is loaded, /dev/sr*
has the correct permissions. Manually adding the devices in the
configuration dialog fails, too. k3b claims that there is no
additional device to be found.

Comment 8 Harald Hoyer 2004-09-22 08:46:30 UTC
should be fixed now with new k3b, cdrecord and udev

Comment 9 Ralf Ertzinger 2004-09-22 12:19:04 UTC
The IDE writer is seen by k3b, and seems to be fully functional (I
have only looked at the config screen, but all the necessary frobs are
set as they ought to be).

All SCSI drives remain invisible to the system at large, due to
missing /dev entries. Please see Bug 131762 and Bug 133171 for similar
reports.

Comment 10 Harald Hoyer 2004-09-22 12:37:03 UTC
/dev/sr? are now mapped to /dev/scd? with the new udev package

Comment 11 Ralf Ertzinger 2004-09-22 12:44:12 UTC
Which udev would that be? I have udev-030-27, and neither sr? nor scd?
appear in /dev.

kernel is 2.6.8-1.584, initrd was rebuilt to include latest udev.

Oh, manually loading sr_mod makes /dev/scdX and associated /dev/cdromX
appear, but sr_mod is not loaded automatically, because the device
nodes are missing. Kind of a chicken-egg-problem.

Comment 12 Harald Hoyer 2004-09-22 12:48:19 UTC
newesr udev is udev-032 in rawhide

Comment 13 Harald Hoyer 2004-09-22 12:50:16 UTC
if I load my scsi host adapter module, sr_mod is loaded automatically...
kernel-2.6.8-1.541smp

Comment 14 Ralf Ertzinger 2004-09-22 12:56:21 UTC
OK, the newest udev had not made it's way to my mirror-of-choice, I am
getting it from another mirror now.

The scsi host adapter module is loaded by initrd in my case (I don't
know why, since there are no hard disks attached to it anyway, but
mkinitrd seems happy that way, and no harm is done), but it does not
load sr_mod.

Comment 15 Ralf Ertzinger 2004-09-22 13:10:24 UTC
Please see Bug 133194.

Comment 16 Harald Hoyer 2004-09-22 13:50:29 UTC
On my system, if the scsi adapter module is loaded it automatically
loads the sr_mod module after detecting the CDROM attached to it...

Comment 17 Harald Hoyer 2004-09-23 16:20:05 UTC
# rpm -qf /etc/hotplug/scsi.agent
hotplug-2004_04_01-5

this hotplug agent loads sr_mod for me.

you may set in /etc/sysconfig/hotplug:
DEBUG=1
and watch /var/log/messages

Comment 18 Harald Hoyer 2004-09-23 16:20:41 UTC
which scsi hostadapter do you have?

Comment 19 Ralf Ertzinger 2004-09-23 23:20:05 UTC
Up to the latest and greatest udev/kernel/k3b, and still no luck on
the automatic SCSI drive loading.

The hostadapter is a "Adaptec AHA-2940U/UW/D / AIC-7881U" (courtesty
of lspci), driver is aic7xxx, loaded by initrd (thus, sr_mod can not
be loaded by hotplug when the hostadapter comes up, because sr_mod.ko
is not part of the initrd image).

I tried inserting the sr_mod driver manually, before logging into X,
which creates /dev/scdX and several /dev/cdromX entries. So far, so good.

Logging into X chown()s all cdrom entries (1 IDE, 3 SCSI) to my user
id. Fine. But k3b still does not see any of the SCSI drives. Something
must still be missing.

So we have two different problems here, I think.

Comment 20 Harald Hoyer 2004-09-24 08:03:52 UTC
could you please attach the output of:
$ strace -f -o open,ioctl k3b



Comment 21 Ralf Ertzinger 2004-09-24 12:30:51 UTC
I assume you meant
$ strace -f -e trace=open,ioctl k3b

Comment 22 Ralf Ertzinger 2004-09-24 12:31:30 UTC
Created attachment 104261 [details]
strace -f -e trace=open,ioctl

Comment 23 Harald Hoyer 2004-09-24 12:41:50 UTC
what does:
$ cat /proc/sys/dev/cdrom/info

say?

Comment 24 Harald Hoyer 2004-09-24 12:45:31 UTC
Hmm... k3b checks...

4848  open("/dev/scd0", O_RDWR|O_NONBLOCK) = 11
4848  ioctl(11, CDROMAUDIOBUFSIZ, 0xfeee85b8) = 0
4848  ioctl(11, 0x5386, 0xfeee8724)     = 0
4848  open("/dev/scd1", O_RDWR|O_NONBLOCK) = 11
4848  ioctl(11, CDROMAUDIOBUFSIZ, 0xfeee85b8) = 0
4848  ioctl(11, 0x5386, 0xfeee8724)     = 0
4848  open("/dev/scd2", O_RDWR|O_NONBLOCK) = 11
4848  ioctl(11, CDROMAUDIOBUFSIZ, 0xfeee85b8) = 0
4848  ioctl(11, 0x5386, 0xfeee8724)     = 0

Comment 25 Ralf Ertzinger 2004-09-24 16:34:06 UTC
[sun@nausicaa ~ :) 1]$ cat /proc/sys/dev/cdrom/info
CD-ROM information, Id: cdrom.c 3.20 2003/12/17

drive name:             sr2     sr1     sr0     hdc
drive speed:            1       6       0       40
drive # of slots:       1       1       1       1
Can close tray:         1       1       1       1
Can open tray:          1       1       1       1
Can lock tray:          1       1       1       1
Can change speed:       0       1       1       1
Can select disk:        0       0       0       0
Can read multisession:  1       1       1       1
Can read MCN:           1       1       1       1
Reports media changed:  1       1       1       1
Can play audio:         1       1       1       1
Can write CD-R:         0       1       0       1
Can write CD-RW:        0       1       0       1
Can read DVD:           0       0       1       1
Can write DVD-R:        0       0       0       1
Can write DVD-RAM:      0       0       0       0
Can read MRW:           1       1       1       1
Can write MRW:          1       1       1       1
Can write RAM:          1       1       1       1

Comment 26 Ralf Ertzinger 2004-10-05 18:04:06 UTC
For some obscure reason k3b now manages to see one of the SCSI drives
as well (scd0, the DVD drive). I am not sure what triggered that, but
it may be a newer kernel (currently -590)

Comment 27 Ralf Ertzinger 2004-10-05 21:25:52 UTC
OK, I've found the obscure reason: there was a CD in the drive.
Whenever a medium is in one of the SCSI drives when k3b starts (does
not have to be mounted, just be there), k3b detects the drive.

This seems to leave some "residue" somehow. Example:

1) Insert CD in SCSI drive
2) start k3b -> scsi drive is detected (correct name, device,
properties), IDE drive is detected (as always)
3) quit k3b
4) remove disk from SCSI drive
5) start k3b -> IDE drive is now displayed twice, once with it's own
device node and properties, once as the (now empty) SCSI drive (with
the device node and properties of the SCSI drive, but with the name of
the IDE drive)

Very strange things happen.

Comment 28 Harald Hoyer 2004-10-06 15:23:38 UTC
This could be related to bug 134822 
could you try:
# for i in /dev/scd*;do dvd+rw-mediainfo $i;done
and
# for i in /dev/sg*;do  cdrecord -VVVVVVVV -inq dev=$i;done
# for i in /dev/scd*;do  cdrecord -VVVVVVVV -inq dev=$i;done


Comment 29 Ralf Ertzinger 2004-10-06 16:36:46 UTC
Created attachment 104846 [details]
Output of the commands requested above

This is a "script" dump, there may be funny characters in it. The commands are
executed without disks in the drives first, and with disks in them in the
second run.

Comment 30 Ralf Ertzinger 2004-10-06 16:41:39 UTC
When I start k3b after doing this (without disks in the drives), I get
three drives listed in the config dialog. All are called "_NEC DVD_RW
ND-2500A" (which is the drive at hdc), but the properties and devices
are those of scd0 (the pioneer dvd reader) and scd2 (the traxdata cd
writer). scd1 does not show, but I suspect I know why that is.

Comment 31 Ralf Ertzinger 2004-10-06 16:46:15 UTC
Sorry for the confusion, but scd2 is not the traxdata writer, but the
plextor cd drive.

Comment 32 Harald Hoyer 2004-10-06 16:47:47 UTC
ok, it seems that the inquiry does not succeed without disks in the
drives... does k3b find all with disks in the drive?

Comment 33 Ralf Ertzinger 2004-10-06 16:55:12 UTC
Yes, all drives are correctly found and identified as what they are.
Kernel is 2.6.8-1.590

Comment 34 Harald Hoyer 2004-10-06 16:57:27 UTC
so, I think, I can make this bug a DUPLICATE of bug 134822 ??

Comment 35 Ralf Ertzinger 2004-10-06 17:00:30 UTC

*** This bug has been marked as a duplicate of 134822 ***

Comment 36 Red Hat Bugzilla 2006-02-21 19:05:05 UTC
Changed to 'CLOSED' state since 'RESOLVED' has been deprecated.