Trouble installing 12.2 with Grub2-EFI

Hi all :),

I’m afraight I need some help installing openSUSE 12.2. I have a Thinkpad E320 which uses EFI.
But during the installation of grub2-efi the error “source_dir doesn’t exist, Please specify --target or --directory” comes up.
As expected, the system won’t boot. I think the bug is already reported here.
Nonetheless I’d like to use my new 12.2 :wink:
Is there any way to manually install the boot loader? (booting live CD and then using grub2-efi-install brings the same error)

I’ve also already tried to use ELILO, which I used for this laptop with 12.1. Unfortunately I am told that there was an error occured during the installation or ELILO.

I really don’t know what to do. Any help is highly appreciated.

Thanks in advance!

I don’t have problem with 12.2 DVD iso to Install. are you boot dvd with Uefi boot?

Yes, I am using a DVD in an external DVD drive which boots with ELILO.

I was suggested by martin_helm to use legacy boot if I don’t need dualboot.
In fact, I don’t need dualboot for openSUSE is the only system to be installed on this machine. I already tried to switch to legacy boot in the BIOS (or EFI?) and now I really in doubt with myself…
As expected, openSUSE installed grub2 instead of grub2-efi as boot manager. But during the installation, I received the error “/usr/sbin/grub2-install no such file or directory”… The strange thing is, I have already used the very same DVD and the same external DVD drive to install openSUSE 12.2 on another system (BIOS). There it went just through, no errors, booting without any problems.

Maybe I made some mistake with the partitioning, although I think I kept the defaults. But when I boot a live CD and try to setup the boot manager with yast, it tells me the boot manager cannot be setup properly due to the partitioning…

Is there a seperate boot partition required for grub2?

Can we go a step back and you describe what is right now on that machine, I am a bit confused by you saying you used it with12.1 so I do not understand why you want to reinstall. I used the “zypper dup” method to ugrade 5 machines including my ThinkPad E320 from 12.1 to 12.2 without real problems (that means a bit of cleanup after upgrading is always needed but that’s all).
So is there now a 12.1 on it? What partition scheme does it have right now? What partition scheme do you try to accomplish during the setup of 12.2?
Anything involved which recommends an extra /boot partition like LVM or btrfs?
I have a separate /boot partition since I use LVM on that ThinkPad since 12.1.
My current setup is 12.2 with grub2 (no efi) and LVM with ext4.

Just as additional information: In my BIOS the “UEFI/Legacy boot” is set to “both”, the “UEFI/Legacy boot priority” is set to “UEFI first” the second one does of course nothing since I do not use efi.

Alright, I hope I can make it clear.
Before 12.2 was released, there was (only) 12.1 installed on my laptop. 12.1 was booted using elilo then.
When 12.2 came, I decided not to update but format the entire disk and install 12.2 instead.

Just as you stated, I had “UEFI/Legacy boot” set to “both” and “UEFI first”. The DVD was then booted using ELILO and 12.2 suggested to install and use grub2-efi.
The partitioning looked something like that:

  • a small fat partition, which would be mounted as /boot (I think about 155 MB - it was the default)
  • a 2.01 GB swap partition
  • a 24 GB partition for / (ext4)
  • a ~93 GB partition for /home (ext4)
    I do not intend to use btrfs. I don’t really know much about LVM but I think I don’t need it either.

After that didn’t work I tried to disable UEFI boot in the BIOS. The following is the current setup.
With UEFI disabled, openSUSE suggested to install grub2 as the boot manager. The partitions look just like the ones above, only there is no fat partition. The 24GB partition (/) is now marked as the one to boot from.
Unfortunately, grub2 seems not to be installed successfully, so it won’t boot. Btw. I’m not able to “boot installed system” from the installation DVD either (“no active partition found”).
Afterwards, I tried to install grub2 manually from a live CD. I don’t have a lot of experience here… The outcome anyway was that grub2 couldn’t install because “embedding” was not supported for ext4.

If it was possible to manually install grub2 for this setup I would be very fine with it. On the other hand I would not mind to install everything over again to a different setup, if necassary.

Am 11.09.2012 13:36, schrieb billy blaze42:
> - a small fat partition, which would be mounted as /boot (I think about
> 155 MB - it was the default)
That looks strange (but I do not know if that has something to do with
efi), when I have a separate /boot it is always an ext file system (the
partitioner usually suggest ext4 which I change to ext2 since I do not
need journaling on it). Are you sure that is the /boot, I wonder if
grub2 has problems putting its files into a fat partition - I am confused.


