linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Can't mount USB partition as root
@ 2003-12-29 16:38 Karel Kulhavý
  2003-12-29 16:45 ` Tomas Szepe
  2003-12-29 16:47 ` Jeff Chua
  0 siblings, 2 replies; 12+ messages in thread
From: Karel Kulhavý @ 2003-12-29 16:38 UTC (permalink / raw)
  To: linux-kernel

Hello

I tried to boot Linux 2.6.0 kernel with option root=/dev/sda1 using Grub.
The kernel otherwise works, mounts the sda1 partition (XFS) OK.
When I boot the kernel with root=/dev/sda1 instead of root=/dev/hda4,
I get "can't mount root VFS, kernel panic" or something like that.

Is it possible to boot kernel with root from /dev/sda1 (USB)?
partition table: whole /dev/sda is one partition (sda1), type 83 (Linux).
Tried also switching on and off hotplugging in kernel and it didn't help.

Cl<

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

* Re: Can't mount USB partition as root
  2003-12-29 16:38 Can't mount USB partition as root Karel Kulhavý
@ 2003-12-29 16:45 ` Tomas Szepe
  2003-12-29 17:31   ` Karel Kulhavý
  2003-12-29 18:38   ` Wakko Warner
  2003-12-29 16:47 ` Jeff Chua
  1 sibling, 2 replies; 12+ messages in thread
From: Tomas Szepe @ 2003-12-29 16:45 UTC (permalink / raw)
  To: Karel Kulhavý; +Cc: linux-kernel

On Dec-29 2003, Mon, 17:38 +0100
Karel Kulhavý <clock@twibright.com> wrote:

> Is it possible to boot kernel with root from /dev/sda1 (USB)?
> partition table: whole /dev/sda is one partition (sda1), type 83 (Linux).
> Tried also switching on and off hotplugging in kernel and it didn't help.

Well, is the device detected and the partition table scanned before the
root mount is attempted?

I believe this should work given you've compiled in all the necessary
code.  Please capture the dmesg using serial console/netconsole/whatever
and post it along with your .config.

-- 
Tomas Szepe <szepe@pinerecords.com>

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

* Re: Can't mount USB partition as root
  2003-12-29 16:38 Can't mount USB partition as root Karel Kulhavý
  2003-12-29 16:45 ` Tomas Szepe
@ 2003-12-29 16:47 ` Jeff Chua
  2003-12-29 17:33   ` Karel Kulhavý
  1 sibling, 1 reply; 12+ messages in thread
From: Jeff Chua @ 2003-12-29 16:47 UTC (permalink / raw)
  To: Karel Kulhavý; +Cc: Linux Kernel

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: TEXT/PLAIN; charset=X-UNKNOWN, Size: 993 bytes --]


You'll need to load the usb modules using initrd ramdisk, then switch root
to the usb device to continue booting the system.


Thanks,
Jeff
[ jchua@fedex.com ]

On Mon, 29 Dec 2003, [iso-8859-2] Karel Kulhavý wrote:

> Hello
>
> I tried to boot Linux 2.6.0 kernel with option root=/dev/sda1 using Grub.
> The kernel otherwise works, mounts the sda1 partition (XFS) OK.
> When I boot the kernel with root=/dev/sda1 instead of root=/dev/hda4,
> I get "can't mount root VFS, kernel panic" or something like that.
>
> Is it possible to boot kernel with root from /dev/sda1 (USB)?
> partition table: whole /dev/sda is one partition (sda1), type 83 (Linux).
> Tried also switching on and off hotplugging in kernel and it didn't help.
>
> Cl<
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/
>

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

* Re: Can't mount USB partition as root
  2003-12-29 16:45 ` Tomas Szepe
@ 2003-12-29 17:31   ` Karel Kulhavý
  2003-12-29 17:34     ` Tomas Szepe
  2003-12-29 18:38   ` Wakko Warner
  1 sibling, 1 reply; 12+ messages in thread
From: Karel Kulhavý @ 2003-12-29 17:31 UTC (permalink / raw)
  To: Tomas Szepe; +Cc: linux-kernel

On Mon, Dec 29, 2003 at 05:45:39PM +0100, Tomas Szepe wrote:
> On Dec-29 2003, Mon, 17:38 +0100
> Karel Kulhavý <clock@twibright.com> wrote:
> 
> > Is it possible to boot kernel with root from /dev/sda1 (USB)?
> > partition table: whole /dev/sda is one partition (sda1), type 83 (Linux).
> > Tried also switching on and off hotplugging in kernel and it didn't help.
> 
> Well, is the device detected and the partition table scanned before the
> root mount is attempted?

The messages jump around fast and there is no possibility to scroll
back once the kernel stops, but I am convinced that nothing is said about
detecting the device.

However, if booting the kernel "normally", the device gets detected (later).

How do I use the console? Is it something like nullmodem cable console in
Windows NT?  I have given away my nullmodem cable to a friend for purpose of
debugging NT kernel so what possibilities remain?

Cl<

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

* Re: Can't mount USB partition as root
  2003-12-29 16:47 ` Jeff Chua
@ 2003-12-29 17:33   ` Karel Kulhavý
  2003-12-29 17:49     ` Tomas Szepe
  0 siblings, 1 reply; 12+ messages in thread
From: Karel Kulhavý @ 2003-12-29 17:33 UTC (permalink / raw)
  To: Jeff Chua; +Cc: linux-kernel

On Tue, Dec 30, 2003 at 12:47:06AM +0800, Jeff Chua wrote:
> 
> You'll need to load the usb modules using initrd ramdisk, then switch root
> to the usb device to continue booting the system.

This is the problem #2. I am not able to remount /. "device or resource busy".
How do I remount the "/"?

Cl<

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

* Re: Can't mount USB partition as root
  2003-12-29 17:31   ` Karel Kulhavý
@ 2003-12-29 17:34     ` Tomas Szepe
  0 siblings, 0 replies; 12+ messages in thread
From: Tomas Szepe @ 2003-12-29 17:34 UTC (permalink / raw)
  To: Karel Kulhavý; +Cc: linux-kernel

On Dec-29 2003, Mon, 18:31 +0100
Karel Kulhavý <clock@twibright.com> wrote:

> > > Is it possible to boot kernel with root from /dev/sda1 (USB)?
> > > partition table: whole /dev/sda is one partition (sda1), type 83 (Linux).
> > > Tried also switching on and off hotplugging in kernel and it didn't help.
> > 
> > Well, is the device detected and the partition table scanned before the
> > root mount is attempted?
> 
> The messages jump around fast and there is no possibility to scroll
> back once the kernel stops, but I am convinced that nothing is said about
> detecting the device.
> 
> However, if booting the kernel "normally", the device gets detected (later).

Sounds like an initrd to me.  Are you using one?

> How do I use the console? Is it something like nullmodem cable console in
> Windows NT?  I have given away my nullmodem cable to a friend for purpose of
> debugging NT kernel so what possibilities remain?

Google around for "netconsole" or use 2.6.0-mm2, which has it included.

-- 
Tomas Szepe <szepe@pinerecords.com>

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

* Re: Can't mount USB partition as root
  2003-12-29 17:33   ` Karel Kulhavý
@ 2003-12-29 17:49     ` Tomas Szepe
  2003-12-30  2:16       ` Michael Heyse
  2003-12-30  9:10       ` Karel Kulhavý
  0 siblings, 2 replies; 12+ messages in thread
From: Tomas Szepe @ 2003-12-29 17:49 UTC (permalink / raw)
  To: Karel Kulhavý; +Cc: Jeff Chua, linux-kernel

On Dec-29 2003, Mon, 18:33 +0100
Karel Kulhavý <clock@twibright.com> wrote:

> > You'll need to load the usb modules using initrd ramdisk, then switch root
> > to the usb device to continue booting the system.
> 
> This is the problem #2. I am not able to remount /. "device or resource busy".
> How do I remount the "/"?

/sbin/mount -o remount,rw /

-- 
Tomas Szepe <szepe@pinerecords.com>

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

* Re: Can't mount USB partition as root
  2003-12-29 16:45 ` Tomas Szepe
  2003-12-29 17:31   ` Karel Kulhavý
@ 2003-12-29 18:38   ` Wakko Warner
  2003-12-29 21:14     ` Randy.Dunlap
  1 sibling, 1 reply; 12+ messages in thread
From: Wakko Warner @ 2003-12-29 18:38 UTC (permalink / raw)
  To: Tomas Szepe; +Cc: Karel Kulhavý, linux-kernel

> > Is it possible to boot kernel with root from /dev/sda1 (USB)?
> > partition table: whole /dev/sda is one partition (sda1), type 83 (Linux).
> > Tried also switching on and off hotplugging in kernel and it didn't help.
> 
> Well, is the device detected and the partition table scanned before the
> root mount is attempted?
> 
> I believe this should work given you've compiled in all the necessary
> code.  Please capture the dmesg using serial console/netconsole/whatever
> and post it along with your .config.

I did this with 2.4 a few months back.  Basically all I did was add the same
delay before mounting root as the kernel does with mounting a root floppy. 
Problem is the kernel is too fast for the usb code to find the disk.

I'v been wanting to ask this question.  How can I make the kernel "sleep"
for say 5 seconds (or pause or something, whatever is required to delay
execution) to wait for the device to become available.  I tried the same
thing doing nfsroot with a cardbus nic which fails because the kernel
doesn't see the card until after it attempted to mount /

-- 
 Lab tests show that use of micro$oft causes cancer in lab animals

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

* Re: Can't mount USB partition as root
  2003-12-29 18:38   ` Wakko Warner
@ 2003-12-29 21:14     ` Randy.Dunlap
  0 siblings, 0 replies; 12+ messages in thread
From: Randy.Dunlap @ 2003-12-29 21:14 UTC (permalink / raw)
  To: Wakko Warner; +Cc: szepe, clock, linux-kernel

On Mon, 29 Dec 2003 13:38:12 -0500 Wakko Warner <wakko@animx.eu.org> wrote:

| > > Is it possible to boot kernel with root from /dev/sda1 (USB)?
| > > partition table: whole /dev/sda is one partition (sda1), type 83 (Linux).
| > > Tried also switching on and off hotplugging in kernel and it didn't help.
| > 
| > Well, is the device detected and the partition table scanned before the
| > root mount is attempted?
| > 
| > I believe this should work given you've compiled in all the necessary
| > code.  Please capture the dmesg using serial console/netconsole/whatever
| > and post it along with your .config.
| 
| I did this with 2.4 a few months back.  Basically all I did was add the same
| delay before mounting root as the kernel does with mounting a root floppy. 
| Problem is the kernel is too fast for the usb code to find the disk.
| 
| I'v been wanting to ask this question.  How can I make the kernel "sleep"
| for say 5 seconds (or pause or something, whatever is required to delay
| execution) to wait for the device to become available.  I tried the same
| thing doing nfsroot with a cardbus nic which fails because the kernel
| doesn't see the card until after it attempted to mount /

I posted a patch for 2.4.22 which someone tested and reported as working.
The patch is here:
  http://www.xenotime.net/linux/usb/usbboot-2422.patch

--
~Randy

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

* Re: Can't mount USB partition as root
  2003-12-29 17:49     ` Tomas Szepe
@ 2003-12-30  2:16       ` Michael Heyse
  2003-12-30  9:10       ` Karel Kulhavý
  1 sibling, 0 replies; 12+ messages in thread
From: Michael Heyse @ 2003-12-30  2:16 UTC (permalink / raw)
  To: Karel Kulhavý; +Cc: linux-kernel

>>This is the problem #2. I am not able to remount /. "device or resource busy".
>>How do I remount the "/"?

I think you're looking for
     chroot NEWROOT [COMMAND...]
or
     pivot_root new_root put_old
here...

Greetings,

Michael

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

* Re: Can't mount USB partition as root
  2003-12-29 17:49     ` Tomas Szepe
  2003-12-30  2:16       ` Michael Heyse
@ 2003-12-30  9:10       ` Karel Kulhavý
  2003-12-30 20:25         ` Tomas Szepe
  1 sibling, 1 reply; 12+ messages in thread
From: Karel Kulhavý @ 2003-12-30  9:10 UTC (permalink / raw)
  To: Tomas Szepe; +Cc: linux-kernel

On Mon, Dec 29, 2003 at 06:49:51PM +0100, Tomas Szepe wrote:
> On Dec-29 2003, Mon, 18:33 +0100
> Karel Kulhavý <clock@twibright.com> wrote:
> 
> > > You'll need to load the usb modules using initrd ramdisk, then switch root
> > > to the usb device to continue booting the system.
> > 
> > This is the problem #2. I am not able to remount /. "device or resource busy".
> > How do I remount the "/"?
> 
> /sbin/mount -o remount,rw /

bash-2.05b# mount
/dev/hda4 on / type xfs (rw)
none on /dev type devfs (rw)
none on /proc type proc (rw)
none on /dev/pts type devpts (rw)
/dev/hda1 on /boot type ext2 (rw,noatime)
none on /dev/shm type tmpfs (rw)
bash-2.05b# mount -o remount,rw /dev/sda1 /
bash-2.05b# mount
/dev/hda4 on / type xfs (rw)
^^^^^^^^^
none on /dev type devfs (rw)
none on /proc type proc (rw)
none on /dev/pts type devpts (rw)
/dev/hda1 on /boot type ext2 (rw,noatime)
none on /dev/shm type tmpfs (rw)

bash-2.05b# mount --version
mount: mount-2.12
bash-2.05b# cat /proc/version
Linux version 2.6.0 (root@oberon) (gcc version 3.3.2 20031022 (Gentoo Linux
3.3.2-r3, propolice)) #4 Mon Dec 29 12:20:39 MET 2003

When doing find / after that, the IDE disk goes crazy, not the USB one.
So that mount doesn't lie and nothing is really remounted (and no
error message issued). Is this how things are supposed to work?

Cl<

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

* Re: Can't mount USB partition as root
  2003-12-30  9:10       ` Karel Kulhavý
@ 2003-12-30 20:25         ` Tomas Szepe
  0 siblings, 0 replies; 12+ messages in thread
From: Tomas Szepe @ 2003-12-30 20:25 UTC (permalink / raw)
  To: Karel Kulhavý; +Cc: linux-kernel

On Dec-30 2003, Tue, 10:10 +0100
Karel Kulhavý <clock@twibright.com> wrote:

> On Mon, Dec 29, 2003 at 06:49:51PM +0100, Tomas Szepe wrote:
> > On Dec-29 2003, Mon, 18:33 +0100
> > Karel Kulhavý <clock@twibright.com> wrote:
> > 
> > > > You'll need to load the usb modules using initrd ramdisk, then switch root
> > > > to the usb device to continue booting the system.
> > > 
> > > This is the problem #2. I am not able to remount /. "device or resource busy".
> > > How do I remount the "/"?
> > 
> > /sbin/mount -o remount,rw /
> 
> bash-2.05b# mount
> /dev/hda4 on / type xfs (rw)
> none on /dev type devfs (rw)
> none on /proc type proc (rw)
> none on /dev/pts type devpts (rw)
> /dev/hda1 on /boot type ext2 (rw,noatime)
> none on /dev/shm type tmpfs (rw)
> bash-2.05b# mount -o remount,rw /dev/sda1 /
> bash-2.05b# mount
> /dev/hda4 on / type xfs (rw)
> ^^^^^^^^^
> none on /dev type devfs (rw)
> none on /proc type proc (rw)
> none on /dev/pts type devpts (rw)
> /dev/hda1 on /boot type ext2 (rw,noatime)
> none on /dev/shm type tmpfs (rw)
> 
> bash-2.05b# mount --version
> mount: mount-2.12
> bash-2.05b# cat /proc/version
> Linux version 2.6.0 (root@oberon) (gcc version 3.3.2 20031022 (Gentoo Linux
> 3.3.2-r3, propolice)) #4 Mon Dec 29 12:20:39 MET 2003
> 
> When doing find / after that, the IDE disk goes crazy, not the USB one.
> So that mount doesn't lie and nothing is really remounted (and no
> error message issued). Is this how things are supposed to work?

As others have said, you need to either

a) patch your kernel to wait for the usb disk to be detected.
	(Your only choice w/o an initrd.)

b) modify your initrd to mount the usb disk and pivot_root(2).

-- 
Tomas Szepe <szepe@pinerecords.com>

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

end of thread, other threads:[~2003-12-30 20:26 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-12-29 16:38 Can't mount USB partition as root Karel Kulhavý
2003-12-29 16:45 ` Tomas Szepe
2003-12-29 17:31   ` Karel Kulhavý
2003-12-29 17:34     ` Tomas Szepe
2003-12-29 18:38   ` Wakko Warner
2003-12-29 21:14     ` Randy.Dunlap
2003-12-29 16:47 ` Jeff Chua
2003-12-29 17:33   ` Karel Kulhavý
2003-12-29 17:49     ` Tomas Szepe
2003-12-30  2:16       ` Michael Heyse
2003-12-30  9:10       ` Karel Kulhavý
2003-12-30 20:25         ` Tomas Szepe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).