public inbox for gentoo-user@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-user] Root device as UUID not properly detected
@ 2015-10-06 15:59 João Miguel
  2015-10-06 16:17 ` Philip Webb
  0 siblings, 1 reply; 10+ messages in thread
From: João Miguel @ 2015-10-06 15:59 UTC (permalink / raw
  To: gentoo-user

Hello all,

I have decided to make a pen drive with Gentoo Linux installed, to have
a permanent pocket installation I can use in any computer as if it were
my own. The Gentoo Wiki guided me very well through it.

The problem I'm having only appears when I try to boot the pen drive
physically. That is, if I use a VM as such:

$ qemu-system-i386 -hda /dev/sdb -enable-kvm -m 2G

I have no error messages displayed. However, if I try to boot it from a
real PC, I get an error message alike "Could not find the root block
device in UUID=...". Now what is weird is this: in some PCs, if I click
Enter to try and use the same device, the system boots normally, or if I
drop to the shell, I can do blkid and see the root partition (usually
sdb4 or sdc4). But in at least one PC, the root device is not detected.
The same message appears even if I try for minutes. If I manually enter
the UUID or partition, it doesn't work either. It shows "Could not find
the root block device in ." (like in this question
https://forums.gentoo.org/viewtopic-t-971416.html)

The command I used to make the kernel and initram was
# genkernel --install --disklabel all
as I need basic support for any hardware.

I also found https://forums.gentoo.org/viewtopic-t-701116-start-0.html,
I expect the --disklabel option to help but the results are the same.

I use both UUIDs in /etc/fstab and /boot/syslinux/syslinux.cfg (tried
setting real_root and rootfstype besides root, no difference).

What sense does this problem make?! The BIOS sees the pen, syslinux
boots it using the UUID, why does the system suddenly forget where the
pen is?  Why does it have different behaviours in different computers,
and no problem as a VM? Is this a problem with the initrd, or with mdev?
I had a pen like this with Arch Linux and it ran just fine, maybe it was
because it used udev instead?

I hope you can help me, it's the 1st time I try Gentoo and it was going
so well! Thank you in advance,

João Miguel


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

* Re: [gentoo-user] Root device as UUID not properly detected
  2015-10-06 15:59 [gentoo-user] Root device as UUID not properly detected João Miguel
@ 2015-10-06 16:17 ` Philip Webb
  2015-10-06 16:55   ` João Miguel
  0 siblings, 1 reply; 10+ messages in thread
From: Philip Webb @ 2015-10-06 16:17 UTC (permalink / raw
  To: gentoo-user

151006 João Miguel wrote:
> I have decided to make a pen drive with Gentoo Linux installed,
> to have a permanent pocket installation I can use in any computer
> as if it were my own. The Gentoo Wiki guided me very well through it.
> 
> The problem I'm having only appears when I try to boot the pen drive
> physically. That is, if I use a VM as such:
> 
> $ qemu-system-i386 -hda /dev/sdb -enable-kvm -m 2G
> 
> I have no error messages displayed. However, if I try to boot it from a
> real PC, I get an error message alike "Could not find the root block
> device in UUID=...". Now what is weird is this: in some PCs, if I click
> Enter to try and use the same device, the system boots normally, or if I
> drop to the shell, I can do blkid and see the root partition (usually
> sdb4 or sdc4). But in at least one PC, the root device is not detected.

Did you try other USB sticks, which you know work in other machines,
in that one machine ?  Otherwise, it mb something awry in that machine.

-- 
========================,,============================================
SUPPORT     ___________//___,   Philip Webb
ELECTRIC   /] [] [] [] [] []|   Cities Centre, University of Toronto
TRANSIT    `-O----------O---'   purslowatchassdotutorontodotca



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

* Re: [gentoo-user] Root device as UUID not properly detected
  2015-10-06 16:17 ` Philip Webb
@ 2015-10-06 16:55   ` João Miguel
  2015-10-06 17:06     ` J. Roeleveld
  0 siblings, 1 reply; 10+ messages in thread
From: João Miguel @ 2015-10-06 16:55 UTC (permalink / raw
  To: gentoo-user

> Did you try other USB sticks, which you know work in other machines,
> in that one machine ?  Otherwise, it mb something awry in that machine.
Yes I did. As I said, I had such a USB stick with Arch Linux installed,
and it worked there just fine. In fact, I tried just now (to make sure,
though with a recovery drive, uses isolinux), and it's ok. Note there
are really 3 levels of "working":

1 - works flawlessly - only VM for this pen
2 - initrd doesn't recognize the disk on the 1st attempt to mount root,
works after waiting a few seconds and trying again (not waiting enough
gives an error again)
3 - initrd doesn't recognize the disk ever (I went up to 5 mins, sounds
more than enough)

That PC is in 3. But any other disk I tried so far works. And I never
had this error before, with any sort of pen, including the Gentoo
recovery/install pen which supposedly uses genkernel as I do here, but
somehow initrd always works with it (case 1).

The fact that 2 does happen for every other PC says there is actually
something awry, but I think it's with the initrd.

The thing is that BIOS knows the pen is there, syslinux also detects it
right away and knows where the root partition is with UUID, and still
the initrd can't figure it out right away?

Best regards,
João Miguel


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

* Re: [gentoo-user] Root device as UUID not properly detected
  2015-10-06 16:55   ` João Miguel
@ 2015-10-06 17:06     ` J. Roeleveld
  2015-10-06 18:19       ` João Miguel
  0 siblings, 1 reply; 10+ messages in thread
From: J. Roeleveld @ 2015-10-06 17:06 UTC (permalink / raw
  To: gentoo-user

On 6 October 2015 18:55:25 CEST, "João Miguel" <jmcf125@openmailbox.org> wrote:
>> Did you try other USB sticks, which you know work in other machines,
>> in that one machine ?  Otherwise, it mb something awry in that
>machine.
>Yes I did. As I said, I had such a USB stick with Arch Linux installed,
>and it worked there just fine. In fact, I tried just now (to make sure,
>though with a recovery drive, uses isolinux), and it's ok. Note there
>are really 3 levels of "working":
>
>1 - works flawlessly - only VM for this pen
>2 - initrd doesn't recognize the disk on the 1st attempt to mount root,
>works after waiting a few seconds and trying again (not waiting enough
>gives an error again)
>3 - initrd doesn't recognize the disk ever (I went up to 5 mins, sounds
>more than enough)
>
>That PC is in 3. But any other disk I tried so far works. And I never
>had this error before, with any sort of pen, including the Gentoo
>recovery/install pen which supposedly uses genkernel as I do here, but
>somehow initrd always works with it (case 1).
>
>The fact that 2 does happen for every other PC says there is actually
>something awry, but I think it's with the initrd.
>
>The thing is that BIOS knows the pen is there, syslinux also detects it
>right away and knows where the root partition is with UUID, and still
>the initrd can't figure it out right away?
>
>Best regards,
>João Miguel

Possible causes:
1. USB stick doesn't work as boot device

2. USB port is not supported by kernel

3. You don't use root_delay as boot option
-- 
Sent from my Android device with K-9 Mail. Please excuse my brevity.


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

* Re: [gentoo-user] Root device as UUID not properly detected
  2015-10-06 17:06     ` J. Roeleveld
@ 2015-10-06 18:19       ` João Miguel
  2015-10-06 21:15         ` J. Roeleveld
  0 siblings, 1 reply; 10+ messages in thread
From: João Miguel @ 2015-10-06 18:19 UTC (permalink / raw
  To: gentoo-user

How do I know if any of these happen?
> Possible causes:
> 1. USB stick doesn't work as boot device
Well, it did with Arch, the boot partition has the boot, legacy_boot and
esp flags. Plus if anything was to be problematic, I'd assume it would
be BIOS or syslinux detection of the drive bootable device, not mounting.
> 
> 2. USB port is not supported by kernel
I'm not sure what you mean. Is there any option I should enable for
genkernel? I read on the Wiki page that 
> 
> 3. You don't use root_delay as boot option
If that's what I think it is, I tell syslinux to wait 5 seconds. It does
work. In every computer. It's when it starts loading modules and all,
reaching the point where initrd needs to mount the root device that it
gives an error. I don't know how to tell it to wait there though. And as
I said, even if I did, it wouldn't work on all computers, on some initrd
cant figure it out at all.
> -- 

> Sent from my Android device with K-9 Mail. Please excuse my brevity.
No problem, thanks for the response. I'm just baffled with this error.
João Miguel


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

* Re: [gentoo-user] Root device as UUID not properly detected
  2015-10-06 18:19       ` João Miguel
@ 2015-10-06 21:15         ` J. Roeleveld
  2015-10-06 22:03           ` João Miguel
  0 siblings, 1 reply; 10+ messages in thread
From: J. Roeleveld @ 2015-10-06 21:15 UTC (permalink / raw
  To: gentoo-user

On Tuesday, October 06, 2015 07:19:59 PM João Miguel wrote:
> How do I know if any of these happen?
> 
> > Possible causes:
> > 1. USB stick doesn't work as boot device
> 
> Well, it did with Arch, the boot partition has the boot, legacy_boot and
> esp flags. Plus if anything was to be problematic, I'd assume it would
> be BIOS or syslinux detection of the drive bootable device, not mounting.

Ok, so scratch that one.

> > 2. USB port is not supported by kernel
> 
> I'm not sure what you mean. Is there any option I should enable for
> genkernel? I read on the Wiki page that

It works with Arch, are you using the same kernel options now with Gentoo?

> > 3. You don't use root_delay as boot option
> 
> If that's what I think it is, I tell syslinux to wait 5 seconds.

How do you tell it that?

> It does
> work. In every computer. It's when it starts loading modules and all,
> reaching the point where initrd needs to mount the root device that it
> gives an error. I don't know how to tell it to wait there though. And as
> I said, even if I did, it wouldn't work on all computers, on some initrd
> cant figure it out at all.

I never used an initrd when building my own USB sticks.
I was talking about:
        rootdelay=      [KNL] Delay (in seconds) to pause before attempting to
                        mount the root filesystem

(See the file "kernel-parameters.txt" in the kernel Documentation)

> > Sent from my Android device with K-9 Mail. Please excuse my brevity.
> 
> No problem, thanks for the response. I'm just baffled with this error.
> João Miguel

That's a default signature... :)




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

* Re: [gentoo-user] Root device as UUID not properly detected
  2015-10-06 21:15         ` J. Roeleveld
@ 2015-10-06 22:03           ` João Miguel
  2015-10-07 10:17             ` J. Roeleveld
  0 siblings, 1 reply; 10+ messages in thread
From: João Miguel @ 2015-10-06 22:03 UTC (permalink / raw
  To: gentoo-user

> > > Possible causes:
> > > 1. USB stick doesn't work as boot device
> Ok, so scratch that one.
Okay, done.

> > > 2. USB port is not supported by kernel
> > 
> > I'm not sure what you mean. Is there any option I should enable for
> > genkernel? I read on the Wiki page that
> 
> It works with Arch, are you using the same kernel options now with Gentoo?
Yeah, I tried many more here actually, with Arch I only need APPEND root=...
(no rootfstype, ro, rw, rootdelay, etc.).

> > > 3. You don't use root_delay as boot option
> > If that's what I think it is, I tell syslinux to wait 5 seconds.
(turns out it's not what I thought it was, though I did try root_delay, it is
actually rootdelay...)
> How do you tell it that?
Here's my syslinux.cfg with more comments:
PROMPT 1
TIMEOUT 50	# <-- here
DEFAULT gentoo

LABEL gentoo
        LINUX ../kernel-genkernel-x86-4.0.5-gentoo
        INITRD ../initramfs-genkernel-x86-4.0.5-gentoo
        APPEND rootdelay=5 root=UUID="6fc386ff-8342-42a2-be02-51a6eccf8430" rootfstype=ext4
	#       ^^--- I added this just now because you said so, though in the last message I had root_delay
	# Neither of those has any effect (conditions 2 and 3 I told you about remain as they were)
	# (as I thought this has nthing to do with the bootloader)
# pen (normalmente /dev/sdb4): UUID="6fc386ff-8342-42a2-be02-51a6eccf8430" TYPE="ext4" PARTLABEL="Root Gentoo GNU/Linux" PARTUUID="9c4f6479-9dd7-4a8f-86f2-f1320cc15aa5"

> I never used an initrd when building my own USB sticks.
I don't know, I always used an initrd. Though I must say, that is the
phase of starting the PC I understand the worst.
> I was talking about:
>         rootdelay=      [KNL] Delay (in seconds) to pause before attempting to
>                         mount the root filesystem
> 
> (See the file "kernel-parameters.txt" in the kernel Documentation)
(I'm guessing I'm not supposed to include this in the boot loader config...)

> That's a default signature... :)
Ah, so that's why it showed with a couple of dashes above it :)

All the best,
João Miguel


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

* Re: [gentoo-user] Root device as UUID not properly detected
  2015-10-06 22:03           ` João Miguel
@ 2015-10-07 10:17             ` J. Roeleveld
  2015-10-07 21:00               ` João Miguel
  2015-10-08 21:23               ` João Miguel
  0 siblings, 2 replies; 10+ messages in thread
From: J. Roeleveld @ 2015-10-07 10:17 UTC (permalink / raw
  To: gentoo-user

On Tuesday, October 06, 2015 11:03:04 PM João Miguel wrote:
> > > > Possible causes:
> > > > 1. USB stick doesn't work as boot device
> > 
> > Ok, so scratch that one.
> 
> Okay, done.
> 
> > > > 2. USB port is not supported by kernel
> > > 
> > > I'm not sure what you mean. Is there any option I should enable for
> > > genkernel? I read on the Wiki page that
> > 
> > It works with Arch, are you using the same kernel options now with Gentoo?
> 
> Yeah, I tried many more here actually, with Arch I only need APPEND root=...
> (no rootfstype, ro, rw, rootdelay, etc.).

What about kernel config?

> > > > 3. You don't use root_delay as boot option
> > > 
> > > If that's what I think it is, I tell syslinux to wait 5 seconds.
> 
> (turns out it's not what I thought it was, though I did try root_delay, it
> is actually rootdelay...)
> 
> > How do you tell it that?
> 
> Here's my syslinux.cfg with more comments:
> PROMPT 1
> TIMEOUT 50	# <-- here

That timeout is for the prompt, eg. how long the bootloader waits.
It will not have any effect for the drivers in the kernel to finish detecting 
the USB devices.

> DEFAULT gentoo
> 
> LABEL gentoo
>         LINUX ../kernel-genkernel-x86-4.0.5-gentoo
>         INITRD ../initramfs-genkernel-x86-4.0.5-gentoo
>         APPEND rootdelay=5 root=UUID="6fc386ff-8342-42a2-be02-51a6eccf8430"
> rootfstype=ext4 #       ^^--- I added this just now because you said so,
> though in the last message I had root_delay # Neither of those has any
> effect (conditions 2 and 3 I told you about remain as they were) # (as I
> thought this has nthing to do with the bootloader)
> # pen (normalmente /dev/sdb4): UUID="6fc386ff-8342-42a2-be02-51a6eccf8430"
> TYPE="ext4" PARTLABEL="Root Gentoo GNU/Linux"
> PARTUUID="9c4f6479-9dd7-4a8f-86f2-f1320cc15aa5"

Hmm...
I see 2 different UUIDs in your comments.
Did you test with the PARTUUID value ("9c...") instead of the other one?

Also, I always ended up setting the rootdelay to 10 or higher. (It's in 
seconds, not minutes)

> > I never used an initrd when building my own USB sticks.
> 
> I don't know, I always used an initrd. Though I must say, that is the
> phase of starting the PC I understand the worst.

On the machines where I use an initrd, I write my own scripts as I find the 
creators (genkernel, dracut) to not be intelligent enough.

> > I was talking about:
> >         rootdelay=      [KNL] Delay (in seconds) to pause before
> >         attempting to
> >         
> >                         mount the root filesystem
> > 
> > (See the file "kernel-parameters.txt" in the kernel Documentation)
> 
> (I'm guessing I'm not supposed to include this in the boot loader config...)

The "rootdelay=..."  part needs to be added to the boot loader config.

--
Joost


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

* Re: [gentoo-user] Root device as UUID not properly detected
  2015-10-07 10:17             ` J. Roeleveld
@ 2015-10-07 21:00               ` João Miguel
  2015-10-08 21:23               ` João Miguel
  1 sibling, 0 replies; 10+ messages in thread
From: João Miguel @ 2015-10-07 21:00 UTC (permalink / raw
  To: gentoo-user

On Wed, Oct 07, 2015 at 12:17:51PM +0200, J. Roeleveld wrote:
> > > > > 2. USB port is not supported by kernel
> > > > I'm not sure what you mean. Is there any option I should enable for
> > > > genkernel? I read on the Wiki page that
> > > It works with Arch, are you using the same kernel options now with Gentoo?
> > Yeah, I tried many more here actually, with Arch I only need APPEND root=...
> > (no rootfstype, ro, rw, rootdelay, etc.).
> What about kernel config?
I was not sure about this, but
https://wiki.archlinux.org/index.php/Kernel_parameters says:

   There are three ways to pass options to the kernel and thus control its
behaviour:
   1. When building the kernel. See Kernel Compilation for details.
   2. When starting the kernel (usually, when invoked from a boot loader).
   3. At runtime (through the files in /proc and /sys). See sysctl for details.

So I'm using 2.

> > > > > 3. You don't use root_delay as boot option
> > > > If that's what I think it is, I tell syslinux to wait 5 seconds.
> > (turns out it's not what I thought it was, though I did try root_delay, it
> > is actually rootdelay...)
> > > How do you tell it that?
> > Here's my syslinux.cfg with more comments:
> > PROMPT 1
> > TIMEOUT 50	# <-- here
> That timeout is for the prompt, eg. how long the bootloader waits.
Yes, but I do tell it to wait (and as I said, I didn't know what rootdelay
was).
> It will not have any effect for the drivers in the kernel to finish detecting 
> the USB devices.
> >         APPEND rootdelay=5 root=UUID="6fc386ff-8342-42a2-be02-51a6eccf8430" rootfstype=ext4
No, but this ------^^^^^^^^^^^-- should.

> Did you test with the PARTUUID value ("9c...") instead of the other one?
> 
> Also, I always ended up setting the rootdelay to 10 or higher. (It's in 
> seconds, not minutes)
New append line:
APPEND rootdelay=15 root=PARTUUID="9c4f6479-9dd7-4a8f-86f2-f1320cc15aa5" rootfstype=ext4

Again, I see no difference using rootdelay. With PARTUUID though, I get "Could
not find the root device in ." right away, rather than "Could not find the root
device in UUID=...". With PARTUUID, I can't boot it anywhere without manually
writing the UUID (not PARTUUID) or device file. Though on my system, the
following works:

 # mount PARTUUID="9c4f6479-9dd7-4a8f-86f2-f1320cc15aa5" /mnt/pen

So now I'm even more confused. Everything about this pen works, as does
everything in the PCs I tried. Syslinux also works. It's somewhere after
loading the modules, in the initrd.

Thinking of it now, I remember the PC that never finds the root device
requires intel microcode early, which is loaded along with the initrd.

Because of this problem I need to turn many PCs on and off a few times
in a row, and I noticed that the pendrive blinks at least on BIOS, when
syslinux is finding initrd and the kernel, and when the machine finds
the root device. Now, what I noticed is that in the VM, it blinks right
away (as it finds root right away); in many PCs it takes a while to
blink, only blinking after the 1st attempt on mounting to newroot has
been done; and in some others it never blinks.

> > > I never used an initrd when building my own USB sticks.
> > I don't know, I always used an initrd. Though I must say, that is the
> > phase of starting the PC I understand the worst.
> On the machines where I use an initrd, I write my own scripts as I find the 
> creators (genkernel, dracut) to not be intelligent enough.
The thing is, I'm less intelligent than those creators. I'm not very
familiar with the way that early boot phase works, much less with
writing scripts to make it work.  Unless you have an idea of how I can
use the scripts to solve this problem. In Arch I use mkinitcpio. I'm
aware it is available for Gentoo as well, nonetheless using genkernel is
killing two birds with one stone, it should be a simpler solution, so
I'd like to go with that one. If it works for a Gentoo recovery drive,
why shouldn't it work for this one?

> > > I was talking about:
> > >         rootdelay=      [KNL] Delay (in seconds) to pause before
> > >         attempting to
> > >                         mount the root filesystem
> > > (See the file "kernel-parameters.txt" in the kernel Documentation)
> > (I'm guessing I'm not supposed to include this in the boot loader config...)
> The "rootdelay=..."  part needs to be added to the boot loader config.
Ah, then I'm glad I did. Although it seems to do nothing really...

Sorry for the large response. I probably forgot something, took a while
amidst writing and testing.
João Miguel


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

* Re: [gentoo-user] Root device as UUID not properly detected
  2015-10-07 10:17             ` J. Roeleveld
  2015-10-07 21:00               ` João Miguel
@ 2015-10-08 21:23               ` João Miguel
  1 sibling, 0 replies; 10+ messages in thread
From: João Miguel @ 2015-10-08 21:23 UTC (permalink / raw
  To: gentoo-user

Nevermind the last message. I'll put this problem aside until I find the
time to solve it on my own.

> > > I never used an initrd when building my own USB sticks.
> > I don't know, I always used an initrd. Though I must say, that is the
> > phase of starting the PC I understand the worst.
> On the machines where I use an initrd, I write my own scripts as I find the 
> creators (genkernel, dracut) to not be intelligent enough.
It doesn't sound as hard as I thought. I'm tired of fighting genkernel.
I know the problem is initrd, it's where it fails.  Since there is no
mkinitcpio package, I'll try those scripts. I will follow
https://wiki.gentoo.org/wiki/Early_Userspace_Mounting. If something goes
wrong (when I actually try), I'll make a new thread. Or maybe I will
just try and copy the initrd and kernel image from the Gentoo recovery
pen...

Anyway, I'll post here when I figure it out.
João Miguel


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

end of thread, other threads:[~2015-10-08 21:23 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-10-06 15:59 [gentoo-user] Root device as UUID not properly detected João Miguel
2015-10-06 16:17 ` Philip Webb
2015-10-06 16:55   ` João Miguel
2015-10-06 17:06     ` J. Roeleveld
2015-10-06 18:19       ` João Miguel
2015-10-06 21:15         ` J. Roeleveld
2015-10-06 22:03           ` João Miguel
2015-10-07 10:17             ` J. Roeleveld
2015-10-07 21:00               ` João Miguel
2015-10-08 21:23               ` João Miguel

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