Need helping fixing/reinstalling grub

I broke grub before trying to “convert” my install to UEFI (here: https://forums.opensuse.org/english/get-technical-help-here/install-boot-login/482429-opensuse-12-2-windows-8-uefi-dual-boot-grub2.html)
I installed Windows 8 and have used it in the meantime and decided to wait for 12.3 to be released so I could just install 12.3 and fix my problem. Well, I installed (upgraded) 12.3 successfully, but it did not fix the problem.
I’m trying to use this guide to reinstall grub from the 64bit install disc: https://forums.opensuse.org/content/128-re-install-grub2-dvd-rescue.html
However, I have /boot on a separate partition, if memory serves me and need some help because I get to the point of running grub to generate a config file, but it doesn’t work. I would think this is because I don’t have /boot mounted. I tried mounting it, (sdb1 I think) but I got this output: "mount.bin: error: unknown filesystem ‘(null)’

Here is my disk layout from fdisk & parted:

Disk /dev/sda: 3000.6 GB, 3000592982016 bytes
256 heads, 63 sectors/track, 363376 cylinders, total 5860533168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x00000000

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1               1  4294967295  2147483647+  ee  GPT
Partition 1 does not start on physical sector boundary.

Disk /dev/sdb: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders, total 1953525168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x000837c8

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1   *        2048  1953523711   976760832    f  W95 Ext'd (LBA)
/dev/sdb5            4096      321535      158720   83  Linux
/dev/sdb6          323584     4530175     2103296   82  Linux swap / Solaris
/dev/sdb7         4532224    88422399    41945088   83  Linux
/dev/sdb8        88424448  1953503231   932539392   83  Linux

Disk /dev/sdc: 3000.6 GB, 3000592982016 bytes
1 heads, 2 sectors/track, -1364700712 cylinders, total 5860533168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x9beb41de

   Device Boot      Start         End      Blocks   Id  System
/dev/sdc1               1           1           0+  ee  GPT
Model: ATA ST3000DM001-1CH1 (scsi)
Disk /dev/sda: 3001GB
Sector size (logical/physical): 512B/4096B
Partition Table: gpt

Number  Start   End     Size    File system  Name                          Flags
 1      1049kB  316MB   315MB   ntfs         Basic data partition          hidden, diag
 2      316MB   419MB   104MB   fat32        EFI system partition          boot
 3      419MB   554MB   134MB                Microsoft reserved partition  msftres
 4      554MB   3001GB  3000GB  ntfs         Basic data partition

Model: ATA WDC WD10EZEX-00R (scsi)
Disk /dev/sdb: 1000GB
Sector size (logical/physical): 512B/4096B
Partition Table: msdos

Number  Start   End     Size    Type      File system     Flags
 1      1049kB  1000GB  1000GB  extended                  boot, lba, type=0f
 5      2097kB  165MB   163MB   logical   ext4            type=83
 6      166MB   2319MB  2154MB  logical   linux-swap(v1)  type=82
 7      2320MB  45.3GB  43.0GB  logical                   type=83
 8      45.3GB  1000GB  955GB   logical                   type=83

Model: ATA Hitachi HDS72303 (scsi)
Disk /dev/sdc: 3001GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt_sync_mbr

Number  Start   End     Size    File system  Name  Flags
 1      1049kB  3001GB  3001GB  ntfs         1

Warning: Unable to open /dev/sr0 read-write (Read-only file system).  /dev/sr0
has been opened read-only.

Error: Can't have a partition outside the disk!
Model: PLEXTOR DVDR PX-880SA (scsi)
Disk /dev/sr0: 4691MB
Sector size (logical/physical): 2048B/2048B
Partition Table: unknown

I’ll tell you what I did, with two disks, on a UEFI box.

The box came with Windows 8 on the first drive. I installed the second hard drive.

I partitioned the second hard drive in gpt mode. I use “gdisk” for that, running from a 12.3 live KDE system (on USB). Actually, it was the Beta1 release of 12.3.

On that second drive, I created “/dev/sdb1” as an EFI partition. That’s one of the partition types available with gdisk.

I then divided the rest of that drive as wanted for linux.

To install, I made sure that I booted the DVD image (on USB) in UEFI mode. I manually set the partitions as I wanted (expert mode partitioner). I set “/dev/sdb1” to be mounted at “/boot/efi” and to be formatted. It should format as vfat/fat32, though I don’t recall whether I had to choose that. I had a separate “/boot” so I set that, and the root file system to be formatted. Actually, I set everything linux to be formatted, because this was a fresh disk with nothing already on it.

Having a second EFI partition as “/dev/sdb1” turned out to be a good choice, and avoided some of the problems that people are having with dual booting Windows.

The installer defaulted to grub2-efi for booting, which was an appropriate choice. I checked the box to enable secure boot of opensuse.

This mostly works pretty well. However, grub can’t boot Windows unless secure boot is disabled in the BIOS. Well, actually, it can, but only because I am testing an update that has not yet made it to the repos.

Which Partition in this is /boot anyway? As far as I know on a MBR disk, grub 2 must be installed in the MBR to boot from a logical partition, numbers 5 and up. Did you load Grub 2 into the MBR? I normally make sure Grub is on a Primary Partition, which would allow for generic boot code to be located in the MBR if that is what you want. I do know that you can load Grub 2 into a Primary Extended Partition, but doing so is dangerous if you should run the Windows Partition editor on that disk as it can corrupt such a setup. So where is grub 2 and where is /boot in this setup?

Thank You,

It would help if you started with explanation of your problem. What exactly does not work? Give as much details as possible.

Sorry, I gave more detail in the thread I linked to.

I had 12.2 installed and it wasn’t a UEFI install. What wasn’t fixed was the problem of grub2 apparently not loading even after upgrading to 12.3 (installed via UEFI). Another thing that doesn’t work is, following the aforementioned guide, when I try to reinstall grub with “grub2-mkconfig -o /boot/grub2/grub.cfg” I get “error: failed to get canonical path of /dev/sdb5”
I have the boot order set to boot the openSUSE HDD (separate HDD for Windows) but all I get upon starting is a blank screen with this: grub _ (underdash blinking).
/dev/sdb5 is my /boot partition, which just made me notice something: the boot flag is set on sdb1 not sdb5. Could this be the problem? If so, how do I fix it?

Also, considering 12.2 was not installed in UEFI mode and I upgraded to 12.3 via UEFI mode, would that not “fix” my problem of not being able to dual boot openSUSE & Windows (8) on separate HDDs?

So do you boot using UEFI or not using UEFI? It is absolutely unclear from your answer.

when I try to reinstall grub with "grub2-mkconfig
grub2-mkconfig does not reinstall grub, it simply creates its configuration file.
the boot flag is set on sdb1 not sdb5.
You can’t set boot flag on sdb5, it is extended partition.
Could this be the problem?
Yes, if you a) boot using legacy BIOS and not UEFI and b) have code in MBR that interprets boot flag and c) you have garbage in in sda1. To many "if"s …
If so, how do I fix it?
This depends on whether you used UEFI or legacy BIOS. Start with showing output of

cat /etc/fstab rpm -qa grub2-\* efibootmgr -v

I thought I explained that. With 12.2 no, but when I upgraded to 12.3, I did do it via UEFI. I don’t know if upgrading from a non-UEFI system to a UEFI system “works” or not though.

grub2-mkconfig does not reinstall grub, it simply creates its configuration file.

I know that, but grub should have been installed properly upon upgrade, so I was trying to re-generate a config file.

Start with showing output of

cat /etc/fstab rpm -qa grub2-\* efibootmgr -v

fstab:

UUID=71242393-d510-4a6c-b749-018bd581ccf5 /                    btrfs      defaults              1 1
/dev/disk/by-id/ata-WDC_WD10EZEX-00RKKA0_WD-WMC1S0402977-part5 /boot                ext4       acl,user_xattr        1 2
/dev/disk/by-id/ata-WDC_WD10EZEX-00RKKA0_WD-WMC1S0402977-part5 /boot/efi                ext4       acl,user_xattr        1 2
UUID=f06dba9e-74e9-45d4-a323-56ad2717fa9c /home                btrfs      defaults              1 2
proc                 /proc                proc       defaults              0 0
sysfs                /sys                 sysfs      noauto                0 0
debugfs              /sys/kernel/debug    debugfs    noauto                0 0
usbfs                /proc/bus/usb        usbfs      noauto                0 0
devpts               /dev/pts             devpts     mode=0620,gid=5       0 0

grub2:

grub2-efi-2.00-19.5.2.x86_64
grub2-i386-pc-2.00-19.5.2.x86_64
grub2-x86_64-efi-2.00-19.5.2.x86_64
grub2-branding-openSUSE-12.3-6.7.5.noarch

efibootmgr -v:

