[gentoo-user] Re: Changing boot device with 2.6.36
On 01/08/2011 05:07 AM, Jörg Schaible wrote: Hi Joost, J. Roeleveld wrote: The easiest solution to this problem would be to ensure that the USB-subsystem is not scanned before the boot-device is identified by the kernels boot- process. This can be achieved by configuring the USB-mass-storage support as a module. This is what I did now and it seems the only setup that actually brings back my root on sda3. Another option would be to patch the kernel to either support Labels natively or to have it include a scan harddisks in following order: option which lists which harddisk-drivers (sata/ide/usb) are scanned and in which order. Yep. Maybe LABELs are supported in future ... it would definitely improve the situation. I'm now using the kernel flag PARTUUID=uuid number to boot, and it really does work. Your kernel will never again try to mount the wrong root disk :) (I think this feature was added after 2.6.36. It's very recent.) The annoying thing is that legacy grub can't do the same, and so it will try to load the kernel from the wrong disk if the BIOS changes the disk numbers at boot time. I've emerged grub-2 to play with but it's quite different from legacy grub and I don't yet have a good feel for it. If it solves this problem I'll let you know later.
Re: [gentoo-user] Re: Changing boot device with 2.6.36
walt wrote: I've emerged grub-2 to play with but it's quite different from legacy grub and I don't yet have a good feel for it. If it solves this problem I'll let you know later. I wouldn't mind a new thread and you posting how it works and all. I wouldn't mind switching at some point in the near future but would like someone with hands on experience to describe how the switch went. The man page and other docs are nice but real live experience is even better. Dale :-) :-)
[gentoo-user] Re: 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.schai...@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
[gentoo-user] Re: Changing boot device with 2.6.36
Hi Joost, J. Roeleveld wrote: 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. If nothing else helps ... :-/ - Jörg
Re: [gentoo-user] Re: Changing boot device with 2.6.36
On Tuesday 04 January 2011 09:44:05 Jörg Schaible wrote: J. Roeleveld wrote: 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. If nothing else helps ... :-/ As someone remarked a few days ago (Alan? Volker?), a sound strategy is to have only components that are essential to booting the machine built into the kernel; all else should be modules. -- Rgds Peter. Linux Counter 5290, 1994-04-23.
Re: [gentoo-user] Re: Changing boot device with 2.6.36
On 4 January 2011 11:01, Peter Humphrey pe...@humphrey.ukfsn.org wrote: On Tuesday 04 January 2011 09:44:05 Jörg Schaible wrote: J. Roeleveld wrote: 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. If nothing else helps ... :-/ As someone remarked a few days ago (Alan? Volker?), a sound strategy is to have only components that are essential to booting the machine built into the kernel; all else should be modules. There's also the device.map file, but if device names change on the fly each time the machine boots with different things connected to it ... may not be any good for this problem. Perhaps it's time to upgrade to GRUB2 and use labels - because it definitely can use them as well as UUID Nos and can also use scripts which will scan your devices and pick the one you want. -- Regards, Mick
[gentoo-user] Re: 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.
[gentoo-user] Re: 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.
Re: [gentoo-user] Re: Changing boot device with 2.6.36
On 3/1/2011, at 6:17pm, Nikos Chantziaras wrote: On 01/03/2011 07:43 PM, Jörg Schaible wrote: ... 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. ... 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. I believe this is the supported way to use labels: $ grep -v -e ^# -e ^$ /etc/fstab LABEL=boot /boot ext2noauto,noatime 1 2 LABEL=/ / ext4noatime 0 1 LABEL=swap noneswapsw 0 0 /dev/cdrom /mnt/cdrom autonoauto,ro,users 0 0 LABEL=space /mnt/space ext4noatime 0 3 shm /dev/shmtmpfs nodev,nosuid,noexec 0 0 $ Stroller.
Re: [gentoo-user] Re: 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
Re: [gentoo-user] Re: 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.