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

Thread: Ancient HDDs leading to an absolute mess of MBR chaos

  1. #1

    Default Ancient HDDs leading to an absolute mess of MBR chaos

    Hi everyone,

    I hope this is the right place to ask for generic (not OpenSUSE-specific) Linux support - the description made it seem like the best home for my issue.

    I recently installed OpenSUSE on my second SSD and I'm loving it. Recently, Linux became my main OS and I feel very little reason to go back to Windows.

    That said, I do have a Windows install in my machine, as well as a few HDDs that used to be the boot HDDs from my old machines that I liberated and use mostly for storage.

    My setup looks something like this:
    /dev/sda: Windows SSD (broken after a Windows update a couple of months ago - when I select it in the BIOS boot menu, I get an error about the operating system no longer being installed. All the files are still there though and I can browse them normally)
    /dev/sdb: OpenSUSE SSD that I want to boot to first so I can select an OS through GRUB
    /dev/sdc: Storage HDD (SATA)
    /dev/sdd: Storage HDD (SATA)
    /dev/sde: Storage HDD (SATA)
    /dev/sdf: Storage HDD (External USB)

    My goal here is to get my machine to automatically boot to the GRUB installed on /dev/sdb.

    My motherboard is an MSI Z97 PC Mate. If I set UEFI booting, then my computer appears to boot to an old version of GRUB which then tells me I don't have any operating systems. I get the same if I set UEFI/Legacy boot and just leave it to boot automatically. The only way I can get to Tumbleweed is by opening the boot menu (F11) and selecting the SSD corresponding to dev/sdb, which then takes me to the familiar OpenSUSE GRUB menu. From there, I can select Tumbleweed which works just fine, or I can pick the "Windows install" option, which takes me to a non-GRUB black screen that tells me that I don't have an operating system installed.

    To help diagnose what's going on, I ran arvidjaar's bootinfoscript (https://github.com/arvidjaar/bootinfoscript), and I've put the results on pastebin at https://pastebin.com/2sddYMiT.

    As you can see, it looks like I have 6 MBRs (!?), and a possible reason why Windows isn't booting is because of some GPT corruption on /dev/sda. This is clearly a complete mess, and I'd like to find a way to clear all this up and "start again", but WITHOUT losing any data on the storage HDDs (or losing access to them). I've read about some dd commands online to manually delete the first few sectors that correspond to the MBR, but I'm nervous about messing that up and bricking my storage drives.

    Summary of my aims:
    1. Boot to the Linux install (/dev/sdb) automatically after power on
    2. Restore access to the Windows install on /dev/sda
    3. Remove the old, defunct, and useless GRUB install on /dev/sdd
    4. Remove the old, defunct, and useless MBRs on /dev/sdc, /dev/sde, and /dev/sdf as these HDDs no longer have an operating system on them


    Any advice you folks can give about the best way of going about all this would be greatly appreciated. Boot problems are usually the kind of thing I ignore, but it's getting tedious having to manually select the right drive to boot to every time I turn my computer on.

    Thanks a lot!

    Blasky

  2. #2

    Default Re: Ancient HDDs leading to an absolute mess of MBR chaos

    I don't blame anyone for not wanting to take this challenge on, but just wanted to let you know that any advice or suggestions are still greatly appreciated!

    Many thanks!

    Matty

  3. #3
    Join Date
    Aug 2010
    Location
    Chicago suburbs
    Posts
    15,668
    Blog Entries
    3

    Default Re: Ancient HDDs leading to an absolute mess of MBR chaos

    Quote Originally Posted by blaskatron View Post
    I don't blame anyone for not wanting to take this challenge on, but just wanted to let you know that any advice or suggestions are still greatly appreciated!
    It is a mess. I was hoping that somebody more familiar with bootinfo would take this on.

    From what I can see:

    Windows is installed for UEFI booting. Whether that still works, I cannot tell. But you would need to use UEFI booting to test that.

    You have, at some time, had Ubuntu installed for UEFI booting.

    Your Tumbleweed is installed only for legacy booting, not for UEFI booting.

    If this were my computer, the first thing I would want to do is somehow boot it with UEFI. To do that, I would probably use the Tumbleweed live Rescue CD, written to a USB device -- or maybe the live KDE CD if you prefer that.

    If I were able to get that booted, then I would look for the output of:
    Code:
    efibootmgr -v
    which would tell me something about the status of the UEFI setup.

    I would wait until I had seen what happened with those steps before deciding how to further proceed.
    openSUSE Leap 15.3; KDE Plasma 5.18.6;

  4. #4
    Join Date
    Sep 2012
    Posts
    7,093

    Default Re: Ancient HDDs leading to an absolute mess of MBR chaos

    Quote Originally Posted by blaskatron View Post
    My goal here is to get my machine to automatically boot to the GRUB installed on /dev/sdb.
    In legacy BIOS or EFI mode?
    Restore access to the Windows install on /dev/sda
    What exactly "restore access" means?
    Remove the old, defunct, and useless GRUB install on /dev/sdd
    Remove the old, defunct, and useless MBRs on /dev/sdc, /dev/sde, and /dev/sdf as these HDDs no longer have an operating system on them
    What for? They do not harm anyone. If you insist you can simply overwrite first 440 bytes with zeroes but I do not see what is it supposed to achieve.

  5. #5

    Default Re: Ancient HDDs leading to an absolute mess of MBR chaos

    Hi guys,

    Thanks for your responses! Sorry for my late reply, I've been out of town for a few days, but I appreciate you chiming in and trying to help out.

    In response to arvidjaar's reply:

    Quote Originally Posted by arvidjaar View Post
    In legacy BIOS or EFI mode?
    Honestly either. UEFI would be preferred, I guess, but currently my only boot option when I have UEFI enabled is to an old version of GRUB 2.3 linked to a no-longer existing Ubuntu installation. It takes me straight to the GRUB shell with no other booting options. To get to OpenSUSE, I need to have Legacy+EFI enabled in the BIOS, and then select dev/sdb - there is no other way to boot.

    Quote Originally Posted by arvidjaar View Post
    What exactly "restore access" means?
    Since a Windows update 2 or so months ago, selecting dev/sda from the boot menu takes me to a black screen that says I do not have any operating systems installed (I recognise the screen from previous, unrelated Windows boot issues). I can mount the drive in Tumbleweed, but it just reads it as a "Basic Data Partition", which makes me think that the MBR or the GPT has gotten corrupted somehow.

    Quote Originally Posted by arvidjaar View Post
    What for? They do not harm anyone. If you insist you can simply overwrite first 440 bytes with zeroes but I do not see what is it supposed to achieve.
    I was under the impression that this is the root of my problems - multiple MBRs that the motherboard keeps trying to boot from, which is why I have to manually select everything to get where I want to to be (which is clearly `wrong'). If this isn't the issue, then fine. I'm not interested in saving 440 bytes of storage space or anything, I just figured it was connected to my issues.

    @nrickert:

    Quote Originally Posted by nrickert View Post
    Windows is installed for UEFI booting. Whether that still works, I cannot tell. But you would need to use UEFI booting to test that.
    I have hinted at this in my response to arvidjaar, but with UEFI booting I have no option to pick my Windows drive, and it automatically boots to the old Ubuntu GRUB (no idea which drive that's actually stored on), which takes me straight to a GRUB shell that I cannot seem to do anything useful from. In order for my OpenSUSE drive to even be an option, I have to have Legacy+UEFI enabled on my mobo.

    Quote Originally Posted by nrickert View Post
    You have, at some time, had Ubuntu installed for UEFI booting.
    This is also correct. I've had various instantiations of Ubuntu installed over the years. Most recently I had Xubuntu installed right before I switched over to OpenSUSE, but that was on the same drive, and I got the drive wiped completely when I installed Tumbleweed. I therefore suspect that the "Ubuntu" GRUB that UEFI booting keeps taking me to is located on one of the storage hard drives, but not sure how to confirm this.

    Quote Originally Posted by nrickert View Post
    Your Tumbleweed is installed only for legacy booting, not for UEFI booting.
    That would make sense, and explain why there is only one UEFI boot option when I disable legacy on my mobo. Is there some way to change this without reinstalling the OS, or do I have to wipe it and start again?

    Quote Originally Posted by nrickert View Post
    If this were my computer, the first thing I would want to do is somehow boot it with UEFI.
    I'm at work right now, but I'll dig out my live environment and run
    Code:
    efibootmgr -v
    tonight, see what the output is and post it here.

    Thanks a lot for your suggestions and help guys!

  6. #6
    Join Date
    Aug 2010
    Location
    Chicago suburbs
    Posts
    15,668
    Blog Entries
    3

    Default Re: Ancient HDDs leading to an absolute mess of MBR chaos

    Quote Originally Posted by blaskatron View Post
    Is there some way to change this without reinstalling the OS, or do I have to wipe it and start again?
    Yes, you can change to UEFI booting without having to reinstall. But to do that, you have to be booted in UEFI mode.

    If you can boot the Tumbleweed install media in UEFI mode, or a Tumbleweed live image in UEFI mode, then you can use that to reinstall booting.

    If you can experiment and make sure that you are able to boot either the installer (or installer rescue system) or live Tumbleweed in UEFI mode, then ask here for details on how to use that to fix the booting for your already installed system.
    openSUSE Leap 15.3; KDE Plasma 5.18.6;

  7. #7
    Join Date
    Sep 2012
    Posts
    7,093

    Default Re: Ancient HDDs leading to an absolute mess of MBR chaos

    Quote Originally Posted by blaskatron View Post
    Since a Windows update 2 or so months ago, selecting dev/sda from the boot menu
    Which boot menu? BIOS boot menu? I doubt it calls it "/dev/sda", you really need to be very exact about what you see or do. I suspect you attempt to boot EFI Windows installation in legacy BIOS mode, which probably is not going to work, at least right away.
    I can mount the drive in Tumbleweed, but it just reads
    What is "it" here? What "just reads" means? Really, it is impossible to suggest anything constructive without having at least some understanding what's going on and your description provides zero information. Just copying command and its output would be much more useful.
    with UEFI booting ... it automatically boots to the old Ubuntu GRUB (no idea which drive that's actually stored on)
    The boot menu item is stored in BIOS setup (you may be able to actually see it there, but it really depends on vendor) and it likely points to file on /dev/sda2 as this is the only ESP on your disks. There should be directory \EFI\ubuntu there, exact content of this directory may vary.

    Is there some way to change this without reinstalling the OS
    You may be able to do it in BIOS setup, you may be able to do it using efibootmgr. Of course it will only change firmware boot selection. Whether your Windows is still bootable I cannot say.

    I'll dig out my live environment and run
    Code:
    efibootmgr -v
    Yes, that would be good start.

  8. #8

    Default Re: Ancient HDDs leading to an absolute mess of MBR chaos

    Quote Originally Posted by nrickert View Post
    Yes, you can change to UEFI booting without having to reinstall. But to do that, you have to be booted in UEFI mode.

    If you can boot the Tumbleweed install media in UEFI mode, or a Tumbleweed live image in UEFI mode, then you can use that to reinstall booting.

    If you can experiment and make sure that you are able to boot either the installer (or installer rescue system) or live Tumbleweed in UEFI mode, then ask here for details on how to use that to fix the booting for your already installed system.
    Thank you for your response.

    I am having some problems booting from my Tumbleweed install media flash drive. I have set my mobo to "UEFI" boot mode only (no legacy), and selected my USB flash drive from the boot menu. This has taken me to the familiar OpenSUSE boot menu. The "Boot from Hard Disk" option results in a black command line opening in the middle saying:
    "error: no such device: /efi/boot/fallback.efi.
    Press any key to continue...".

    The other options in the menu are "Upgrade", "Install" and "More...". Under "More...", both "Rescue System" and "Boot Linux System" take me to the same place. A black command line opens in the middle saying:
    "Loading kernel ...
    Loading initial ramdisk ..."

    After a couple of seconds, two additional lines appear at the bottom of the screen (no longer in the middle command line) saying:
    "exit_boot() failed!
    efi_main() failed!".

    The computer then sits there until I reboot it.

    In my messing around here, the boot behaviour of my computer has changed a little. I am not sure why. Below I give a full description of what happens with the various options in my boot menu.

    --==UEFI Boot Mode Only: ==--

    • ubuntu (P0: Samsung SSD 840 Evo 120G)
    • UEFI: Built-in EFI Shell
    • Enter Setup


    Option: ubuntu (P0: Samsung SSD 840 Evo 120G)
    Result: There are a few messages that pop up at the bottom that look like errors but they disappear too quickly to read. Then I am met with:
    "GNU GRUB version 2.02~beta2-36ubuntu3.17

    Minimal BASH-like line editing is supported. For the first word, TAB lists possible command completions. Anywhere else TAB lists possible device or file completions.

    grub> _"

    I believe this is the old UEFI Ubuntu install that nrickert noticed.

    --==LEGACY+UEFI: ==--
    • ubuntu (P0: Samsung SSD 840 EVO 120GB)
    • Hitachi HCS5C1010CLA382
    • SATA1:Samsung SSD 840 EVO 120G
    • SATA2:Samsung SSD 850 EVO 250G
    • SATA3:SAMSUNG HD501LJ
    • SATA5:ST3500641AS
    • SATA6:Hitachi HDP725050GLA360
    • SATA4:TSSTcorp CDDVDW SH-224DB
    • UEFI: Built-in EFI Shell

    Enter Setup

    Choices:
    1) ubuntu (P0: Samsung SSD 840 EVO 120GB)
    GRUB 2.02 as before
    2) Hitachi HCS5C1010CLA382
    Takes me to my normal openSUSE Tumbleweed GRUB menu. I can boot my Tumbleweed OS here as normal by selecting "openSUSE Tumbleweed". I also have an option in GRUB for "Windows 10 (on /dev/sdc1)". Selecting that takes me to a Windows blue screen entitled "Recovery", with the text "Your PC/Device needs to be repaired // A required device isn't connected or can't be accessed // Error code: 0xc000000e".
    3) SATA1:Samsung SSD 840 EVO 120G
    As 2) described above
    4) SATA2:Samsung SSD 850 EVO 250G
    As 2) described above
    5) SATA3:SAMSUNG HD501LJ
    Same Windows blue screen as observed when picking "Windows 10 (on /dev/sdc1)" as described in 2) above
    6) SATA5:ST3500641AS
    "GRUB Loading" briefly flashes up before going to a black screen and then the computer resets.
    7) SATA6:Hitachi HDP725050GLA360
    A black screen appears with the text: "BOOTMGR is missing // Press Ctrl+Alt+Del to restart". However, pressing Ctrl-Alt-Del doesn't do anything and I have to hit the reset button on the front of my machine to proceed.
    8) SATA4:TSSTcorp CDDVDW SH-224DB
    As 2) described above

    I'm not sure what happened to change this behaviour from what I mentioned earlier - all I have done is toggle UEFI and LEGACY+UEFI a couple of times and try to boot from my Tumbleweed USB in UEFI mode.



    Quote Originally Posted by arvidjaar View Post
    <snip>
    Thank you for your response. I respectfully ask for your patience.

    My complete transcript of boot options above should elucidate the issues with my previous description. Additionally, I apologise for my ambiguity concerning "it just reads" before. To be explicit - when I boot into Tumbleweed and open Dolphin, on the left under "Devices", I see the labels of all the drives in my computer listed. I recognise "Files (G)", "Samsung (F)" and "Seagate (D)" as sde, sdc, and sdd respectively. Continuing with the "Devices" section: "185.1 GiB Hard Drive" is my home partition on the drive that Tumbleweed is installed on (sdb), and "40.0 GiB Hard Drive" is the root partition on the same drive. You will notice that all drives are accounted for except sda, which is listed as "Basic data partition" under "Devices" in "Dolphin".

    It sounds like the next step is working out why I can't UEFI boot from my Tumbleweed USB. Do you guys have any suggestions why that might be?

    Many thanks.

  9. #9
    Join Date
    Aug 2010
    Location
    Chicago suburbs
    Posts
    15,668
    Blog Entries
    3

    Default Re: Ancient HDDs leading to an absolute mess of MBR chaos

    Quote Originally Posted by blaskatron View Post
    The "Boot from Hard Disk" option results in a black command line opening in the middle saying:
    "error: no such device: /efi/boot/fallback.efi.
    Press any key to continue...".
    "Boot from Hard Disk" won't work in this situation. It's a hack that assumes you already have UEFI booting installed for openSUSE.

    The other options in the menu are "Upgrade", "Install" and "More...". Under "More...", both "Rescue System" and "Boot Linux System" take me to the same place. A black command line opens in the middle saying:
    "Loading kernel ...
    Loading initial ramdisk ..."
    The should not take you to the same place. And "Rescue System" is what you should use.

    It should take you to a command line prompt for language, and then to a login prompt. At the login prompt, you should be able to login as root.

    "Boot Linux System" -- I have not tried that recently. I think it is supposed to use "kexec" to load the kernel of your installed system.

    Try again to get into the rescue system. And if you can do that, I can tell you how to continue to setup UEFI booting for openSUSE.
    openSUSE Leap 15.3; KDE Plasma 5.18.6;

  10. #10

    Default Re: Ancient HDDs leading to an absolute mess of MBR chaos

    Quote Originally Posted by nrickert View Post
    "Boot from Hard Disk" won't work in this situation. It's a hack that assumes you already have UEFI booting installed for openSUSE.


    The should not take you to the same place. And "Rescue System" is what you should use.

    It should take you to a command line prompt for language, and then to a login prompt. At the login prompt, you should be able to login as root.

    "Boot Linux System" -- I have not tried that recently. I think it is supposed to use "kexec" to load the kernel of your installed system.

    Try again to get into the rescue system. And if you can do that, I can tell you how to continue to setup UEFI booting for openSUSE.
    Thanks for clarifying.

    When selecting both "Boot Linux System" and "Rescue System", I get the same messages about loading the kernel and initial ramdisk before the additional two lines pop up "exit_boot() failed!" and "efi_main() failed!" and then the system hangs. If instead of making these selections I hit "C", I get to a GRUB command line, but I suspect that is not what you are talking about?

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
  •