PC: oS 12.2 x86_64 | i7-2600@3.40GHz | 16GB | KDE 4.8.4 | GeForce GT 420
ThinkPad E320: oS 12.2 x86_64 | i3@2.30GHz | 8GB | KDE 4.8.4 | HD 3000
eCAFE 800: oS 12.1 i586 | AMD Geode LX 800@500MHz | 512MB | KDE 3.5.10

Well, yes the fat partition is for efi. I don’t know why it’s needed but it’s in the automatic configuration and I think if I leave it out I get a warning…
Anyways, now that I switched “UEFI boot” off in BIOS and installed it all over, grub2 (without efi) is used and there is no fat partition anymore.
Maybe I should try to give grub2 a separate boot partition. What should the partitioning look like then?

  • /boot - ext2, ?size?
  • swap - 2GB
  • / - ext4
  • /home - ext4

Something like that maybe? How much space is needed for the boot loader?
And how do I have to configure it? “Boot from MBR”, “Boot from root”, boot from custom partition?

Cool BIOS!

If you go for a standard install I would not use a separate /boot at
all, just / (I give it usually more than needed, a good value would be
20G your mileage may vary), for swap I choose the size of the RAM -
these days a very conservative choice, most people will make it smaller
and all the rest for /home.


PC: oS 12.2 x86_64 | i7-2600@3.40GHz | 16GB | KDE 4.8.4 | GeForce GT 420
ThinkPad E320: oS 12.2 x86_64 | i3@2.30GHz | 8GB | KDE 4.8.4 | HD 3000
eCAFE 800: oS 12.1 i586 | AMD Geode LX 800@500MHz | 512MB | KDE 3.5.10

Alright, thats what I did, when I tried it with grub2, no efi.
I’ll try it once again and state exactly what I’m doing (maybe it was just bad luck… if there’s one thing a computer isn’t, it’s deterministic, is it :wink: )

  • choose “Installation”

  • choose language

  • new installation, disable “use automatic configuration”

  • set timezone and KDE as desktop environment

  • now the partitioning:

  • 2.01 GB swap

  • 24 GB ext4, mount as /

  • 93.24 GB ext4, mount as /home

  • set user name and password

  • I leave the boot loader settings the default, which look like this:

    • GRUB2
    • boot from MBR is not selected
    • boot from root partition **is **selected
    • all the rest is default - btw is it correct that in the kernel command line “resume=” is set to the swap part?
  • customize my software

  • installation from images is deactivated
    (I emphasize this because I found a thread which had the same problem that I had with GRUB2 in 12.2 Beta (which I’m not using) The problem was solved by disabling “install from images” - here’s the thread)

In about half an hour, I’ll report the outcome.

Well, I think we will not have to wait so long. The installation states the following again:

"Perl-Bootloader: 2012-09-11 19:01:20 ERROR: Command ‘/usr/sbin/grub2-install --force --skip-fs-probe /dev/sda2 > /var/log/YaST2/y2log_bootloader 2>&1’ failed with code 32512 and output: sh: /usr/sbin/grub2-install: No such file or directory

There was an error generationg the initrd (1)
warning: %post(bootspash-branding-openSUSE-12.2-11.6.15.noarch) scriptlet failed, exit status 1"

Again, I already installed oS 12.2 with GRUB2 on another computer with the very same DVD. I don’t know how likely it is for a DVD to “break” in such a point…

FRUSTRATION!..

If there’s nothing wrong with the installation steps I took and descriped above, can you help me setting up GRUB2 manually?

It’s fine. But do you have a good reason for not installing Grub into MBR? Are you dualbooting with Windows?

yes.

Since you have no dual boot try to install grub2 to MBR as
please_try_again also suggested. Other than that all looks fine to me
what you did.
If nothing works with grub2 due to whatever reason you can change the
selection in the installer to use grub (legacy) instead and after
hopefully successful install change that later in yast to use grub2
instead in the installed system.


PC: oS 12.2 x86_64 | i7-2600@3.40GHz | 16GB | KDE 4.8.4 | GeForce GT 420
ThinkPad E320: oS 12.2 x86_64 | i3@2.30GHz | 8GB | KDE 4.8.4 | HD 3000
eCAFE 800: oS 12.1 i586 | AMD Geode LX 800@500MHz | 512MB | KDE 3.5.10

No, I don’t. oS is all alone on the machine. But it was the default and I just kept it.

