Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Booting off USB with out initrd? Is it possible?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
DingbatCA
Guru
Guru


Joined: 07 Jul 2004
Posts: 384
Location: Portland Or

PostPosted: Mon Nov 10, 2008 9:58 pm    Post subject: Booting off USB with out initrd? Is it possible? Reply with quote

Booting off USB with out initrd? Is it possible? I am stuck on this on. I have only tried recompiling the kernel 20+ times...
Code:

Device Drivers --->
  USB support --->
    <*> Support for Host-side USB
    <*>   OHCI HCD support
    <*>   USB Mass Storage support

I have support for the hardware and the XFS file system, all built in, NOT modules. I can see USB load and usb-storage load. I have scsi-disk built in to. But I always get a kernel panic. What am I missing? Using a 2.6.27-r2 gentoo kernel.

Parts of my .config
Code:

CONFIG_XFS_FS=y
CONFIG_USB_EHCI_HCD=y
CONFIG_USB_EHCI_ROOT_HUB_TT=y
CONFIG_USB_EHCI_TT_NEWSCHED=y
CONFIG_USB_ISP116X_HCD=y
CONFIG_USB_ISP1760_HCD=y
CONFIG_USB_OHCI_HCD=y
CONFIG_USB_OHCI_LITTLE_ENDIAN=y
CONFIG_USB_UHCI_HCD=y
CONFIG_USB_SL811_HCD=y
CONFIG_USB_R8A66597_HCD=y

CONFIG_USB_STORAGE=y

CONFIG_SCSI=y
CONFIG_SCSI_DMA=y

CONFIG_BLK_DEV_SD=y
CONFIG_CHR_DEV_SG=y
Back to top
View user's profile Send private message
fuzzykiller
n00b
n00b


Joined: 09 Nov 2008
Posts: 44
Location: Karlsruhe, Germany

PostPosted: Mon Nov 10, 2008 10:56 pm    Post subject: Reply with quote

Did you enable SCSI disk support?
Back to top
View user's profile Send private message
DingbatCA
Guru
Guru


Joined: 07 Jul 2004
Posts: 384
Location: Portland Or

PostPosted: Mon Nov 10, 2008 11:10 pm    Post subject: Reply with quote

yes
Code:

CONFIG_SCSI=y
CONFIG_SCSI_DMA=y

CONFIG_BLK_DEV_SD=y
CONFIG_CHR_DEV_SG=y
Back to top
View user's profile Send private message
fuzzykiller
n00b
n00b


Joined: 09 Nov 2008
Posts: 44
Location: Karlsruhe, Germany

PostPosted: Mon Nov 10, 2008 11:13 pm    Post subject: Reply with quote

What exactly is the cause of the kernel panic? No root device? Have you tried using UUID instead of /dev syntax?

And, of course, can you see the detected USB disk scroll by as the kernel is booting?
Back to top
View user's profile Send private message
DingbatCA
Guru
Guru


Joined: 07 Jul 2004
Posts: 384
Location: Portland Or

PostPosted: Mon Nov 10, 2008 11:24 pm    Post subject: Reply with quote

I can see usb-storage go by, I see the detection process. Never see the pen drive come up as sdX. I am currently using root=/dev/sda2. Never heard of the UUID. Not sure if the kernel is even seeing the pen drive. Do you have a working .config? I can go from there, and back out where the problem is.
Back to top
View user's profile Send private message
fuzzykiller
n00b
n00b


Joined: 09 Nov 2008
Posts: 44
Location: Karlsruhe, Germany

PostPosted: Mon Nov 10, 2008 11:40 pm    Post subject: Reply with quote

No, I just have the x86 and amd64 minimal LiveCD on an USB disk drive. And SLAX. I can't tell you much about it, as the usb-storage drivers spam the syslog excessively. Even dmesg doesn't work. They all use initrds.

UUID is the unique identifier of a partition (and other things, but that's not important here). You have to consider that the USB disk may not always be sda.
Use the blkid command to get the UUID from any partition. For example:
# blkid /dev/sda1
This will print something like:
/dev/sda1: UUID="4a6aed11-42dd-4c82-81ce-8f469e93f210" TYPE="reiserfs"
As these numbers are fairly complex, you might consider redirecting output to a file and inserting it at the appropriate location in your GRUB/whatever configuration.
Syntax in the kernel command line is as follows:
root=UUID=4a6aed11-42dd-4c82-81ce-8f469e93f210

/edit:
And, of course, you need to use a similar syntax in your fstab file!
UUID=e0164f78-9821-4eaf-bda7-1fd9b43a6f06 / ext3 defaults,errors=remount-ro 0 1
UUID=4a6aed11-42dd-4c82-81ce-8f469e93f210 /home ext3 defaults 0 0
Back to top
View user's profile Send private message
DingbatCA
Guru
Guru


Joined: 07 Jul 2004
Posts: 384
Location: Portland Or

PostPosted: Mon Nov 10, 2008 11:51 pm    Post subject: Reply with quote

I know I can get this running with an initrd, but was trying to skip that step. I know that the Gentoo LiveCD's depend on initrd to take care of this. I am rather sure that the drive never gets loaded, not that the root= path is wrong. Any other ideas?
Back to top
View user's profile Send private message
fuzzykiller
n00b
n00b


Joined: 09 Nov 2008
Posts: 44
Location: Karlsruhe, Germany

PostPosted: Tue Nov 11, 2008 12:12 pm    Post subject: Reply with quote

Well, I made a mistake - the UUID syntax can only be used in conjunction with an initrd. I was however successful in booting a basic Debian system from my usb pen drive. Please specify the exact error message you receive when using classic /dev syntax.
Back to top
View user's profile Send private message
DirtyHairy
l33t
l33t


Joined: 03 Jul 2006
Posts: 608
Location: Würzburg, Deutschland

PostPosted: Tue Nov 11, 2008 12:35 pm    Post subject: Reply with quote

I'm not sure if this applies, but doesn't it usally take some time (~seconds) after usb-storage has claimed a device until it gets accessible? Therefore, the kernel might try to access the boot device before usb-storage has initialized.
Back to top
View user's profile Send private message
richard.scott
Veteran
Veteran


Joined: 19 May 2003
Posts: 1497
Location: Oxfordshire, UK

PostPosted: Tue Nov 11, 2008 12:43 pm    Post subject: Re: Booting off USB with out initrd? Is it possible? Reply with quote

DingbatCA wrote:
Booting off USB with out initrd?


It may be possible if your only using a modern motherboard and USB 2.x devices. In my experience when booting from USB the kernel won't detect all USB devices unless the drivers are loaded as modules.

For example, my new HP 6720s Laptop works fine with HCD compiled in as it has USB 2 ports and my USB stick was also USB2 compatible. However, since moving to a USB 1.x stick (to test) I can't boot it anymore as its not detected with the modules included in the kernel :-(

I compile my kernel using Genkernel (so also use initrd) and read somewhere that USB works best if these HCD drivers (i.e. EHCI/OHCI/UHCI HCD support) are included as modules. This has worked for me.

I'd guess for full hardware support initrd is required!

Why do you want to skip using initrd??.... I can't see any real advantage to that one other than increasing the size of your kernel :-(

Rich
Back to top
View user's profile Send private message
fuzzykiller
n00b
n00b


Joined: 09 Nov 2008
Posts: 44
Location: Karlsruhe, Germany

PostPosted: Tue Nov 11, 2008 2:00 pm    Post subject: Reply with quote

The size of the kernel doesn't really matter, now does it? ;) After all, we're not using embedded systems here, I guess.
The only reason why I load the USB drivers as modules is a faster boot process.

And, just for the record, I have libusual active in the kernel.

I will test my pen drive setup later, I just made it this morning at the university. :D
However I assume there won't be any hardware problems.
Back to top
View user's profile Send private message
DingbatCA
Guru
Guru


Joined: 07 Jul 2004
Posts: 384
Location: Portland Or

PostPosted: Tue Nov 11, 2008 4:28 pm    Post subject: Reply with quote

DirtyHairy is right. It is taking the usb-storage about 2 seconds to find the drive, the panic happens within 1 second. I could care less about kernel size, It was more me being lazy and not building an initrd. As a module, or as built in, I need to wait a bit longer. Time to build an initrd. Thank you for the help.
Back to top
View user's profile Send private message
hpeters
n00b
n00b


Joined: 26 Sep 2003
Posts: 68

PostPosted: Tue Nov 11, 2008 4:34 pm    Post subject: Reply with quote

DingbatCA wrote:
DirtyHairy is right. It is taking the usb-storage about 2 seconds to find the drive, the panic happens within 1 second. I could care less about kernel size, It was more me being lazy and not building an initrd. As a module, or as built in, I need to wait a bit longer. Time to build an initrd. Thank you for the help.


Have you tried the rootdelay=(time in seconds) kernel command line parameter ?
A setting of 5 seconds are higher always worked for me.

Harley
Back to top
View user's profile Send private message
DingbatCA
Guru
Guru


Joined: 07 Jul 2004
Posts: 384
Location: Portland Or

PostPosted: Tue Nov 11, 2008 4:39 pm    Post subject: Reply with quote

OOOOOOO, now that has possibility! I will try it when I get home tonight.
Back to top
View user's profile Send private message
DingbatCA
Guru
Guru


Joined: 07 Jul 2004
Posts: 384
Location: Portland Or

PostPosted: Wed Nov 12, 2008 6:36 am    Post subject: Reply with quote

It lives!!!
hpeters wins! rootdelay=10 is what I needed.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum