Bug 218783 - USB floppy drive seen as HD class device during OS install.
USB floppy drive seen as HD class device during OS install.
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: anaconda (Show other bugs)
4.4
x86_64 Linux
high Severity high
: ---
: ---
Assigned To: Peter Jones
: OtherQA, Regression, Reopened
Depends On: 202267
Blocks: 246028
  Show dependency treegraph
 
Reported: 2006-12-07 10:13 EST by Jose De la Rosa
Modified: 2010-10-22 03:19 EDT (History)
4 users (show)

See Also:
Fixed In Version: RHBA-2007-0552
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2007-11-15 10:56:20 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
proposed patch to workaround this issue. (1.47 KB, patch)
2007-01-05 06:48 EST, Sandeep K. Shandilya
no flags Details | Diff
patch to fix usb floppy being detected as hard disk (1.50 KB, patch)
2007-04-25 10:25 EDT, Sandeep K. Shandilya
no flags Details | Diff
patch to fix usb floppy being detected as hard disk (1.29 KB, patch)
2007-04-25 16:44 EDT, Sandeep K. Shandilya
no flags Details | Diff
patch for this issue (1.21 KB, patch)
2007-06-13 17:25 EDT, Bill Nottingham
no flags Details | Diff

  None (edit)
Description Jose De la Rosa 2006-12-07 10:13:09 EST
Description of problem:

USB floppy drive seen as HD class device during OS install.

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

RHEL 4.4, Kernel 2.6.9-42

How reproducible:

Always

Steps to Reproduce:

1. Attach a USB floppy drive (with or without diskette) to server.
2. Attach a Qlogic 2460 HBA to server. This HBA should be the only storage 
controller on the server (the problem with this Qlogic HBA has been 
documented, where the correct driver is not loaded automatically and must be 
loaded manually - see bug 204627)
3. Start RHEL 4.4 installation.
4. Anaconda runs. Select language and keyboard.
5. During disk partitioning setup, select auto-partitioning.
6. System errors out with "no valid device found".
  
Actual results:

Anaconda thinks there is a valid storage device to lay down the OS (the floppy 
drive). When it tries to partition it, it errors out with:

"An error has ocurred - no valid devices
 were found on which to create new file
 systems. Please check your hardware for
 the cause of this problem."

At this point, all I can do is reboot the system. The Qlogic HBA is not 
detected because of the issue described above (bug 204627) and so I can't 
proceed.

Expected results:

In step 4 above, anaconda should not detect any storage devices and display 
the following message:

       --- Warning ---

No hard drives have been found.
You probably need to manually
choose device drivers for the
installation to succeed. Would
you like to select drivers now?

    -- yes --    -- no --

Here, the right driver for the Qlogic 2460 HBA can be loaded manually from the 
install CD and thus access the SAN.

Additional info:

Looks like anaconda in RHEL 4.4 is treating the USB floppy as a class_HD 
device. In this case, it seems to assign it as device /dev/sda, the installer 
then assumes it has a valid storage device and continues the installation.

You could say that booting with "linux dd" is a workaround to manually load 
the correct HBA driver, but the issue still remains with the USB floppy seen 
as HD class. I also know that bug 204627 is fixed in RHEL 4.5, but not sure 
the floppy issue is addressed, which could still cause problems.
Comment 1 Jeremy Katz 2006-12-07 20:55:31 EST

*** This bug has been marked as a duplicate of 217399 ***
Comment 2 Sandeep K. Shandilya 2006-12-15 07:22:23 EST
you could check to see if each of the harddisk devices could be accessed
Comment 3 Sandeep K. Shandilya 2006-12-15 07:23:26 EST
I will be attaching patches to this defect.
Comment 4 Sandeep K. Shandilya 2007-01-05 06:48:50 EST
Created attachment 144900 [details]
proposed patch to workaround this issue.

I have proposed a patch to workaround this issue, please review.
Comment 5 Samuel Benjamin 2007-01-08 12:56:17 EST
RH engineering, please assign this case and review the patch provided by Dell to
address this issue. Thanks.
Comment 7 Fabio Olive Leite 2007-02-07 08:06:14 EST
Have you checked that the patch does not affect installing to USB harddisks? It
looks like it does.

Please try booting with nousbstorage and see if the dialog box prompting for
driver installation will appear.
Comment 8 Sandeep K. Shandilya 2007-02-14 05:04:47 EST
(In reply to comment #7)
> Have you checked that the patch does not affect installing to USB harddisks? It
> looks like it does.
Yes you are right, This patch just makes sure that the user is warned that valid
hard disks were not found to install. It does not do anything with respect to
the install itself. The user could continue the install by ignoring the message.
One more to thing to note in the anaconda code is that it will not install to
usb-storage or firewire drives any way.

The code in isys.py, function driveIsRemovable

def driveIsRemovable(device):
    # assume ide if starts with 'hd', and we don't have to create
    # device beforehand since it just reads /proc/ide
    if device[:2] == "hd":
        rc = (_isys.isIdeRemovable("/dev/"+device) == 1)
    else:
        makeDevInode(device, "/tmp/disk")
        rc = (_isys.isScsiRemovable("/tmp/disk") == 1)

        # need to test if its USB or IEEE1394 even if it doesnt look removable
        if not rc:
            if os.access("/tmp/scsidisks", os.R_OK):
                sdlist=open("/tmp/scsidisks", "r")
                sdlines = sdlist.readlines()
                sdlist.close()
                for l in sdlines:
                    try:
                        # each line has format of:  <device>  <module>
                        (sddev, sdmod) = string.split(l)

                        if sddev == device:
                            if sdmod in ['sbp2', 'usb-storage']:
                                rc = 1
                            else:

and being used in partedUtils.py DiskSet.openDevices() to filter removable devices.

          if isys.driveIsRemovable(drive) and not flags.expert:
              DiskSet.skippedDisks.append(drive)
              continue

> 
> Please try booting with nousbstorage and see if the dialog box prompting for
> driver installation will appear.
I have verified this will usbflash drives, usb hard drives, and usb floppy
drives. The message will only appear if you have no fixed disks(usb hard drives
are considered removable) on the system.
Comment 9 Samuel Benjamin 2007-02-14 18:15:51 EST
Dell is requesting this for 4.5, setting 4.5 and ACK flags to ?.
Comment 13 Larry Troan 2007-02-26 15:02:08 EST
This bug was opened 12/07/2007 as a regression in RHEL4.4. It pre-req's bug
202267 "pcitable regression in RHEL4U4 GA" which was fixed in an errata.
Comment 17 Samuel Benjamin 2007-03-07 13:48:39 EST
Need dev ACK to get this into 4.5. Patch available, Dell will help to test.
Comment 18 Peter Jones 2007-03-07 14:48:26 EST
> The message will only appear if you have no fixed disks(usb hard 
> drives are considered removable) on the system.

This isn't actually the case -- usb hard disks are valid install targets in RHEL
4.5, and they should not be setting the 'removable' flag.  USB keys and floppy
devices *should* be setting it.  I have off-the-shelf consumer devices, both
keys and hard disks (I have no usb floppy devices), that get this right.

In addition, the code quoted in comment #7 is not the same in RHEL 4.5, which
has installation to usb hard drives as a feature.

Because of this, the patch in comment #4 isn't a viable solution to this problem
- it discards devices which are valid installation targets.

So there are two questions here: 1) why is the device not detected as
'removable', and 2) why is kudzu seeing it as CLASS_HD instead of CLASS_FLOPPY?
Comment 19 Sandeep K. Shandilya 2007-03-08 10:06:54 EST
(In reply to comment #18)
> > The message will only appear if you have no fixed disks(usb hard 
> > drives are considered removable) on the system.
> 
> This isn't actually the case -- usb hard disks are valid install targets in RHEL
> 4.5, and they should not be setting the 'removable' flag.  USB keys and floppy
> devices *should* be setting it.  I have off-the-shelf consumer devices, both
> keys and hard disks (I have no usb floppy devices), that get this right.
> 
> In addition, the code quoted in comment #7 is not the same in RHEL 4.5, which
> has installation to usb hard drives as a feature.
> 
> Because of this, the patch in comment #4 isn't a viable solution to this problem
> - it discards devices which are valid installation targets.
> 
> So there are two questions here: 1) why is the device not detected as
> 'removable', and 2) why is kudzu seeing it as CLASS_HD instead of CLASS_FLOPPY?

If you only have a USB floppy drive connected to the system then,
this device is detected as removable but in the loader anaconda is
ignoring this.
The python code is failing with a message, "there are no disks to install.....".
This patch will cleary state that there are no valid disks to install in the
loader stage, and the user could still continue to the install on to a USB
stick/floppy drive if he wishes too. The floppy drive/USB pen drive will appear
on the partitioning screen he could choose it and the install will continue and
will fail.
It's kudzu that is the real culprit here that it is reporting a USB floppy drive
as a CLASS_HD. The kudzu code is looking in /proc/scsi/usb-storage-*/*
i = 0;
while (1) {
	snprintf(path,63, "/proc/scsi/usb-storage-%d", i);
	if (stat(path, &sb)) break;
	snprintf(path,63, "/proc/scsi/usb-storage-%d/%d", i, newdev->host);
	i++;
	fd = open(path, O_RDONLY);
	if (fd < 0) continue;
	memset(buf, '\0', sizeof(buf));
	rc = read(fd, buf, 16384);
	if (rc <= 0) continue;
	buf[rc-1] = '\0';
	close(fd);
	if (strstr(buf, "Protocol: Uniform Floppy Interface (UFI)")) {
	  newdev->type = CLASS_FLOPPY;
	}
This piece of code in kudzu assumes that the files in /proc/scsi/usb-storage-*/*
start from 0. but at any point on a system that assumption is not valid. So this
code is broken. This could be fixed using glob() on /proc/scsi/usb-storage/*
On my system when a usb floppy drive is plugged in 

#ls /proc/scsi/usb-storage/
6
#
returns 6.
The Fix seems to be in kudzu. I checked this on kudzu version 1.1.95.21 and 
anaconda version 10.1.1.62.
In the meantime the patch provided could suffice This patch will not be needed
if the problem is fixed in kudzu.
I checked this using NEC USBF000x USB floppy drive on USB 1.1 and USB 2.0 ports.
Comment 24 John Feeney 2007-03-30 17:04:32 EDT
So it looks like Bill has confirmed that there is something to be done in 
kudzu so if you all don't mind, I will re-assign this bug to him. (Just tryin'
to move things along.)
Comment 26 Sandeep K. Shandilya 2007-04-25 10:25:18 EDT
Created attachment 153421 [details]
patch to fix usb floppy being detected as hard disk

This patch fixes a bug where the probe of usb storage devices was incorrect.
The /proc directory format for usb storage devices changed causing this bug.
Comment 27 Sandeep K. Shandilya 2007-04-25 16:44:04 EDT
Created attachment 153454 [details]
patch to fix usb floppy being detected as hard disk

I had un-necessary declerations that produced warnings in the previous patch.
Comment 28 Sandeep K. Shandilya 2007-05-25 04:58:09 EDT
Please review this patch (Attachment #3 [details] posted on 2007-04-25 16:44 EST)
Comment 29 Bill Nottingham 2007-06-13 17:25:29 EDT
Created attachment 156922 [details]
patch for this issue

Here's what's going to be in 1.1.95.23-1. It's a slight rework of what you
posted.
Comment 31 John Poelstra 2007-08-29 12:10:19 EDT
A fix for this issue should have been included in the packages contained in the
RHEL4.6 Beta released on RHN (also available at partners.redhat.com).  

Requested action: Please verify that your issue is fixed to ensure that it is
included in this update release.

After you (Red Hat Partner) have verified that this issue has been addressed,
please perform the following:
1) Change the *status* of this bug to VERIFIED.
2) Add *keyword* of PartnerVerified (leaving the existing keywords unmodified)

If this issue is not fixed, please add a comment describing the most recent
symptoms of the problem you are having and change the status of the bug to FAILS_QA.

If you cannot access bugzilla, please reply with a message to Issue Tracker and
I will change the status for you.  If you need assistance accessing
ftp://partners.redhat.com, please contact your Partner Manager.
Comment 32 Sandeep K. Shandilya 2007-09-05 02:41:43 EDT
Issue not fixed.
I see that the patch is applied to kudzu but the issue is still being reproduced
on anaconda.
Comment 33 Sandeep K. Shandilya 2007-09-10 06:27:50 EDT
contiuing from comment #32, looks like anaconda (loader) is still being linked
to the older version of kudzu.
Comment 35 Peter Jones 2007-09-11 13:05:45 EDT
Hopefully fixed in anaconda-10.1.1.71-2 .
Comment 36 John Feeney 2007-09-11 13:32:38 EDT
I will get a copy of this rpm to Dell for testing. Thanks to all.
Comment 37 Sandeep K. Shandilya 2007-09-13 03:45:41 EDT
In reply to comment #36, the fix is that the loader needs to be linked to the
version of kudzu(1.1.95.23-1) that has the fix. The anaconda rpm does not have
the loader in it.
Comment 38 David Cantrell 2007-10-02 10:01:01 EDT
We needed to rebuild anaconda against the kudzu that fixed this issue.  We did
that in anaconda-10.1.1.71-2 and the fix should make it to the next snapshot at
this point.
Comment 39 Sandeep K. Shandilya 2007-10-09 01:48:19 EDT
Checked on 4.6 snapshot 5 anaconda version (10.1.1.73-1), it passed.
Comment 41 errata-xmlrpc 2007-11-15 10:56:20 EST
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on the solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2007-0552.html

Note You need to log in before you can comment on or make changes to this bug.