Page 2 of 2 FirstFirst 12
Results 11 to 15 of 15

Thread: GRUB2 booting with labels (no UUID)

  1. #11
    MountainX's Avatar
    MountainX is offline Iced Blended Vanilla Crème Ubuntu
    Join Date
    Jan 2008
    Location
    A place with no mountains
    Beans
    1,610
    Distro
    Kubuntu

    Re: GRUB_DISABLE_OS_PROBER=true

    I cannot fully express my gratitude for your help with this! Thank you!

    I will try it and report back.

    BTW, I have already verified that my hand-edited menu stanza works. I edited grub.cfg and I've been booting up with it for a couple days. But I will proceed carefully, following your advice. (And I am also working on a test machine atm that contains no data.)
    Desktop: KX Studio (Kubuntu 12.04)
    Laptop & Netbook: Kubuntu 12.04
    Tablet: Samsung Galaxy Tab 10.1
    Phone: Nexus 4 Cyanogenmod

  2. #12
    MountainX's Avatar
    MountainX is offline Iced Blended Vanilla Crème Ubuntu
    Join Date
    Jan 2008
    Location
    A place with no mountains
    Beans
    1,610
    Distro
    Kubuntu

    Re: GRUB_DISABLE_OS_PROBER=true

    It looks like this approach works
    I'm still testing, but so far so good. I had to make a few minor changes in the executable portion. I'll post that when I'm done. (It's on another machine, so I can't post it now.)

    It looks like we can also edit grub-mkconfig_lib to generate a search line similar to this using your suggestion above

    echo "search --no-floppy --label ${auto_label} --set root"
    I think I have it working...
    Desktop: KX Studio (Kubuntu 12.04)
    Laptop & Netbook: Kubuntu 12.04
    Tablet: Samsung Galaxy Tab 10.1
    Phone: Nexus 4 Cyanogenmod

  3. #13
    MountainX's Avatar
    MountainX is offline Iced Blended Vanilla Crème Ubuntu
    Join Date
    Jan 2008
    Location
    A place with no mountains
    Beans
    1,610
    Distro
    Kubuntu

    Re: GRUB2 booting with labels (no UUID)

    Thanks drs305. It works!

    It would be great if the moderators could split this thread starting at post #8. At that point the conversation turned to using labels with grub2. This is an important question I think. I have seen a lot of people asking about it and I have not found a good solution yet. But the approach drs305 suggested does work. So it would be nice to have it in a new thread with a proper title that reflects grub2 and labels.

    Let me summarize what I did. I hope others comment in regard to whether all these steps are necessary and accurate. But this IS WORKING for me.

    1. changed /etc/defaults/grub
    uncommented this line and used quotes around true:
    Code:
    GRUB_DISABLE_LINUX_UUID="true"
    2. changed /etc/grub.d/10_linux as follows:
    Code:
    auto_label="`e2label ${GRUB_DEVICE_BOOT} 2>/dev/null`"
      linux_root_device_thisversion="LABEL=${auto_label}"
      cat << EOF
    	linux	${rel_dirname}/${basename} root=${linux_root_device_thisversion} ro ${args}
    EOF
    3. changed /usr/lib/grub/grub-mkconfig_lib as follows. I know this code could be improved by including it in a proper conditional, but I didn't know how to do that. So it just executes always.
    Code:
      # If there's a filesystem UUID that GRUB is capable of identifying, use it;
      # otherwise set root as per value in device.map.
      echo "set root='`${grub_probe} --device ${device} --target=drive`'"
      #if fs_label="`${grub_probe} --device ${device} --target=fs_uuid 2> /dev/null`" ; then
        #echo "search --no-floppy --fs-uuid --set ${fs_uuid}"
      #fi
    auto_label="`e2label ${device} 2>/dev/null`"
    echo "search --no-floppy --label ${auto_label} --set root"
    Those changes generate perfect (as far as I'm concerned) stanzas in grub.cfg. And my test machine boots as expected.

    Code:
    menuentry "Linux Mint 9, 2.6.32-21-generic (/dev/sda1) -- recovery mode" --class linuxmint --class gnu-linux --class gnu --class os {
    	recordfail
    	insmod ext2
    	set root='(hd0,1)'
    	search --no-floppy --label my_label --set root
    	echo	'Loading Linux 2.6.32-21-generic ...'
    	linux	/boot/vmlinuz-2.6.32-21-generic root=LABEL=my_label ro single 
    	echo	'Loading initial ramdisk ...'
    	initrd	/boot/initrd.img-2.6.32-21-generic
    }
    my /etc/fstab also uses labels. Here's an example (although this exact example is from another machine)

    Code:
    LABEL=home_volume       /home   ext4    noatime,acl,user_xattr 1 2
    LABEL=root_volume       /       ext4    noatime,acl,user_xattr 1 1
    LABEL=swap_volume       swap    swap    defaults 0 0
    LABEL=boot_volume       /boot   ext2    noatime,acl 1 2
    Desktop: KX Studio (Kubuntu 12.04)
    Laptop & Netbook: Kubuntu 12.04
    Tablet: Samsung Galaxy Tab 10.1
    Phone: Nexus 4 Cyanogenmod

  4. #14
    Join Date
    Jan 2007
    Beans
    Hidden!
    Distro
    Ubuntu Development Release

    Re: GRUB2 booting with labels (no UUID)

    Quote Originally Posted by MountainX View Post
    Thanks drs305. It works!

    It would be great if the moderators could split this thread starting at post #8.
    MountainX,

    As you can see, I've split the thread and created this new one specifically for your "label" issues.

    You may need to resubscribe to your original post:
    http://ubuntuforums.org/showthread.php?t=1529799
    Last edited by drs305; July 14th, 2010 at 12:00 AM.
    Back to Xorg...

    Retired.

  5. #15
    Join Date
    Jul 2006
    Location
    vancouver, bc
    Beans
    44
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: GRUB2 booting with labels (no UUID)

    This is exactly why I hate GRUB2. This is 10x the hack required for GRUB1 to do the same thing. I don't understand why it has to be this complicated. And I fail to see how a bunch of config files spread all over the place and requiring programs to run with them (not just a simple text edit to menu.1st) is an improvement. Also, no longer is all the important config contained within /boot like it SHOULD be.

    UUID is a hack in itself and shouldn't be the only easy option.

    Thank you MountainX for this excellent summary.
    I am what I am because of who We all are.
    {I am a Bittorrent addict}

Page 2 of 2 FirstFirst 12

Bookmarks

Posting Permissions

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