Linux Archive

Linux Archive (http://www.linux-archive.org/)
-   Gentoo User (http://www.linux-archive.org/gentoo-user/)
-   -   Changing boot device with 2.6.36 (http://www.linux-archive.org/gentoo-user/471825-changing-boot-device-2-6-36-a.html)

Nikos Chantziaras 01-03-2011 05:17 PM

Changing boot device with 2.6.36
 
On 01/03/2011 07:43 PM, Jörg Schaible wrote:

Hi,

starting with the 2.6.36-r5 kernel of the Gentoo sources my boot device
changes. With 2.6.35 and below it is alway /dev/sda3, with the new kernel it
seems that anything that is internally connected with USB is assigned a
device first. Since my computer has an internal media bay (and my monitor
has such a thing also) the first HD moves - it I take care it is now
/dev/sde3. However, if I forget to switch on the monitor and do this later
or if an USB stick is already plugged in at boot time, the HD gets a
different device number again.

Can somebody else confirm such a behaviour with the 2.6.36 kernel and how
can this brought back to normal operation?


This has been solved long ago: Label your filesystems and mount them by
label. For example, don't put "/dev/sda3" in your fstab, but label that
filesystem with a name like "root_fs" and use
"/dev/disk/by-label/root_fs" in fstab.


Ext2/3/4 filesystem can be labeled with the "e2label" tool. For example:

e2label /dev/sda3 root_fs

After that, modify your fstab accordingly.

Jörg Schaible 01-03-2011 06:36 PM

Changing boot device with 2.6.36
 
Nikos Chantziaras wrote:

> On 01/03/2011 07:43 PM, Jörg Schaible wrote:
>> Hi,
>>
>> starting with the 2.6.36-r5 kernel of the Gentoo sources my boot device
>> changes. With 2.6.35 and below it is alway /dev/sda3, with the new kernel
>> it seems that anything that is internally connected with USB is assigned
>> a device first. Since my computer has an internal media bay (and my
>> monitor has such a thing also) the first HD moves - it I take care it is
>> now /dev/sde3. However, if I forget to switch on the monitor and do this
>> later or if an USB stick is already plugged in at boot time, the HD gets
>> a different device number again.
>>
>> Can somebody else confirm such a behaviour with the 2.6.36 kernel and how
>> can this brought back to normal operation?
>
> This has been solved long ago: Label your filesystems and mount them by
> label.

I did this long ago, therefore I can switch between the old and new kernel
easily.

> For example, don't put "/dev/sda3" in your fstab, but label that
> filesystem with a name like "root_fs" and use
> "/dev/disk/by-label/root_fs" in fstab.
>
> Ext2/3/4 filesystem can be labeled with the "e2label" tool. For example:
>
> e2label /dev/sda3 root_fs
>
> After that, modify your fstab accordingly.

And how does this help the kernel to find the root device where /etc/fstab
is located ?

- Jörg

BTW: Yes, I will boot next time with a LABEL entry in the kernels boot
option, but I still don't want a kernel that assigns devices in random
order.

Paul Hartman 01-03-2011 07:21 PM

Changing boot device with 2.6.36
 
On Mon, Jan 3, 2011 at 11:43 AM, Jörg Schaible <joerg.schaible@gmx.de> wrote:
> Hi,
>
> starting with the 2.6.36-r5 kernel of the Gentoo sources my boot device
> changes. With 2.6.35 and below it is alway /dev/sda3, with the new kernel it
> seems that anything that is internally connected with USB is assigned a
> device first. Since my computer has an internal media bay (and my monitor
> has such a thing also) the first HD moves - it I take care it is now
> /dev/sde3. However, if I forget to switch on the monitor and do this later
> or if an USB stick is already plugged in at boot time, the HD gets a
> different device number again.
>
> Can somebody else confirm such a behaviour with the 2.6.36 kernel and how
> can this brought back to normal operation?

Is it possible that your BIOS is changing device order? Do you have
USB device set to boot before HDD device?

Paul Hartman 01-03-2011 07:21 PM

Changing boot device with 2.6.36
 
On Mon, Jan 3, 2011 at 11:43 AM, Jörg Schaible <joerg.schaible@gmx.de> wrote:
> Hi,
>
> starting with the 2.6.36-r5 kernel of the Gentoo sources my boot device
> changes. With 2.6.35 and below it is alway /dev/sda3, with the new kernel it
> seems that anything that is internally connected with USB is assigned a
> device first. Since my computer has an internal media bay (and my monitor
> has such a thing also) the first HD moves - it I take care it is now
> /dev/sde3. However, if I forget to switch on the monitor and do this later
> or if an USB stick is already plugged in at boot time, the HD gets a
> different device number again.
>
> Can somebody else confirm such a behaviour with the 2.6.36 kernel and how
> can this brought back to normal operation?

Is it possible that your BIOS is changing device order? Do you have
USB device set to boot before HDD device?

Alan McKinnon 01-03-2011 08:05 PM

Changing boot device with 2.6.36
 
Apparently, though unproven, at 21:36 on Monday 03 January 2011, Jörg Schaible
did opine thusly:

> Nikos Chantziaras wrote:
> > On 01/03/2011 07:43 PM, Jörg Schaible wrote:
> >> Hi,
> >>
> >> starting with the 2.6.36-r5 kernel of the Gentoo sources my boot device
> >> changes. With 2.6.35 and below it is alway /dev/sda3, with the new
> >> kernel it seems that anything that is internally connected with USB is
> >> assigned a device first. Since my computer has an internal media bay
> >> (and my monitor has such a thing also) the first HD moves - it I take
> >> care it is now /dev/sde3. However, if I forget to switch on the monitor
> >> and do this later or if an USB stick is already plugged in at boot
> >> time, the HD gets a different device number again.
> >>
> >> Can somebody else confirm such a behaviour with the 2.6.36 kernel and
> >> how can this brought back to normal operation?
> >
> > This has been solved long ago: Label your filesystems and mount them by
> > label.
>
> I did this long ago, therefore I can switch between the old and new kernel
> easily.
>
> > For example, don't put "/dev/sda3" in your fstab, but label that
> > filesystem with a name like "root_fs" and use
> > "/dev/disk/by-label/root_fs" in fstab.
> >
> > Ext2/3/4 filesystem can be labeled with the "e2label" tool. For example:
> > e2label /dev/sda3 root_fs
> >
> > After that, modify your fstab accordingly.
>
> And how does this help the kernel to find the root device where /etc/fstab
> is located ?

Does

boot=LABEL=<boot_device_label>

in grub config work for you?

--
alan dot mckinnon at gmail dot com

Stroller 01-03-2011 08:09 PM

Changing boot device with 2.6.36
 
On 3/1/2011, at 7:36pm, Jörg Schaible wrote:
> ...
> And how does this help the kernel to find the root device where /etc/fstab
> is located ?

The kernel doesn't. You leave that to GRUB.

I'm not saying this helps solve your problem, I'm just sayin'.

> BTW: Yes, I will boot next time with a LABEL entry in the kernels boot
> option, but I still don't want a kernel that assigns devices in random
> order.

As long as you can boot, you should seriously stop caring.

If you're concerned about mounting USB sticks or memory cards then use udev rules to distinguish them.

Regarding the booting, and having to change what's in your grub.conf, I'd assume this is a one-off change - you'll change grub.conf to point to the new /dev/sdX and that will require no maintenance in the forseeable future.

GRUB can do labels, but it needs an initrd or initramfs, I think.

Stroller.

"J. Roeleveld" 01-04-2011 06:51 AM

Changing boot device with 2.6.36
 
On Monday 03 January 2011 18:43:28 Jörg Schaible wrote:
> Hi,
>
> starting with the 2.6.36-r5 kernel of the Gentoo sources my boot device
> changes. With 2.6.35 and below it is alway /dev/sda3, with the new kernel
> it seems that anything that is internally connected with USB is assigned a
> device first. Since my computer has an internal media bay (and my monitor
> has such a thing also) the first HD moves - it I take care it is now
> /dev/sde3. However, if I forget to switch on the monitor and do this later
> or if an USB stick is already plugged in at boot time, the HD gets a
> different device number again.
>
> Can somebody else confirm such a behaviour with the 2.6.36 kernel and how
> can this brought back to normal operation?
>
> - Jörg

One way to avoid USB-devices to be picked up before the kernel picks its boot-
device is to put the USB-stuff as modules and have them loaded later.

I haven't found a way to delay usb-device detection yet.

--
Joost

Jörg Schaible 01-04-2011 08:42 AM

Changing boot device with 2.6.36
 
Hi Stroller,

Stroller wrote:

>
> On 3/1/2011, at 7:36pm, Jörg Schaible wrote:
>> ...
>> And how does this help the kernel to find the root device where
>> /etc/fstab is located ?
>
> The kernel doesn't. You leave that to GRUB.
>
> I'm not saying this helps solve your problem, I'm just sayin'.
>
>> BTW: Yes, I will boot next time with a LABEL entry in the kernels boot
>> option, but I still don't want a kernel that assigns devices in random
>> order.
>
> As long as you can boot, you should seriously stop caring.

That's it: I cannot! At least not always.

> If you're concerned about mounting USB sticks or memory cards then use
> udev rules to distinguish them.
>
> Regarding the booting, and having to change what's in your grub.conf, I'd
> assume this is a one-off change - you'll change grub.conf to point to the
> new /dev/sdX and that will require no maintenance in the forseeable
> future.

But that's the point: What is X? It is constantly changing with 2.6.36!

> GRUB can do labels, but it needs an initrd or initramfs, I think.

I could not get that working until now ...

- Jörg

Jörg Schaible 01-04-2011 08:42 AM

Changing boot device with 2.6.36
 
Hi Alan,

Alan McKinnon wrote:

> Apparently, though unproven, at 21:36 on Monday 03 January 2011, Jörg
> Schaible did opine thusly:
>
>> Nikos Chantziaras wrote:
>> > On 01/03/2011 07:43 PM, Jörg Schaible wrote:
>> >> Hi,
>> >>
>> >> starting with the 2.6.36-r5 kernel of the Gentoo sources my boot
>> >> device changes. With 2.6.35 and below it is alway /dev/sda3, with the
>> >> new kernel it seems that anything that is internally connected with
>> >> USB is assigned a device first. Since my computer has an internal
>> >> media bay (and my monitor has such a thing also) the first HD moves -
>> >> it I take care it is now /dev/sde3. However, if I forget to switch on
>> >> the monitor and do this later or if an USB stick is already plugged in
>> >> at boot time, the HD gets a different device number again.
>> >>
>> >> Can somebody else confirm such a behaviour with the 2.6.36 kernel and
>> >> how can this brought back to normal operation?
>> >
>> > This has been solved long ago: Label your filesystems and mount them by
>> > label.
>>
>> I did this long ago, therefore I can switch between the old and new
>> kernel easily.
>>
>> > For example, don't put "/dev/sda3" in your fstab, but label that
>> > filesystem with a name like "root_fs" and use
>> > "/dev/disk/by-label/root_fs" in fstab.
>> >
>> > Ext2/3/4 filesystem can be labeled with the "e2label" tool. For
>> > example:
>> > e2label /dev/sda3 root_fs
>> >
>> > After that, modify your fstab accordingly.
>>
>> And how does this help the kernel to find the root device where
>> /etc/fstab is located ?
>
> Does
>
> boot=LABEL=<boot_device_label>
>
> in grub config work for you?

I hoped so, but actually no. Grub complains at boot time not finding the
root device. Is this available in the grub-0.97 series at all?

- Jörg

Jörg Schaible 01-04-2011 08:43 AM

Changing boot device with 2.6.36
 
Hi Paul,

Paul Hartman wrote:

> On Mon, Jan 3, 2011 at 11:43 AM, Jörg Schaible <joerg.schaible@gmx.de>
> wrote:
>> Hi,
>>
>> starting with the 2.6.36-r5 kernel of the Gentoo sources my boot device
>> changes. With 2.6.35 and below it is alway /dev/sda3, with the new kernel
>> it seems that anything that is internally connected with USB is assigned
>> a device first. Since my computer has an internal media bay (and my
>> monitor has such a thing also) the first HD moves - it I take care it is
>> now /dev/sde3. However, if I forget to switch on the monitor and do this
>> later or if an USB stick is already plugged in at boot time, the HD gets
>> a different device number again.
>>
>> Can somebody else confirm such a behaviour with the 2.6.36 kernel and how
>> can this brought back to normal operation?
>
> Is it possible that your BIOS is changing device order? Do you have
> USB device set to boot before HDD device?

No, HD is first. But I'll recheck.

- Jörg


All times are GMT. The time now is 10:49 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.