Results 1 to 2 of 2

Thread: How to generate a grub.cfg that uses LABELs not UUID's?

  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

    How to generate a grub.cfg that uses LABELs not UUID's?

    I want to generate a grub.conf that will search for my /dev/sda1 based on the filesystem label, not the UUID.

    I did change /etc/default/grub to so that GRUB_DISABLE_LINUX_UUID="true" and I regenerated grub.cfg.

    But I want to go one step further and change the search statements. I notice they still reference the old UUID. I also know grub2 can search by label. Can anyone tell me how to do this? Thanks.

    EDIT:

    I could use some help understanding this page:
    http://www.gnu.org/software/grub/man...ub.html#search

    12.3.28 search

    — Command: search [--file|--label|--fs-uuid] [--set var] [--no-floppy] name
    Search devices by file (-f, --file), filesystem label (-l, --label), or filesystem UUID (-u, --fs-uuid).

    If the --set option is used, the first device found is set as the value of environment variable var. The default variable is ‘root’.

    The --no-floppy option prevents searching floppy devices, which can be slow.

    The ‘search.file’, ‘search.fs_label’, and ‘search.fs_uuid’ commands are aliases for ‘search --file’, ‘search --label’, and ‘search --fs-uuid’ respectively.
    I'd like my grub.cfg to contain statements similar to this:

    Code:
    search --no-floppy --label MyLabel --set
    linux /boot/vmlinuz-2.6.3x-xx-generic root=label=MyLabel ro quiet splash
    initrd /boot/initrd.img-2.6.3x-xx-generic
    Assuming that's the right syntax, how do I make grub2 generate label-based menu entries like that?
    Last edited by MountainX; July 12th, 2010 at 11:43 PM. 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
    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: How to generate a grub.cfg that uses LABELs not UUID's?

    Desktop: KX Studio (Kubuntu 12.04)
    Laptop & Netbook: Kubuntu 12.04
    Tablet: Samsung Galaxy Tab 10.1
    Phone: Nexus 4 Cyanogenmod

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
  •