LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
  Search this Thread
Old 08-22-2007, 04:31 AM   #1
jb2009
LQ Newbie
 
Registered: Aug 2007
Posts: 17

Rep: Reputation: 0
usb stick not detected if present at boot time


Hi !
My linux Red Hat 7.1 with 2.4.30 kernel does not detect my usb stick if it is present in the connector when I boot the computer. On the other hand, If I plug it when the Linux is running, it is correctly detected as /dev/sda.
All the SCSI and USB drivers are directly compiled in the kernel.
Is there someone who knows how to force USB detection at boot time please ?
See also
http://groups.google.fr/group/comp.o...fa3b2a2fc9cd7c
and
http://lea-linux.org/pho/read/1/327553#debut
for more details.
Best Regards.
JY
 
Old 08-23-2007, 01:47 AM   #2
virens
LQ Newbie
 
Registered: Aug 2007
Distribution: Debian GNU/Linux
Posts: 11

Rep: Reputation: 0
Quote:
Originally Posted by jb2009 View Post
Hi !
My linux Red Hat 7.1 with 2.4.30 kernel does not detect my usb stick if it is present in the connector when I boot the computer. On the other hand, If I plug it when the Linux is running, it is correctly detected as /dev/sda.
I think that this happens because of devfs, which is used in 2.4.x Some time is required (from logs):
Code:
usb-storage: device found at 3
usb-storage: waiting for device to settle before scanning
And when you coldpluggin you flash, there is no time to settle, and so it`s not mounted.

Is upgrade to 2.6.x. too painful for you?
 
Old 08-23-2007, 02:58 AM   #3
jb2009
LQ Newbie
 
Registered: Aug 2007
Posts: 17

Original Poster
Rep: Reputation: 0
Hi Virens !
First of all, I want to thank you for your reply.
Then, I can't upgrade to kernel 2.6 because our customer requires 2.4.30 one.
I've found someone who seems to have the same problem : http://groups.google.fr/group/comp.o...b&rnum=1&hl=fr

What do you mean by "there is no time to settle". I'm french and I don't really understand the sentence.
Thanks for your help again,
Best regards
JY
 
Old 08-23-2007, 03:40 AM   #4
Pearlseattle
Member
 
Registered: Aug 2007
Location: Zurich, Switzerland
Distribution: Gentoo
Posts: 999

Rep: Reputation: 142Reputation: 142
I think once I saw somewhere a parameter that could be used in the boot parms to slow down the boot, so that the usb stick/drive is recognized. Perhaps it was something linked to "booting from a usb stick"?
 
Old 08-23-2007, 04:01 AM   #5
jb2009
LQ Newbie
 
Registered: Aug 2007
Posts: 17

Original Poster
Rep: Reputation: 0
Hi Pearlseattle !
In fact, we have already tried to patch the kernel with the usbboot patch (http://www.xenotime.net/linux/usb/usbboot-2422.patch).
That's this way I deduced that my problem comes from usb detection/enumeration (driver issue ?).
Indeed, with this patch, if we boot from usb key*, the system boots (kernel decompression...) and then fails in a loop printing on the screen the patch message :
"VFS: Cannot open root device \"%s\" or %s\n", "VFS: Cannot open root device \"%s\" or %s, retrying in 1 second.\n".
When these messages are displayed, we unplugged the usb stick and repluged it. It was then detected by usbstorage and recognized as /dev/sda. The root file system is then correctly mounted on /dev/sda6 and the rest of the boot comes to an end without other errors.


*:the system booted from usb is exactly the same, we've just changed the root=/dev/hda6 line in the lilo.conf file by root=/dev/sda6.

Best regards.
JY
 
Old 08-23-2007, 05:03 AM   #6
Pearlseattle
Member
 
Registered: Aug 2007
Location: Zurich, Switzerland
Distribution: Gentoo
Posts: 999

Rep: Reputation: 142Reputation: 142
Hi jb2009
I found this article on IBM's page:

Quote:
This almost works, except for two problems:

1- Because of the fact that SBP support uses SCSI emulation, the emulated SCSI bus need to be "rescanned" in order to detect the disk and allow /dev/sda1 to be mounted. This scanning is performed with a couple of simple commands. Unfortunately, however, using a one-phase boot, we cannot run any commands until the kernel has finished booting, and the kernel cannot finish booting until the root file system is mounted -- a classic Catch-22 situation. Thankfully, there is a patch available for 2.4 kernels that causes the SCSI bus to be scanned on startup (see Resources for more details). By applying this patch, I was able to have the external drive automatically detected by the kernel during bootup with no rescanning commands required. This leads us to the next problem.

2-There is a timing window within the kernel, which means that often, the kernel will proceed to try to mount the root device before it has had a chance to be properly detected or initialized. Again, there is a patch available for this (please see Resources for a link) that simply makes the kernel wait for a short period of time on startup, and retry if it fails to mount the root filesystem (to give the external drive time to be recognized).
So, it looks like the patch you applied covers the second part, which retries the mount of the root partition. You're still missing a patch which triggers a rescan of the USB bus, which is what happens when you unplug & replug your USB stick. Any luck finding the patch for kernel 2.4?
 
Old 08-23-2007, 05:34 AM   #7
Pearlseattle
Member
 
Registered: Aug 2007
Location: Zurich, Switzerland
Distribution: Gentoo
Posts: 999

Rep: Reputation: 142Reputation: 142
Found here this statement:
Quote:
Note also in the ibm article they further discuss the timing issues and the need to rescan the scsi bus. That dealt with 2.4 kernels using devfs. It's not applicable to 2.6 kernels using udev, but there may be similar issues or not. You would have to rebuild your initrd and see if it worked to find out for sure.
 
Old 08-23-2007, 05:39 AM   #8
jb2009
LQ Newbie
 
Registered: Aug 2007
Posts: 17

Original Poster
Rep: Reputation: 0
Thanks a lot !
I will search and I'll give you a feedback !
 
Old 08-23-2007, 07:25 AM   #9
jb2009
LQ Newbie
 
Registered: Aug 2007
Posts: 17

Original Poster
Rep: Reputation: 0
T'm not a good google user :
"Thankfully, there is a patch available for 2.4 kernels that causes the SCSI bus to be scanned on startup" => I can't find this @§%ù! patch !
Did you find it ?
 
Old 08-23-2007, 03:46 PM   #10
Pearlseattle
Member
 
Registered: Aug 2007
Location: Zurich, Switzerland
Distribution: Gentoo
Posts: 999

Rep: Reputation: 142Reputation: 142
- no clue where it is...
 
Old 08-24-2007, 01:22 AM   #11
jb2009
LQ Newbie
 
Registered: Aug 2007
Posts: 17

Original Poster
Rep: Reputation: 0
I've written an e-mail to the author of the article you pointed out to me.
I'm waiting a reply...
I hope he could send this patch to me.
I write back to you here if yes.
Bye.
JY
 
Old 08-24-2007, 04:36 AM   #12
Pearlseattle
Member
 
Registered: Aug 2007
Location: Zurich, Switzerland
Distribution: Gentoo
Posts: 999

Rep: Reputation: 142Reputation: 142
Well, I tried to search a with a million different terms, but by making it simple, I looked again at IBM's homepage, copied the string "sbp2 hotplug patch" and inserted it into Google, I get back this link. I can download from there the "sbp2 hotplug patch", but I am not sure if the patch concerns what you already applied or the rescan. But I am quite optimistic and think it might be the one you're searching for
 
Old 08-24-2007, 07:04 AM   #13
jb2009
LQ Newbie
 
Registered: Aug 2007
Posts: 17

Original Poster
Rep: Reputation: 0
Again, thank you four your help.
It seems you're a better "googler" than me.
I will try this patch and I'll post a feedback here as soon as I've tried it.
best regards.
JY
 
Old 08-27-2007, 01:35 AM   #14
jb2009
LQ Newbie
 
Registered: Aug 2007
Posts: 17

Original Poster
Rep: Reputation: 0
Unfortunately, I've tried the patch, but my usb detection problem is still there.
Moreover, the ibm article's author hasn't answered to me yet.
I will try these patches :
http://www.suse.de/~garloff/linux/sc...nning-old.html
Any other idea/link ?
bye.
JY
 
Old 08-27-2007, 01:39 AM   #15
jb2009
LQ Newbie
 
Registered: Aug 2007
Posts: 17

Original Poster
Rep: Reputation: 0
I've also found those patches : http://www.suse.de/~garloff/linux/scsi-many/
I will also try them.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Boot from USB stick if no booting USB in Bios 1kyle SUSE / openSUSE 1 03-26-2007 12:24 AM
Usb stick not detected in suse10 but fine in windows Morph69 Linux - Hardware 1 07-20-2006 09:41 AM
USB Thumb Drive Will Not Mount Unless Present During Boot. IamI Slackware 21 02-21-2006 02:40 PM
usb-stick not detected after update from 9.1 to 9.2 Marix SUSE / openSUSE 6 01-16-2005 02:31 AM
USB Stick boot KrYpToN Linux - Hardware 5 10-08-2003 08:32 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 10:24 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration