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

Thread: OpenSUSE 12.2 RC 2 Grub 2 removal of dangerous boot entries?

  1. #1

    Default OpenSUSE 12.2 RC 2 Grub 2 removal of dangerous boot entries?

    Hi,

    Grub 2 seems to be the default boot loader in OpenSUSE 12.2. The set up process scans all partitions and adds entries for all partitions that contain a working OS. Sounds nice? Not so nice if one has a multi boot machine with a Windows recovery partition like my HP laptop. These laptops come with four primary partitions all occupied by Windows. One of these is a recovery partition which can be used to reinstall Windows. It is not visible in Windows and it should not be used unless needed for recovery purposes.

    I installed OpenSUSE by sacrificing one of the primary partitions. I turned it into an extended partition, readjusted partition sizes and recreated the original primary partition at the end of the extended partition. After installation of OpenSUSE my laptop boots from the extended partition, which is marked active in the partition table. Works fine until someone boots Windows recovery partition. In this case the boot process automatically marks the Windows boot partition active. This in effect hides the OpenSUSE installation. I have to boot the laptop from a USB stick or similar and put the active flag back to the extended partition. I might be careful enough not to boot from the recovery partition. Unfortunately experience show that other family members are not and they occasionally borrow the laptop.

    So I am trying to find a sustainable way to remove the dangerous entry. I could edit the grub.cfg file, but it gets overwritten. I could also tamper with the scripts in grub.d but that does not sound a good idea either. And before anybody suggest using YAST, take note that it does not allow removing automatically discovered entries.

    Any good suggestions? Am I missing something?

  2. #2
    Join Date
    Mar 2010
    Location
    Austin - Texas
    Posts
    10,140
    Blog Entries
    48

    Smile Re: OpenSUSE 12.2 RC 2 Grub 2 removal of dangerous boot entries?

    Quote Originally Posted by GirlGeek View Post
    Hi,

    Grub 2 seems to be the default boot loader in OpenSUSE 12.2. The set up process scans all partitions and adds entries for all partitions that contain a working OS. Sounds nice? Not so nice if one has a multi boot machine with a Windows recovery partition like my HP laptop. These laptops come with four primary partitions all occupied by Windows. One of these is a recovery partition which can be used to reinstall Windows. It is not visible in Windows and it should not be used unless needed for recovery purposes.

    I installed OpenSUSE by sacrificing one of the primary partitions. I turned it into an extended partition, readjusted partition sizes and recreated the original primary partition at the end of the extended partition. After installation of OpenSUSE my laptop boots from the extended partition, which is marked active in the partition table. Works fine until someone boots Windows recovery partition. In this case the boot process automatically marks the Windows boot partition active. This in effect hides the OpenSUSE installation. I have to boot the laptop from a USB stick or similar and put the active flag back to the extended partition. I might be careful enough not to boot from the recovery partition. Unfortunately experience show that other family members are not and they occasionally borrow the laptop.

    So I am trying to find a sustainable way to remove the dangerous entry. I could edit the grub.cfg file, but it gets overwritten. I could also tamper with the scripts in grub.d but that does not sound a good idea either. And before anybody suggest using YAST, take note that it does not allow removing automatically discovered entries.

    Any good suggestions? Am I missing something?
    So, I don't know of but two ways to do this. One is to remove the entry manually from the grub.cfg file, or to modify the '/etc/grub.d/30_os-prober' file as root and as suggested in the following forum post (see #10):

    grub2: Skipping one partition from OS detection

    If you need help in changing these files for openSUSE 12.2 using grub2, have a look at this blog I have on the subject:

    GNU Grub2 Command Help/Config Editor - Version: 1.75 - Blogs - openSUSE Forums

    Thank You,
    My Blog: https://forums.opensuse.org/blogs/jdmcdaniel3/

    Software efficiency halves every 18 months, thus compensating for Moore's Law

    Its James again from Austin, Texas

  3. #3

    Default Re: OpenSUSE 12.2 RC 2 Grub 2 removal of dangerous boot entries?

    So here is what I ended up in doing:

    1. Removed the executable bit from /etc/grub.d/30_os-prober. This prevents the auto detection of Windows rescue partitions.

    3. Added an entry into the /etc/grub.d/40_custom file. This allows booting the Windows partition. In my case the added lines look like this (/dev/sda1):

    menuentry "Windows 7" {
    set root='(hd0,1)'
    chainloader (hd0,1)+1
    }


    Grub2 uses new numbering for partitions but not for drives. Therefore (hd0,1) = /dev/sda1.

    3. Run "grub2-mkconfig -o /boot/grub2/grub.cfg" to make the changes to take effect.

    Please read /usr/share/doc/packages/grub2/README.OpenSUSE. OpenSUSE uses specific naming for some grub2 files.

    This was the most orthodox way I could find. Grub2 implementation in OpenSUSE looks somewhat experimental still.

  4. #4
    Join Date
    Jun 2008
    Location
    Netherlands
    Posts
    25,384

    Default Re: OpenSUSE 12.2 RC 2 Grub 2 removal of dangerous boot entries?

    What bothers me (not having used Grub2 nor 12.2 (r more days), is that you can say that you can not configure this through YaST.
    When I interprete the above correctly, that is an omission and you remark "Grub2 implementation in OpenSUSE looks somewhat experimental still." looks a bit like an understatement then.

    Is this something to file as a feature whish, or maybe even as a bug?
    Henk van Velden

  5. #5
    Join Date
    Mar 2010
    Location
    Austin - Texas
    Posts
    10,140
    Blog Entries
    48

    Smile Re: OpenSUSE 12.2 RC 2 Grub 2 removal of dangerous boot entries?

    Quote Originally Posted by hcvv View Post
    What bothers me (not having used Grub2 nor 12.2 (r more days), is that you can say that you can not configure this through YaST.
    When I interprete the above correctly, that is an omission and you remark "Grub2 implementation in OpenSUSE looks somewhat experimental still." looks a bit like an understatement then.

    Is this something to file as a feature whish, or maybe even as a bug?
    The ability to skip over an unwanted Partition when the '/etc/grub.d/30_os-prober' file is run seems like a feature we should request. You would do this to prevent a recovery or other Windows like partition from becoming a OS boot selection in grub 2 and it is something I would add to the /etc/default/grub file as a setting to be acted on by the os-prober bash script when it is run I think.

    Thank You,
    My Blog: https://forums.opensuse.org/blogs/jdmcdaniel3/

    Software efficiency halves every 18 months, thus compensating for Moore's Law

    Its James again from Austin, Texas

  6. #6

    Default Re: OpenSUSE 12.2 RC 2 Grub 2 removal of dangerous boot entries?

    Quote Originally Posted by hcvv View Post
    What bothers me (not having used Grub2 nor 12.2 (r more days), is that you can say that you can not configure this through YaST.
    When I interprete the above correctly, that is an omission and you remark "Grub2 implementation in OpenSUSE looks somewhat experimental still." looks a bit like an understatement then.

    Is this something to file as a feature whish, or maybe even as a bug?
    Sorry for not being clear enough. Everything I wrote is based on OpenSUSE 12.2. RC2. Grub2 was installed by default even when I updated from12.1. YAST still offers the choice of the bootloader to use. One can choose grub2, grub legacy or lilo and even have EFI bios support.

    In the previous version of grub boot options where configured in the menu.lst file. YAST allowed editing entries in the file. In grup2 grub.cfg file should not be edited directly since it will be overwritten.
    .
    In principal automatic detection of additional OSs is a good thing. I think you can't call YAST's behaviour as a bug. Maybe one could miss additional features like a possibility to choose, which automatically detected entries to include in the menu or maybe automatic omission of Windows recovery partitions. Since I am not sure what to wish I don't think I am going to file a wish.


    The README.OpenSUSE file should be updated to reflect the fact that grub2 is now the default bootloader. Maybe it would also be in order to use the standard naming conventions for grub2 and to use something like grup1 for legacy grub. I leave this for others to judge.

  7. #7

    Default Re: OpenSUSE 12.2 RC 2 Grub 2 removal of dangerous boot entries?

    Quote Originally Posted by jdmcdaniel3 View Post
    The ability to skip over an unwanted Partition when the '/etc/grub.d/30_os-prober' file is run seems like a feature we should request. You would do this to prevent a recovery or other Windows like partition from becoming a OS boot selection in grub 2 and it is something I would add to the /etc/default/grub file as a setting to be acted on by the os-prober bash script when it is run I think.

    Thank You,
    woth
    Well personally I would allow a YAST user to choose whether to include the the automatic entries in the menu. If the user chose not to include them all, I would allow him or her to pick and chose those entries to include. I would most likely implement this by first running the detection script in order to find out possible choices. I then would turn off the executable bit for the detection script and put the selected entries into an other script. Of course it would be nice to be able to add own entries in YAST as well. But for the time being I can survive with the more manual procedure.

  8. #8

    Default Re: OpenSUSE 12.2 RC 2 Grub 2 removal of dangerous boot entries?

    Quote Originally Posted by GirlGeek View Post
    So here is what I ended up in doing:

    1. Removed the executable bit from /etc/grub.d/30_os-prober. This prevents the auto detection of Windows rescue partitions.
    ---
    This was the most orthodox way I could find. Grub2 implementation in OpenSUSE looks somewhat experimental still.
    Update

    There is an parameter GRUB_DISABLE_OS_PROBER which can be used to disable auto detection.

  9. #9
    Join Date
    Jun 2008
    Location
    Netherlands
    Posts
    25,384

    Default Re: OpenSUSE 12.2 RC 2 Grub 2 removal of dangerous boot entries?

    Quote Originally Posted by GirlGeek View Post
    Update

    There is an parameter GRUB_DISABLE_OS_PROBER which can be used to disable auto detection.
    Hurray, good searching!

    Interesting thread. This makes us aware of how t to handle the coming Grub2. IMHO it is not alone about "dangerous" boot entries. As System Manager you want to be able to have your boot menu as you want it. I have e.g. either a new openSUSE level for test, or still the older version (fall back during the first days, but left there until the space is used for the testing of the new one in the cycle). And I might want to make it invisible for my users.

    And as YaST is the system mangement tool of openSUSE, it "should" (but who am I) cater for the posibilities to handle at least things that we had. Editing the /etc/grub.d files directly is of course possible, but when you propagate that, then you can dismiss YaST at all.
    Henk van Velden

  10. #10
    Join Date
    Aug 2010
    Location
    Chicago suburbs
    Posts
    12,882
    Blog Entries
    3

    Default Re: OpenSUSE 12.2 RC 2 Grub 2 removal of dangerous boot entries?

    Quote Originally Posted by GirlGeek View Post
    One of these is a recovery partition which can be used to reinstall Windows. It is not visible in Windows and it should not be used unless needed for recovery purposes.

    Am I missing something?
    Perhaps, though you did not say which version of Windows you are using.

    I have tried booting that Windows recovery partition (for Windows 7). It boots windows just fine. When I boot windows that way
    I see exactly the same Windows as if I boot from the primary Windows partition. The recovery partition is still not visible in Windows, even though I booted from it.

    It is my understanding that the recovery partition is there, in part, to allow having the main Windows drive encrypted with the Windows BitLocker software.

    In opensuse, I use an encrypted LVM. Booting is done via a separate "/boot" which is not encrypted. The windows arrangement with the recovery partition is similar. The recovery partition is not encrypted, so can be used for booting an encrypted windows partition. The boot code in the recovery partition can setup the crypto drivers, to allow access to the main partition.

    I think, to boot in recovery mode, you have to hit F8 early in the boot (or something similar). You can't get there by just booting the recovery partition.

    As far as I know, the use of the recovery partition in Vista is similar.
    openSUSE Leap 15.1; KDE Plasma 5;
    testing Leap 15.2Alpha

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
  •