mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* USB stick as root device does not work
@ 2011-05-22 14:13 Micha Nelissen
  2011-05-23 17:14 ` Randy Dunlap
  0 siblings, 1 reply; 4+ messages in thread
From: Micha Nelissen @ 2011-05-22 14:13 UTC (permalink / raw)
  To: linux-kernel

Hi,

Using USB stick as root device does not work for me. I specify
'root=/dev/sdb1 rootwait' on the kernel commandline, but the kernel does
not wait for the USB stick to be scanned and its partitions found. I
have a harddisk which is /dev/sda, and this USB stick would be /dev/sdb.

I think blk_lookup_devt returns the block device number even if it does
not exist yet, and init/do_mounts.c:473 therefore skips waiting:

        if ((ROOT_DEV == 0) && root_wait) {

due to ROOT_DEV having become non-zero already.

If I use the commandline: 'root=/dev/sdb1 rootdelay=5' then it does
mount and boot properly. However, using rootwait seems safer and faster
to me, that it's meant for this use case.

Thanks for any pointers,

Micha

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: USB stick as root device does not work
  2011-05-22 14:13 USB stick as root device does not work Micha Nelissen
@ 2011-05-23 17:14 ` Randy Dunlap
  2011-05-23 17:33   ` Alan Stern
  0 siblings, 1 reply; 4+ messages in thread
From: Randy Dunlap @ 2011-05-23 17:14 UTC (permalink / raw)
  To: Micha Nelissen, lud; +Cc: linux-kernel

[adding cc: of linux-usb mailing list]

On Sun, 22 May 2011 16:13:17 +0200 Micha Nelissen wrote:

> Hi,
> 
> Using USB stick as root device does not work for me. I specify
> 'root=/dev/sdb1 rootwait' on the kernel commandline, but the kernel does
> not wait for the USB stick to be scanned and its partitions found. I
> have a harddisk which is /dev/sda, and this USB stick would be /dev/sdb.
> 
> I think blk_lookup_devt returns the block device number even if it does
> not exist yet, and init/do_mounts.c:473 therefore skips waiting:
> 
>         if ((ROOT_DEV == 0) && root_wait) {
> 
> due to ROOT_DEV having become non-zero already.
> 
> If I use the commandline: 'root=/dev/sdb1 rootdelay=5' then it does
> mount and boot properly. However, using rootwait seems safer and faster
> to me, that it's meant for this use case.
> 
> Thanks for any pointers,
> 
> Micha
> --

---
~Randy
*** Remember to use Documentation/SubmitChecklist when testing your code ***

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: USB stick as root device does not work
  2011-05-23 17:14 ` Randy Dunlap
@ 2011-05-23 17:33   ` Alan Stern
  2011-05-23 18:06     ` Micha Nelissen
  0 siblings, 1 reply; 4+ messages in thread
From: Alan Stern @ 2011-05-23 17:33 UTC (permalink / raw)
  To: Randy Dunlap
  Cc: Jens Axboe, TejunHeo, Micha Nelissen, lud, Kernel development list

On Mon, 23 May 2011, Randy Dunlap wrote:

> [adding cc: of linux-usb mailing list]

Better to ask people familiar with the block layer (CC'ed).

Alan Stern

> On Sun, 22 May 2011 16:13:17 +0200 Micha Nelissen wrote:
> 
> > Hi,
> > 
> > Using USB stick as root device does not work for me. I specify
> > 'root=/dev/sdb1 rootwait' on the kernel commandline, but the kernel does
> > not wait for the USB stick to be scanned and its partitions found. I
> > have a harddisk which is /dev/sda, and this USB stick would be /dev/sdb.
> > 
> > I think blk_lookup_devt returns the block device number even if it does
> > not exist yet, and init/do_mounts.c:473 therefore skips waiting:
> > 
> >         if ((ROOT_DEV == 0) && root_wait) {
> > 
> > due to ROOT_DEV having become non-zero already.
> > 
> > If I use the commandline: 'root=/dev/sdb1 rootdelay=5' then it does
> > mount and boot properly. However, using rootwait seems safer and faster
> > to me, that it's meant for this use case.
> > 
> > Thanks for any pointers,
> > 
> > Micha
> > --
> 
> ---
> ~Randy
> *** Remember to use Documentation/SubmitChecklist when testing your code ***


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: USB stick as root device does not work
  2011-05-23 17:33   ` Alan Stern
@ 2011-05-23 18:06     ` Micha Nelissen
  0 siblings, 0 replies; 4+ messages in thread
From: Micha Nelissen @ 2011-05-23 18:06 UTC (permalink / raw)
  To: Alan Stern
  Cc: Randy Dunlap, Jens Axboe, TejunHeo, lud, Kernel development list

Hi all,

Alan Stern wrote:
> On Mon, 23 May 2011, Randy Dunlap wrote:
> Better to ask people familiar with the block layer (CC'ed).

I found out what happened: I use LILO, and lilo was not passing
root=/dev/sdb1 on the commandline, but root=811. However, I didn't see
that since on i386 that part had already scrolled off-screen. I found
out by accident, due to a user space program trying to parse that,
expecting a string, getting a number :-).

Using the following in my lilo.conf:

	append="root=/dev/sdb1 rootwait"
instead of
	root=/dev/sdb1

works perfectly. Maybe this information is useful for somebody else; I
did not find it using a quick google.

Thanks for your attention.

Micha


>> On Sun, 22 May 2011 16:13:17 +0200 Micha Nelissen wrote:
>>
>>> Hi,
>>>
>>> Using USB stick as root device does not work for me. I specify
>>> 'root=/dev/sdb1 rootwait' on the kernel commandline, but the kernel does
>>> not wait for the USB stick to be scanned and its partitions found. I
>>> have a harddisk which is /dev/sda, and this USB stick would be /dev/sdb.
>>>
>>> I think blk_lookup_devt returns the block device number even if it does
>>> not exist yet, and init/do_mounts.c:473 therefore skips waiting:
>>>
>>>         if ((ROOT_DEV == 0) && root_wait) {
>>>
>>> due to ROOT_DEV having become non-zero already.
>>>
>>> If I use the commandline: 'root=/dev/sdb1 rootdelay=5' then it does
>>> mount and boot properly. However, using rootwait seems safer and faster
>>> to me, that it's meant for this use case.
>>>
>>> Thanks for any pointers,
>>>
>>> Micha
>>> --
>> ---
>> ~Randy
>> *** Remember to use Documentation/SubmitChecklist when testing your code ***
> 
> 

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-05-23 18:06 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-05-22 14:13 USB stick as root device does not work Micha Nelissen
2011-05-23 17:14 ` Randy Dunlap
2011-05-23 17:33   ` Alan Stern
2011-05-23 18:06     ` Micha Nelissen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®