Page 1 of 2 12 LastLast
Results 1 to 10 of 15

Thread: GRUB2 booting with labels (no UUID)

  1. #1
    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

    GRUB2 booting with labels (no UUID)

    Quote Originally Posted by Leppie View Post
    in the end, you could edit the grub.cfg every time update-grub is run. but why would you do that if it isn't necessary since there's other ways to make it stick? would be kind of masochistic, don't you think?

    anyways, if you really do want to edit the grub.cfg, you should delete the piece between the 30_os-prober comments (start and end), but don't remove the comments themselves.
    Thanks for your explanations. You are right. I certainly don't want to edit grub.cfg if I can avoid it.

    Speaking of which, do you happen to know how to make update-grub generate a grub.cfg file that uses labels instead of UUID's to identify the root device?

    I have hand-edited grub.cfg now so that my system will boot entirely using filesystem labels. It works. But I need it to stick. I haven't found any help on that yet.
    Last edited by MountainX; July 14th, 2010 at 02:11 AM. Reason: typo
    Desktop: KX Studio (Kubuntu 12.04)
    Laptop & Netbook: Kubuntu 12.04
    Tablet: Samsung Galaxy Tab 10.1
    Phone: Nexus 4 Cyanogenmod

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

    Re: GRUB_DISABLE_OS_PROBER=true

    I'm not sure "labels" has been incorporated yet, although it would certainly be nice. There are LABEL and LLABEL designations in some of the G2 files but they don't refer to the labels as we commonly think of them.


    As far as how 30_op-prober is supposed to work, if you use the "true" statement or make it unexecutable, Grub2 will not search your other partitions for more Linux or other OS's. No 30_os-prober section will appear in /boot/grub/grub.cfg.

    I couldn't tell if you had solved the 30_os-prober satisfactorily or not. If not, just elaborate on what you want to do.

    Instead of hand-editing grub.cfg, making a custom menu or modifying /etc/grub.d/40_custom is a far better way to do this.
    http://sourceforge.net/apps/mediawik...ms:Custom_Menu
    Back to Xorg...

    Retired.

  3. #3
    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

    Quote Originally Posted by drs305 View Post
    I'm not sure "labels" has been incorporated yet, although it would certainly be nice.
    Yes, it's in there. See here:
    http://www.gnu.org/software/grub/man...ub.html#search

    Furthermore, someone at Linux Mint forums figured out how to make it work. He did it by manually editing grub.cfg. I tried it and it works for me too. Now all I need to do it figure out how to make update-grub generate a grub.cfg file that uses labels.
    Desktop: KX Studio (Kubuntu 12.04)
    Laptop & Netbook: Kubuntu 12.04
    Tablet: Samsung Galaxy Tab 10.1
    Phone: Nexus 4 Cyanogenmod

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

    Re: GRUB_DISABLE_OS_PROBER=true

    Quote Originally Posted by MountainX View Post


    Another reason to review the new GNU Grub (2) Manual !
    Back to Xorg...

    Retired.

  5. #5
    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

    Quote Originally Posted by drs305 View Post
    As far as how 30_op-prober is supposed to work, if you use the "true" statement or make it unexecutable, Grub2 will not search your other partitions for more Linux or other OS's. No 30_os-prober section will appear in /boot/grub/grub.cfg.

    I couldn't tell if you had solved the 30_os-prober satisfactorily or not. If not, just elaborate on what you want to do.
    When I use "true" (with or without quotes) the 30_os-prober section does still appear in grub.cfg. And if I just manually delete that section and do grub-install, the grub menu appears, which I don't want.

    However, I decided not to work on the os-prober issue any longer. It isn't essential.

    What is essential is figuring out how to generate a grub.cfg that doesn't include UUID's anywhere. I posted that question in a separate thread. I think the moderators may get upset with me for posting that grub2-UUID question more than once.
    Desktop: KX Studio (Kubuntu 12.04)
    Laptop & Netbook: Kubuntu 12.04
    Tablet: Samsung Galaxy Tab 10.1
    Phone: Nexus 4 Cyanogenmod

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

    Re: GRUB_DISABLE_OS_PROBER=true

    Quote Originally Posted by MountainX View Post
    What is essential is figuring out how to generate a grub.cfg that doesn't include UUID's anywhere. I posted that question in a separate thread. I think the moderators may get upset with me for posting that grub2-UUID question more than once.
    In /etc/default/grub there is a line:
    Code:
    #GRUB_DISABLE_LINUX_UUID=true
    If you uncomment that line and update grub UUIDs will not be used in the "linux" line of the menu entries.

    It still appears in the "search" line; if you don't want the "search" line, you can remove it from grub.cfg by following the "Step 4" instructions in this post:
    http://sourceforge.net/apps/mediawik...roblems:search
    Back to Xorg...

    Retired.

  7. #7
    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

    Quote Originally Posted by drs305 View Post
    It still appears in the "search" line; if you don't want the "search" line, you can remove it from grub.cfg by following the "Step 4" instructions in this post:
    http://sourceforge.net/apps/mediawik...roblems:search
    Great! That's a helpful link. That's what I needed. Thanks.
    Desktop: KX Studio (Kubuntu 12.04)
    Laptop & Netbook: Kubuntu 12.04
    Tablet: Samsung Galaxy Tab 10.1
    Phone: Nexus 4 Cyanogenmod

  8. #8
    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

    here are the modified sections from my new /usr/lib/grub/grub-mkconfig_lib

    This is a bit of a hack because my label is hard-coded. But at least it will make my grub.cfg changes stick.

    up top I added this line:
    CUSTOM_LABEL=mylabel

    # If there's a valid filesystem label 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`'"
    #REMOVED if fs_uuid="`${grub_probe} --device ${device} --target=fs_uuid 2> /dev/null`" ; then
    echo "search --no-floppy --label ${CUSTOM_LABEL} --set root"
    #fi

    If anyone wants to tell me how to do this without hard-coding my label, that would be great!
    Desktop: KX Studio (Kubuntu 12.04)
    Laptop & Netbook: Kubuntu 12.04
    Tablet: Samsung Galaxy Tab 10.1
    Phone: Nexus 4 Cyanogenmod

  9. #9
    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

    looking a little more closely at this, I don't think my changes are enough.

    It isn't clear to me how those edits will generate this line in grub.cfg:

    Code:
    linux	/boot/vmlinuz-2.6.32-21-generic root=LABEL=mylabel ro   quiet splash
    How do I do that automatically (not editing grub.cfg)?
    Desktop: KX Studio (Kubuntu 12.04)
    Laptop & Netbook: Kubuntu 12.04
    Tablet: Samsung Galaxy Tab 10.1
    Phone: Nexus 4 Cyanogenmod

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

    Re: GRUB_DISABLE_OS_PROBER=true

    MountainX,

    If you want to get the label into your #10_linux section of grub.cfg, you can modify the /etc/grub.d/10_linux file. Read all the way through before doing this.

    Two actions to take before running this:
    a. Backup /etc/grub.d/10_linux
    b. Test this from the grub menu before commiting to grub.cfg. From the grub menu, highlight your Linux selection, press "e" to get into the edit mode. Go to the "linux" line and type in exactly what you expect the new line to look like. It should be something like:
    linux /boot/vmlinuz-2.6.32-23-generic root=label=mylabel ro splash
    Press CTRL-x to make sure it boots correctly. If it does, you can make the changes permanent in grub.cfg.

    Find this section of /etc/grub.d/10_linux (approx line 95):
    cat << EOF
    linux ${rel_dirname}/${basename} root=${linux_root_device_thisversion} ro ${args}
    EOF
    Preceed the line with your label information. These commands extract the label of the linux / partition and replaces the UUID or device name with the label option:

    auto_label="`e2label ${linux_root_device_thisversion}`"
    linux_root_device_thisversion="label=${auto_label} "

    cat << EOF
    linux ${rel_dirname}/${basename} root=${linux_root_device_thisversion} ro ${args}
    EOF
    This will produce a "linux" line of:
    linux /boot/vmlinuz-2.6.32-23-generic root=label=auto_label ro splash
    One note: Grub still determines what the default partition is. This tweak merely changes the root device designation into a label.
    Last edited by drs305; July 13th, 2010 at 05:06 PM.
    Back to Xorg...

    Retired.

Page 1 of 2 12 LastLast

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
  •