Anyways, installation is done and it won’t boot. Trying to use the installation DVD to “Boot from harddisk” brings the error “No active partition found”

I booted a Live CD and tried “grub2-install”, which says:
“/usr/sbin/grub2-bios-setup: error: embedding is not possible, but this is required for cross-disk install.” (whatever that means…)

Starting the boot loader component of YaST2 brings:
“Error
Because of the partitioning, the boot loader cannot be installed proberly.”

Can I install GRUB manually, without installing the whole system all over again?

Unless someone else knows exactly how to do manually a cross disk grub2
install I can only suggest to try a legacy grub-install and when your
system becomes bootable to change that later.


PC: oS 12.2 x86_64 | i7-2600@3.40GHz | 16GB | KDE 4.8.4 | GeForce GT 420
ThinkPad E320: oS 12.2 x86_64 | i3@2.30GHz | 8GB | KDE 4.8.4 | HD 3000
eCAFE 800: oS 12.1 i586 | AMD Geode LX 800@500MHz | 512MB | KDE 3.5.10

You could boot from a LiveCD, then “take over” the installed system, and try to install the bootloader using Yast:
**This assumes “/” lives on /dev/sda2, replace sda2 if needed **


mount /dev/sda2 /mnt
mount --bind /dev /mnt/dev
chroot /mnt
mount /proc
mount /sys
yast

Ok, I tried as you suggested Knurpht. First it looked better, but it would still not boot and when I try “boot from harddrive” from the live CD I get
“Booting from local disk…
GRUB _”
and a blinking cursor. But nothing else happens.

I will now try to install grub as suggested by martin_helm

To install Grub2 from command line, you can just use:

# grub2-install /dev/sda

or, if you want to install to a VBR (partition boot sector):

# grub2-install --force /dev/sda2

Notice the use of the option **–force ** in this case. That’s because it is discouraged (and will stop working if core.img has moved). The setup default is wrong. It is an ‘opensusism’ for compatibility with Windows. But it has been wrong for so many years that it will never change. That’s just the way it is. On the other hand, it makes openSUSE the most Windows friendly Linux distro (see MS/Novell agreement for more info lol! ).

To reinstall from live CD or DVD rescue system in sda2, mount this partition in /mnt,


# mount /dev/sda2 /mnt
# grub2-install --force --boot-directory=/mnt/boot  /dev/sda2

You should this the following (non fatal) error message:

/usr/sbin/grub2-bios-setup: warning: Embedding os not possible. GRUB can only be installed in this setup by using blocklists. **However, blocklists are UNRELIABLE and their use is discouraged**... Installation finished. No error reported. 

I am with Grub devs on this. Don’t install Grub2 (only) in a partition bootsector if you have a better possibility. However you can install it in the partition bootsector as well. It cannot hurt. That’s what I always do.

And set the bootflag on sda2

# sfdisk -A2 /dev/sda

If you install the boot loader to MBR (sda), the bootflag is irrelevant.

Then write the boot menu with:

# grub2-mkconfig -o /mnt/boot/grub2/grub.cfg

I never needed to do this under openSUSE, but I did it a lot under Ubuntu, because - just like in your case - Grub installation failed during setup. So if it wasn’t a I/O error (DVD, DVD reader or HDD) or a bug in Perl bootloader, it could be that Grub2 - or whatever involved in the installation process (os-prober or Perl bootloader) failed to scan your partititions. In such a cas, it would exit before installing the boot loader (and probably activating the partition in your case) and you’ll end up with a system without Grub. In my case, unconventional Unix disklabels (openBSD+NetBSD+FreeBSD) caused the partitions scan to fail. Since then, everytime I install Linux on a computer with Unix partitions, I remove this partition entries from partition table and rewrite the partition table afterwards. I’m not happy with this but I got used to it (meaning that I haven’t needed to reinstall Grub2 as I just explained above for several years).

IMO, you should have blanked the first track before installing in BIOS mode after a failed attempt to install in UEFI mode. Maybe the left over GPT headers confused Grub2 or the Perl bootloader. It’s just a possible explanation though and not the only one.

Well thanks a lot for the detailed description first of all.
I have now come so far, that GRUB2 boots my system, when I “boot from harddisk” from the DVD’s menu. Only without it, it just won’t boot.
Where’s the problem when this is the case?
Strange thing I notice is that “parted -l” reports on the / partition, but also on the /home partition. I would like to put it off but “parted set 3 boot off” answers: “Error: Could not stat device set - No such file or directory.”