Results 1 to 8 of 8

Thread: Booting BT3 using UUID instead of /dev/sdxy

  1. #1
    Just burned his ISO
    Join Date
    Sep 2008
    Posts
    12

    Default Booting BT3 using UUID instead of /dev/sdxy

    Hi,

    I've done a real BT3 installation on a USB thumb. As long as there is only one hard disk and the USB drive the normal way using /dev/sdxy both in lilo.conf and fstab works fine.

    If I try using it with another USB drive attached, the assigned x in sdxy changes (depending on the order of recognition). So sometimes I end up with an error.

    Than I learnt that other distros (e.g. GRML) use GRUB as a bootloader since grub supports UUID numbers instead of the conventional /dev/sdxxy notation. So I installed GRUB on the BT3 and changed both the menu.lst and fstab manually.

    However, something is still wrong. I'm getting a VFS error saying "Cannot open root device "UUID=..." Please append a correct boot option bla bla.

    Did a long search (on GRML installation) for other files containing the string "UUID=" in order to get any idea where I made the mistake. To no avail so far. Would be happy if anybody could give me a hint.

    Thx in advance.

    The MoD

  2. #2
    Good friend of the forums
    Join Date
    Jan 2010
    Location
    outside chicago, il
    Posts
    442

    Default

    Quote Originally Posted by The MoD View Post
    Hi,

    I've done a real BT3 installation on a USB thumb. As long as there is only one hard disk and the USB drive the normal way using /dev/sdxy both in lilo.conf and fstab works fine.

    If I try using it with another USB drive attached, the assigned x in sdxy changes (depending on the order of recognition). So sometimes I end up with an error.

    Than I learnt that other distros (e.g. GRML) use GRUB as a bootloader since grub supports UUID numbers instead of the conventional /dev/sdxxy notation. So I installed GRUB on the BT3 and changed both the menu.lst and fstab manually.

    However, something is still wrong. I'm getting a VFS error saying "Cannot open root device "UUID=..." Please append a correct boot option bla bla.

    Did a long search (on GRML installation) for other files containing the string "UUID=" in order to get any idea where I made the mistake. To no avail so far. Would be happy if anybody could give me a hint.

    Thx in advance.

    The MoD
    I have been working on this for 3 months now. The short version is booting by label or uuid will never work with current versions of slackware. I have been living with the dev changing for 1.5 years. I stopped using lilo and switched to grub so I can change the kernel command easier.

    We are not alone in this. slackuser46 has been asking about this at http://www.linuxquestions.org/questi...orking-671890/

    The long version:
    The problem is many fold. The first part is busybox 1.7.2 in slackware 12.1 and busybox 1.4.2 in slackware 12 don't support booting by label or uuid. Slackware needs at least busybox 1.10. The slackware people apparently don't know that the reason they give (they need statically linked binaries using glibc in their initrd) has been fixed. I compiled busybox 1.11.2 as a static binary and it works fine, confirming slackuser46s information.

    Next the init in the initrd.gz file doesn't support booting by label or uuid. There is a very interesting article at http://lwn.net/Articles/298593/ about possibly getting everyone to use the same files. That would be a huge help.

    Finally the initrd needs devmapper. I haven't figured this part out yet.
    I like the bleeding edge, but I don't like blood loss

  3. #3
    Just burned his ISO
    Join Date
    Sep 2008
    Posts
    12

    Default looks like I need some more help ...

    Hi,

    first of all thanks for the hints. I've build and installed a static version of busybox. This was the easy part. However, it still does not work. The point is: I'm simply not sure weather I need also to build an initrd or not.

    The second question I have is related to busybox itself. It provides a whole bunch of stripped commands. Do I really need all of them? Or do I create a 'security hole' by having more commands in than I really need?

    Thx in advance.


    The MoD

  4. #4
    Good friend of the forums
    Join Date
    Jan 2010
    Location
    outside chicago, il
    Posts
    442

    Default

    Quote Originally Posted by The MoD View Post
    Hi,

    first of all thanks for the hints. I've build and installed a static version of busybox. This was the easy part. However, it still does not work. The point is: I'm simply not sure weather I need also to build an initrd or not.

    The second question I have is related to busybox itself. It provides a whole bunch of stripped commands. Do I really need all of them? Or do I create a 'security hole' by having more commands in than I really need?

    The MoD
    Building a new busybox is only the first part. The rest is not actually possible. There is no way to get root=LABEL= to work.

    That being said I can across the following website in a thread I was reading:
    http://linuxconfig.dyndns.org:1184/l...vable_USB_disk

    This will show you how to make an initrd that will find your hard drive based on the label you put in the init file which is a part of the initrd. This is NOT booting using root=LABEL as the label is hard coded in init. However it is a GREAT workaround. I set it up on my PC an hour ago and it seems to work fine. You don't even need a new busybox.

    Good Luck
    I like the bleeding edge, but I don't like blood loss

  5. #5
    Just burned his ISO
    Join Date
    Sep 2008
    Posts
    12

    Default Problem solved

    Hi,

    I've found a very easy solution to solve the problem. I can now boot the box from my USB thumb drive using /dev/sdxy, LABEL and / or UUID - whatever I want.

    Here is, how I did it (finally, and with the help of many others!)

    1) install mkinitrd
    get the latest version
    run pkginstall mkinitrd-version.tgz

    2) edit the init file in /boot/initrd-tree
    go to section "#Parse command line" and change the following lines:
    line 73 from "root=/dev/*)" to "root=*)"
    line 74 from "ROOTDEV='echo $ARG | cut -f2 -d=' to "ROOTDEV='echo $ARG | cut -b6-'
    save changes

    3) download busybox (I'm using 1.12.2)
    - untar it (using -jxf, I think)
    - run "make menuconfig"
    - go to "Busybox Settings --> Build Options" and set the option "Build as static"
    - exit to the main menu
    - go to "Linux System Utilities" and "tick" in the section "Routines for detecting label in uuid on common file systems" the file systems you need
    - go to the section "mount" and "tick" "support specifiying devices by label and uuid"
    - exit menuconfig and save your configuration
    - run "make"
    - note: there is no need to run "make install" !!!
    - replace the busybox version in /boot/initrd-tree/bin with the one created in /path/busybox-version/busybox

    3) build your initrd.gz
    I used the following howto:
    hxxp://linuxconfig.dyndns.org:1184/lazy/LazyLinuxWiki/Backup_and_Restore/Install_Linux_to_removable_USB_disk

    4) adjust your lilo.conf and run "lilo -v"
    my one looks like this:
    image = /boot/vmlinuz
    append = "root=UUID=1234abcd-5678-efgh-90ij-klmnopqrstuv"
    initrd = /boot/initrd.gz
    label = by_UUID

    you may also use LABEL. In this case the second line looks like this
    append = "root=LABEL=label"

    Enjoy.

    The MoD

  6. #6
    Good friend of the forums
    Join Date
    Jan 2010
    Location
    outside chicago, il
    Posts
    442

    Default

    Quote Originally Posted by The MoD View Post
    Hi,
    1) install mkinitrd
    get the latest version
    run pkginstall mkinitrd-version.tgz

    2) edit the init file in /boot/initrd-tree
    go to section "#Parse command line" and change the following lines:
    line 73 from "root=/dev/*)" to "root=*)"
    line 74 from "ROOTDEV='echo $ARG | cut -f2 -d=' to "ROOTDEV='echo $ARG | cut -b6-'
    save changes

    3) download busybox (I'm using 1.12.2)
    - untar it (using -jxf, I think)
    - run "make menuconfig"
    - go to "Busybox Settings --> Build Options" and set the option "Build as static"
    - exit to the main menu
    - go to "Linux System Utilities" and "tick" in the section "Routines for detecting label in uuid on common file systems" the file systems you need
    - go to the section "mount" and "tick" "support specifiying devices by label and uuid"
    - exit menuconfig and save your configuration
    - run "make"
    - note: there is no need to run "make install" !!!
    - replace the busybox version in /boot/initrd-tree/bin with the one created in /path/busybox-version/busybox

    3) build your initrd.gz
    I used the following howto:
    hxxp://linuxconfig.dyndns.org:1184/lazy/LazyLinuxWiki/Backup_and_Restore/Install_Linux_to_removable_USB_disk

    4) adjust your lilo.conf and run "lilo -v"
    my one looks like this:
    image = /boot/vmlinuz
    append = "root=UUID=1234abcd-5678-efgh-90ij-klmnopqrstuv"
    initrd = /boot/initrd.gz
    label = by_UUID

    you may also use LABEL. In this case the second line looks like this
    append = "root=LABEL=label"
    I did 1 and 2 exactly as you specified. Part 3 is where I have a problem. The instructions in the link you provide say to replace the init in /boot/initrd-tree with the version from the link. This negates the changes made in step 2.

    So I skip that part and I do the copy of the files:
    mv /boot/initrd-tree/bin/awk /boot/initrd-tree/bin/awk2
    cp /usr/bin/awk /boot/initrd-tree/bin/
    cp /sbin/blkid /boot/initrd-tree/bin/
    cp /lib/ld-linux.so.2 /boot/initrd-tree/lib/
    cp /lib/libblkid.so.1 /boot/initrd-tree/lib/
    cp /lib/libc.so.6 /boot/initrd-tree/lib/
    cp /lib/libdl.so.2 /boot/initrd-tree/lib/
    cp /lib/libm.so.6 /boot/initrd-tree/lib/
    cp /lib/libuuid.so.1 /boot/initrd-tree/lib/

    I run mkinitrd
    I change my grub menu.lst to:
    title BT3 on USB initrd
    root (hd0,1)
    kernel /bt3final root=LABEL=BT3USB

    I reboot and the kernel can't find root.
    So what do I do for step 3?

    Thanks,
    I like the bleeding edge, but I don't like blood loss

  7. #7
    Just burned his ISO
    Join Date
    Sep 2008
    Posts
    12

    Default

    Bofh28,

    I have to say Sorry. First for my very late reply. I haven't checked my posting for quite some time. And second for one omission: So far I was using and changing the init file from the howto mentioned in 3). However, I've checked it yesterday evening for my Desktop installation (Zenwalk, also based on Slackware) with the current mkinitrd package. It works without the "dynamic booting" added by Magnus Uppmann.

    But let me explain a bit more in detail how it works.

    1) in the config file for the boot loader (menu.lst or lilo.conf) a parameter is provided to the kernel
    2) **I'm not sure what the kernel does internally**
    3) the parameters that were passed to the kernel are stored in /proc/cmdline so they can be analysed by the init file in the initrd.gz
    4) originally the command line parser in the init file was searching for the pattern "root=/dev/" and used "=" as the delimiter
    5) this is the first problem that prevented from using UUID or LABEL
    6) so I've changed the first line so it now searches for "root=" and the second line cuts these 5 bytes
    7) in this way the $ROOTDEV variable now may contain "/dev/hdxy", "/dev/sdxy", "UUID=uuid" or "LABEL=label"
    8) basically it might contain anything including any nonsense as long as it starts with "root="
    9) changing the statically linked busybox is necessary because the version 1.7.x that comes with the package mkinitrd does not support mounting by UUID or LABEL
    10) version 1.12.x and onwards do support "mount UUID=uuid /mountpoint" or "mount LABEL=label" /mountpoint", so you don't need the "dynamic booting" added by
    Magnus Uppmann

    Now a bit more about your problem:

    A) Have you included in your menu.lst a line "initrd = /boot/initrd.gz"?
    B) Make sure it is the initrd.gz file that you have created
    C) If it fails you should be presented with a short message from the initrd file that something went wrong and you now may try to fix that manually.
    D) If not, simply add a "/bin/sh" statement before the mounting so the init file will drop to the shell and you can check which kernel modules were loaded and
    which not
    E) "cat /proc/partitions" or "fdisk -l" shall present you a list of recognized partitions; if these commands don't return anything, either a module is missing, corrupted
    or made for a different kernel version
    F) once you see all the partitions you need (/, /boot, /home etc.) try a "mount LABEL=label /tmp" and exit the shell and see what happens
    G) finally I'm not sure about your statement "kernel /bt3final root=LABEL=BT3USB"; especially the /bt3final part looks unusual to me

    Hope I was able to help you.

    The MoD

  8. #8
    Good friend of the forums
    Join Date
    Jan 2010
    Location
    outside chicago, il
    Posts
    442

    Default

    Quote Originally Posted by The MoD View Post
    Bofh28,
    I have to say Sorry. First for my very late reply. I haven't checked my

    A) Have you included in your menu.lst a line "initrd = /boot/initrd.gz"?
    B) Make sure it is the initrd.gz file that you have created
    C) If it fails you should be presented with a short message from the initrd file that something went wrong and you now may try to fix that manually.
    D) If not, simply add a "/bin/sh" statement before the mounting so the init file will drop to the shell and you can check which kernel modules were loaded and
    which not
    E) "cat /proc/partitions" or "fdisk -l" shall present you a list of recognized partitions; if these commands don't return anything, either a module is missing, corrupted
    or made for a different kernel version
    F) once you see all the partitions you need (/, /boot, /home etc.) try a "mount LABEL=label /tmp" and exit the shell and see what happens
    G) finally I'm not sure about your statement "kernel /bt3final root=LABEL=BT3USB"; especially the /bt3final part looks unusual to me
    Not a problem we are all busy people.

    A. yes initrd=/boot/initrdby.gz I have a initrd.gz for something else
    B. the updated init is in the initrdby.gz
    C. yes I get that message

    I will try again later.
    Thanks,
    I like the bleeding edge, but I don't like blood loss

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •