Page 1 of 3 123 LastLast
Results 1 to 10 of 22

Thread: Adding an Entry to the oSUSE BootLoader

  1. #1
    Join Date
    Jan 2011
    Location
    Guadalajara
    Posts
    173

    Default Adding an Entry to the oSUSE BootLoader

    I installed another OS to a different hard drive on the same computer. It wanted to installed a boot loader to that hard drive, which I didn't let it do. So the boot loader in service is the oSUSE v. 13.1 boot loader, which boots to oSUSE by default. I took a look at the boot loader app in Yast but saw no way to add another entry. I would also like to remove a few OS entries for systems I no longer use.

    I searched the archives for info to do that but found nothing relevant, so I am posting this.

    TIA

  2. #2
    Join Date
    Feb 2009
    Location
    Spain
    Posts
    25,547

    Default Re: Adding an Entry to the oSUSE BootLoader

    On 2013-12-28 03:36, d hinds wrote:
    > I installed another OS to a different hard drive on the same computer.
    > It wanted to installed a boot loader to that hard drive, which I didn't
    > let it do.


    It is easier if you do.

    --
    Cheers / Saludos,

    Carlos E. R.
    (from 13.1 x86_64 "Bottle" (Elessar))

  3. #3
    Join Date
    Jan 2011
    Location
    Guadalajara
    Posts
    173

    Default Re: Adding an Entry to the oSUSE BootLoader

    Quote Originally Posted by robin_listas View Post
    On 2013-12-28 03:36, d hinds wrote:
    > I installed another OS to a different hard drive on the same computer.
    > It wanted to installed a boot loader to that hard drive, which I didn't
    > let it do.


    It is easier if you do.

    --
    Cheers / Saludos,

    Carlos E. R.
    (from 13.1 x86_64 "Bottle" (Elessar))
    How so? Would it have included all the entries listed on the Bootloader found on the sda drive? Why would I want boot loaders installed to both disks when all the OS's except 1 are on sda? Also, most distros will ask you where you want the boot loader. This one didn't. I can't allow that.

    IAC, I want to add an entry to the oSUSE boot loader menu and delete others. If you know how to do that, why don't you say so? Out with it, Carlos.

  4. #4
    Join Date
    Feb 2009
    Location
    Spain
    Posts
    25,547

    Default Re: Adding an Entry to the oSUSE BootLoader

    On 2013-12-28 04:06, d hinds wrote:

    >> It is easier if you do.



    > How so? Would it have included all the entries listed on the Bootloader
    > found on the sda drive?


    Of course not. Or maybe yes, because grub 2 finds them all, if it works correctly.

    The idea is that the second system is "happy" having its own boot system, which is in fact called
    from the first boot system. This way you do not need to add entries to the first grub each time you
    change options on the second.


    > IAC, I want to add an entry to the oSUSE boot loader menu and delete
    > others. If you know how to do that, why don't you say so? Out with it,
    > Carlos.


    Barely. I have the automatic entries. There is a custom section, though.

    --
    Cheers / Saludos,

    Carlos E. R.
    (from 13.1 x86_64 "Bottle" (Elessar))

  5. #5
    Join Date
    Jan 2011
    Location
    Guadalajara
    Posts
    173

    Default Re: Adding an Entry to the oSUSE BootLoader

    Quote Originally Posted by robin_listas View Post
    On 2013-12-28 04:06, d hinds wrote:

    >> It is easier if you do.



    > How so? Would it have included all the entries listed on the Bootloader
    > found on the sda drive?


    Of course not. Or maybe yes, because grub 2 finds them all, if it works correctly.

    The idea is that the second system is "happy" having its own boot system, which is in fact called
    from the first boot system. This way you do not need to add entries to the first grub each time you
    change options on the second.


    > IAC, I want to add an entry to the oSUSE boot loader menu and delete
    > others. If you know how to do that, why don't you say so? Out with it,
    > Carlos.


    Barely. I have the automatic entries. There is a custom section, though.

    --
    Cheers / Saludos,

    Carlos E. R.
    (from 13.1 x86_64 "Bottle" (Elessar))
    Thanks anyway. What I need to know then, is how do I edit the grub.cfg file found in Computer > boot > grub2?

    It's a binary file (as are others named device.map, there) and nautilus says they all are of an unknown type.

    (I am trying to maintain openSUSE as the default boot choice, and take a look at another distro, that way. If I install the other distro with it's boot manager, that would change the menu and openSUSE would no longer be at the top, with it's openSUSE graphics).

    TIA

  6. #6
    Join Date
    Feb 2009
    Location
    Spain
    Posts
    25,547

    Default Re: Adding an Entry to the oSUSE BootLoader

    On 2013-12-29 02:06, d hinds wrote:

    > Thanks anyway. What I need to know then, is how do I edit the grub.cfg
    > file found in Computer > boot > grub2?


    It is /boot/grub2/grub.cfg. There is no point in editing it directly (although it is a text file,
    not binary), because it is automatically generated from others. You can edit it, of course, but it
    will not survive long.


    > (I am trying to maintain openSUSE as the default boot choice, and take a
    > look at another distro, that way. If I install the other distro with
    > it's boot manager, that would change the menu and openSUSE would no
    > longer be at the top, with it's openSUSE graphics).


    You probably edit these:

    /etc/grub.d/40_custom
    /etc/grub.d/41_custom

    --
    Cheers / Saludos,

    Carlos E. R.
    (from 13.1 x86_64 "Bottle" (Elessar))

  7. #7
    Join Date
    Jun 2008
    Location
    Auckland, NZ
    Posts
    23,710
    Blog Entries
    1

    Default Re: Adding an Entry to the oSUSE BootLoader

    Quote Originally Posted by d_hinds View Post
    Thanks anyway. What I need to know then, is how do I edit the grub.cfg file found in Computer > boot > grub2?

    It's a binary file (as are others named device.map, there) and nautilus says they all are of an unknown type.

    (I am trying to maintain openSUSE as the default boot choice, and take a look at another distro, that way. If I install the other distro with it's boot manager, that would change the menu and openSUSE would no longer be at the top, with it's openSUSE graphics).

    TIA
    Here's a guide on this

    https://wiki.archlinux.org/index.php...nux_menu_entry

    Just remember, that grub.cfg lives in /boot/grub2/ directory with openSUSE (and UEFI-GPT is different again), so the 'grub-mkconfig' command gets run like this
    Code:
    grub-mkconfig -o /boot/grub2/grub.cfg
    Last edited by deano_ferrari; 28-Dec-2013 at 19:14.

  8. #8
    Join Date
    Sep 2012
    Posts
    7,106

    Default Re: Adding an Entry to the oSUSE BootLoader

    Quote Originally Posted by deano_ferrari View Post
    It tells to use hardcoded drive names (hdX,Y) which is in general wrong with grub2. What you should really do in almost all cases is to search for drive name at runtime using file name or filesystem UUID. Like
    Code:
    bor@opensuse:~/src/grub> sudo /usr/sbin/grub2-probe -t fs_uuid /boot/vmlinuz
    root's password:
    427a8168-dbd2-430d-9d3b-adbdf5189015
    bor@opensuse:~/src/grub> sudo /usr/bin/grub2-mkrelpath  /boot/vmlinuz
    /vmlinuz-3.11.6-4-desktop
    and then put in grub.cfg
    Code:
    search --fs-uuid --set 427a8168-dbd2-430d-9d3b-adbdf5189015
    linux /vmlinuz-3.11.6-4-desktop
    Which is exactly what grub2 does when you run grub-mkconfig. If filesystem does not offer UUID, it can also generate one and create file with unique name which serves as label to identify this filesystem.

  9. #9
    jmartini NNTP User

    Default Re: Adding an Entry to the oSUSE BootLoader

    On 29/12/13 12:47, Carlos E. R. wrote:
    > On 2013-12-29 02:06, d hinds wrote:
    >
    >> Thanks anyway. What I need to know then, is how do I edit the grub.cfg
    >> file found in Computer > boot > grub2?

    >
    > It is /boot/grub2/grub.cfg. There is no point in editing it directly
    > (although it is a text file, not binary), because it is automatically
    > generated from others. You can edit it, of course, but it will not
    > survive long.
    >
    >
    >> (I am trying to maintain openSUSE as the default boot choice, and take a
    >> look at another distro, that way. If I install the other distro with
    >> it's boot manager, that would change the menu and openSUSE would no
    >> longer be at the top, with it's openSUSE graphics).

    >
    > You probably edit these:
    >
    > /etc/grub.d/40_custom
    > /etc/grub.d/41_custom


    Though I am only an ordinary user who is neither an IT or software
    professional, as many of the regular helpers and mods on these forums
    are, I have just recently installed openSUSE 13.1 (XFCE) in a triple
    boot mode (with Win XP & openSUSE 11.4 Gnome on other partitions on same
    hdd) with grub2 to MBR and was easily able to modify the default boot
    order (which, IMHO, is also very good as is because it defaults to the
    last booted selection) by reading the following info:
    10.2.2 The File /etc/default/grub #
    http://activedoc.opensuse.org/book/o...t-loader-grub2

    and manually editing '/etc/default/grub' file as follows:

    Original - GRUB_DEFAULT=saved
    Modified - GRUB_DEFAULT=3

    Added - 'GRUB_SAVEDEFAULT=false' (this entry was not there in the
    original file as it was not needed by the default settings).

    -----------
    # Modified by YaST2. ......2013
    # THIS FILE WILL BE PARTIALLY OVERWRITTEN by perl-Bootloader
    # For the new kernel it try to figure out old parameters. In case we are
    not able to recognize it (e.g. change of flavor or strange install order
    ) it it use as fallback installation parameters from
    /etc/sysconfig/bootloader

    # If you change this file, run 'grub2-mkconfig -o /boot/grub2/grub.cfg'
    afterwards to update
    # /boot/grub2/grub.cfg.
    GRUB_DISTRIBUTOR="openSUSE 13.1"
    GRUB_DEFAULT=3
    GRUB_SAVEDEFAULT=false

    [....]

    Secondly, I was also able to boot from an old floppy grub bootdisk (I
    use ext3 on my linux partitions and I have no idea if it will work with
    ext4...I remember inode 128 BD would not boot an ext3 inode 256
    formatted partition) using a usb floppy dive by using the the default
    menu.lst entry below (which can be made even shorter by using
    "/dev/sda10" (dev by device) option instead of '/dev/disk/by-id/..').

    title openSUSE 13.1 (Default Kernel)
    root (hd0,9)
    kernel /boot/vmlinuz root=/dev/disk/by-id/xxxx-part10
    resume=/dev/disk/by-id/xxx-part1 splash=silent quiet showopts vga=0x317
    initrd /boot/initrd

    Cheers

  10. #10
    Join Date
    Sep 2012
    Posts
    7,106

    Default Re: Adding an Entry to the oSUSE BootLoader

    Quote Originally Posted by jmartini View Post
    grub2 ... defaults to the
    last booted selection
    It should not do it unless you explicitly told it to do it. If you are absolutely sure grub2 in openSUSE suddenly defaults to last booted menu entry - it is a bug.

    Original - GRUB_DEFAULT=saved
    Modified - GRUB_DEFAULT=3
    For the benefit of future readers ... GRUB_DEFAULT refers to entries in grub.cfg. grub.cfg is re-generated dynamically every time you e.g. install/remove kernel. Which means that absolute numbers may well be off next time.

    If grub-mkconfig is used, it tries to generate unique identifiers (similar to UUID) for each menu entry. Algorithm tries to ensure that the same IDs will be generated every time for the same kernel name on the same partition. This looks like
    Code:
    menuentry 'openSUSE 13.1' --class 'opensuse-13-1' --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-bf08b064-2753-45b5-9af1-4fab01c9cca5' {
    Those menu entries should preferably be used in GRUB_DEFAULT instead of hardcoded numbers. Alternatively you could use menu entry titles (like "openSUSE 13.1" above) but they are not guaranteed to be unique.

    If you create custom entries, it is highly recommended to come up with some scheme for unique IDs.

    And if you want to refer to entry in submenu, you need to put full "path" to this entry. E.g. in the case of
    Code:
    submenu 'Advanced options for openSUSE 13.1' $menuentry_id_option 'gnulinux-advanced-bf08b064-2753-45b5-9af1-4fab01c9cca5' {
            menuentry 'openSUSE 13.1, with Linux 3.11.6-4-desktop' --class 'opensuse-13-1' --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.11.6-4-desktop-advanced-bf08b064-2753-45b5-9af1-4fab01c9cca5' {
    full path to menu entry would be
    Code:
    GRUB_DEFAULT="gnulinux-advanced-bf08b064-2753-45b5-9af1-4fab01c9cca5>gnulinux-3.11.6-4-desktop-advanced-bf08b064-2753-45b5-9af1-4fab01c9cca5"
    i.e. IDs separated by ">" character. Of course you can also use numbers here (like "2>1") with the same caveats that numbers are not stable.

    Oh, and you can also continue to use GRUB_DEFAULT=saved and set default using "grub2-set-defaul <menuentry>" (where menuentry follows the same syntax). This makes re-creating of grub.cfg unnecessary.

    Added - 'GRUB_SAVEDEFAULT=false' (this entry was not there in the
    original file as it was not needed by the default settings).
    This is default anyway, it should not be needed.

Page 1 of 3 123 LastLast

Posting Permissions

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