BootCurrent: 0006
Timeout: 3 seconds
BootOrder: 0005,0002,0006,0004
Boot0002* Windows Boot Manager    HD(2,96800,31800,5215b478-1de5-4b59-ab36-1759ba98b53c)File(\EFI\Microsoft\Boot\bootmgfw.efi)WINDOWS.........x...B.C.D.O.B.J.E.C.T.=.{.9.d.e.a.8.6.2.c.-.5.c.d.d.-.4.e.7.0.-.a.c.c.1.-.f.3.2.b.3.4.4.d.4.7.9.5.}...b................
Boot0004* CD/DVD Drive     BIOS(3,0,00)AMGOAMNO........o.P.L.E.X.T.O.R. .D.V.D.R. . . .P.X.-.8.8.0.S.A....................A...........................>..Gd-.;.A..MQ..L.2.5.0.4.5.5.2. .8.4.3.0.5.0.1.0.7.4. .9......AMBO
Boot0005* Hard Drive     BIOS(2,0,00)AMGOAMNO........o.W.D.C. .W.D.1.0.E.Z.E.X.-.0.0.R.K.K.A.0....................A...........................>..Gd-.;.A..MQ..L. . . . .W. .-.D.M.W.1.C.0.S.0.4.9.2.7.7......AMBOAMNO........o.S.T.3.0.0.0.D.M.0.0.1.-.1.C.H.1.6.6....................A...........................>..Gd-.;.A..MQ..L. . . . . . . . . . . . .1.Z.1.F.1.P.E.2......AMBOAMNO........u.H.i.t.a.c.h.i. .H.D.S.7.2.3.0.3.0.A.L.A.6.4.0....................A.................................>..Gd-.;.A..MQ..L. . . . . . .K.M.3.0.1.1.H.Y.7.G.P.7.A.K......AMBO
Boot0006* UEFI: P3: PLEXTOR DVDR   PX-880SA       ACPI(a0341d0,0)PCI(1f,2)03120a000200ffff0000CD-ROM(1,426,22f342)AMBO

How did you boot when collecting this output? You obviously were booted in UEFI mode (otherwise efibootmgr did not work). I am afraid I still do not understand what does and what does not work.

And this is of course wrong. You have the same partition mounted twice which probably accounts for error you get. /boot/efi must be mount point for ESP (EFI System Partition). You already have one on /dev/sda which you probably should use, you do not have space on /dev/sdb for it anyway. Also what bootloader is in use (grep LOADER_TYPE= /etc/sysconfig/bootloader)?

I didn’t boot, I was using the Rescue guide I linked to before. I was using the 12.3 “rescue feature” then mounting & chroot’ing. I think one problem is that I have /boot on a separate partition and the guide assumes that one doesn’t have a separate /boot partition.

I think this may be a case of a broken grub(2) from 12.2 & grub from 12.3. Or it may be that the upgrade from 12.2 just didn’t fix the problem. If anyone else doesn’t have any suggestions, I may just back up my /home partition & reformat the whole drive & do a clean install.

I’m still waiting for your reply to my last question.

That command returned nothing.

I went ahead and reinstalled clean this time, formatting the drive. It’s all good now. Grub works like it should and has Windows as a menu option. That’s the point I wanted to get to.

Thanks for the help.

Upgrades don’t always work because it assumes a standard setup. If you previous install was a bit off from standard things can get messed. To make thing more complicated you changed boot programs also. Automated upgrades are great when they work but they don’t always work.

Let me say that while single openSUSE version upgrades are supported, you often do better with a clean install. Do realize that if you understand enough to do a custom partition and you elect to mount everything just as before and only format root / and not /home (where you have maintained a separate /home partition as suggested) you can keep all personnel settings while ensuring you have no mixed application versions installed. I also am not a big fan of using a separate /boot partition for all sorts of reasons, mostly it must not be checked out enough in the various openSUSE install configurations.

Thank You,

True. I always do a clean install but this time chose to attempt an upgrade for convenience in the hope that it would correct the problem.

Do realize that if you understand enough to do a custom partition and you elect to mount everything just as before and only format root / and not /home (where you have maintained a separate /home partition as suggested) you can keep all personnel settings while ensuring you have no mixed application versions installed.

I’m aware of that. However, see my next response…
(Also, I had to set up the partitions manually myself for two reasons: one, the partitioner was trying to use my Windows drive in addition to my Linux drive (other than boot/efi). Two, I wanted to do a setup without a swap partition as I have my motherboard maxed out to 32 GB of DDR3 RAM.)

I also am not a big fan of using a separate /boot partition for all sorts of reasons, mostly it must not be checked out enough in the various openSUSE install configurations.

I had to use a separate boot partition in my previous setup because for the last two or three openSUSE releases I had been using btrfs. However, since I am now dual booting, I opted to format the whole drive and use ext4 again for compatibility’s sake.

And its compatibility that drives most things I do and the desire to not swim upstream against the most common practices. I take on each new openSUSE version, but I don’t use TW or btrfs. I find plenty of time to play with new kernels and new nvidia video drivers and writing bash scripts of all sorts. I make every effort to buy hardware that works with Linux and dump anything I found that does not. In the end I want openSUSE to work for everyone, but not all choices one might make really work out well. I am happy you have come to a successful combination and wiser for the experience I am sure.

Thank You for using openSUSE,