[Solved] Mageia live dvd on usb wants to boot as uefi

This forum is dedicated to basic help and support :

Ask here your questions about basic installation and usage of Mageia. For example you may post here all your questions about getting Mageia isos and installing it, configuring your printer, using your word processor etc.

Try to ask your questions in the right sub-forum with as much details as you can gather. the more precise the question will be, the more likely you are to get a useful answer

[Solved] Mageia live dvd on usb wants to boot as uefi

Postby mark9117 » Feb 3rd, '18, 07:52

Forgive me if this is a bit labored. I've been searching and reading about this and I'm confused.

I'm trying to install Mageia from a Live CD image on a usb stick. The hardware is an old Lenovo B570 laptop with an existing Windows 7 installation. I'm trying to configure it for dual boot.

I can get Mageia to install, but when I restart the machine, grub2 does not appear and the machine boots directly to Windows. How do I get this to install in legacy mode? I've looked through the machines bios and there is nothing about UEFI or booting in bios mode. I'm at a loss.

Help?
Last edited by mark9117 on Feb 15th, '18, 21:38, edited 1 time in total.
Let's just reboot everything all the time.
User avatar
mark9117
 
Posts: 395
Joined: Sep 12th, '11, 20:32
Location: Eastern New Mexico -- Not Hell, but you can see it from here.

Re: Mageia live dvd on usb wants to boot as uefi

Postby gohlip » Feb 3rd, '18, 09:23

First find out if your windows is in UEFI and if the disk is gpt partitioned.
Being an old laptop, it should be in bios-legacy and disk is msdos; but you must be very clear in this.
Otherwise, we will end up not only with a mess but with your windows not booting after that.

We will now proceed as though your system is bios-legacy and your disk msdos.
Do not proceed if unsure.

Boot up your install media in bios-legacy again and go to livecd OS.
At livecd OS terminal,
Code: Select all
test -d /sys/firmware/efi && echo UEFI || echo BIOS

This should give output 'BIOS', otherwise reboot your livecd in bios-legacy.
Recheck where is your installed Mageia OS partition by any one of the commands (root may be necessary).
Code: Select all
lsblk -f
parted -l
blkid
fdisk -l


And that the internal disk is listed as sda (not sdb because sometimes the install media can be sda and internal disk sdb)

At this point, go to livecd file manager and look into mageia /boot and copy down its kernel and initrd files, like vmlinuz-4.14.13-desktop-1.mga6 and initrd-4.14.13-desktop-1.mga6.img


I am going to use 'sda5' as your Mageia installed partition; change to the correct one below.
Commands as root
Code: Select all
mount /dev/sda5 /mnt
grub2-install --target=i386-pc --boot-directory=/mnt/boot --recheck --debug --force /dev/sda


If internal disk is sdb (and mageia partition is sdb5), the following shall apply
Code: Select all
mount /dev/sdb5 /mnt
grub2-install --target=i386-pc --boot-directory=/mnt/boot --recheck --debug --force /dev/sdb



Reboot.


{And just in case} - If you booted up to a grub prompt (grub>) and not the mageia grub menu, at grub prompt,
Code: Select all
grub> search.file /etc/mageia-release


This should give output of mageia partition. If it does, continue... note first line below is not a repeat of last line above
Code: Select all
grub> search.file /etc/mageia-release root
grub> probe -u $root --set=abc
grub> linux16 /boot/vmlinuz-4.14.13-desktop-1.mga6 root=UUID=$abc ro
grub> initrd16 /boot/initrd-4.14.13-desktop-1.mga6.img
grub> boot

[hint] - you can use <tab> to autocomplete
like... at vmlinuz-4 <tab>
it will complete vmlinuz-4.14.13-desktop-1.mga6

When booted up to Mageia OS, do again grub-install and update-grub, verify first Mageia partition is now in sda disk
Code: Select all
grub2-install /dev/sda
grub2-mkconfig -o /boot/grub2/grub.cfg
Why do we live? To prove not everything in nature has a purpose.
gohlip
 
Posts: 573
Joined: Jul 9th, '12, 10:50

Re: Mageia live dvd on usb wants to boot as uefi

Postby mark9117 » Feb 4th, '18, 09:09

I appreciate that reply gohlip, but I have determined that Windows is loaded uefi. There is an EFI extension partition but there is no BIOS feature that has anything to do with uefi. Given this fact, it makes sense that Mageia would load uefi, but it doesn't explain why Grup2 fails to appear on boot. I did notice that Mageia is configured for Grub2 to boot from an EFI partition.

Got any ideas about that?

Thanks!
Let's just reboot everything all the time.
User avatar
mark9117
 
Posts: 395
Joined: Sep 12th, '11, 20:32
Location: Eastern New Mexico -- Not Hell, but you can see it from here.

Re: Mageia live dvd on usb wants to boot as uefi

Postby gohlip » Feb 4th, '18, 09:48

....but I have determined that Windows is loaded uefi.

If that is the case.

Boot up your install media in uefi again and go to livecd OS.
At livecd OS terminal,
note: some commands below must be in as root (please so as root if any user commands do not work)


1. Ensure your livecd is booted up in uefi
Code: Select all
test -d /sys/firmware/efi && echo UEFI || echo BIOS

This must give output 'UEFI', otherwise reboot your livecd in uefi.
2.Recheck where is your installed Mageia OS partition by any one of the commands.
Code: Select all
lsblk -f
parted -l
blkid
fdisk -l

I am going to use 'sda5' as your Mageia installed partitionand your /boot/EFI as 'sda2'; change to the correct ones for the mount commands later on below.

3. At this point, go to livecd file manager and look into mageia /boot and copy down its kernel and initrd files, like vmlinuz-4.14.13-desktop-1.mga6 and initrd-4.14.13-desktop-1.mga6.img

4. Also find that the /etc/fstab line in your Magia OS (sda5 in my example) contains /boot/EFI entry (and in my example refers to sda2 - check on what is your $esp).
If it is not there, make an entry for /boot/EFI in fstab, like this..
Code: Select all
UUID=xxxxxxxx  /boot/EFI       vfat    umask=0077      0       1

If the syntax is different (because of ssd) but it is there, leave it alone. But fstab entry for /boot/EFI must be there.

5. Mount and grub-install
Code: Select all
mount /dev/sda5 /mnt
mount /dev/sda2 /mnt/boot/EFI
grub2-install --target=x86_64-efi --efi-directory=/mnt/boot/EFI --bootloader-id=mageia --boot-directory=/mnt/boot --recheck --debug
cp /boot/grub2/x86_64-efi/core.efi /boot/EFI/EFI/boot/bootx64.efi


6. Check that mageia is in uefi bootorder and mageia is at top of bootorder.
Code: Select all
efibootmgr


7. Reboot.

If it boot to grub prompt, use the same as above post but use linuxefi and initrdefi instead of linux16 and initrd16.
Sigh... just use linux and initrd. It will work for both uefi or bios-legacy.

When booted up
Code: Select all
grub2-install
grub2-mkconfig -o /boot/grub2/grub.cfg

Yes, correct, not 'grub2-install /dev/sda'
Why do we live? To prove not everything in nature has a purpose.
gohlip
 
Posts: 573
Joined: Jul 9th, '12, 10:50

Re: Mageia live dvd on usb wants to boot as uefi

Postby mark9117 » Feb 4th, '18, 21:06

Again, much appreciation gohlip. Here's the latest.

I determined that the EFI system partition was /dev/sda1, Mageia system part was /dev/sda4 and /home was /dev/sda6. Checked the drakdisk and determined the UUID for /boot/EFI was 3400-1070. Mounted sda4 and sda6 as described, then tried to install grub2. Here's where it came off the rails.

Code: Select all
grub2 install error: /usr/lib/grub/x86_64-efi/modinfo.sh doesn't exist. Please specify --target or --directory


The fact of the matter is /usr/lib/grub does not exist. opened mcc and tried to configure boot. It appeared to install grub2-efi (3/3) and it crashed:

Code: Select all
drakboot crashed - ttyname failed: inappropriate ioctl for device /usr/bin/grub2 error: failed to get canonical path at overlay


Tried reinstalling. Wound up with exactly the same results.

Again, thanks for the attention.

Ideas?

Edit:
Perused Google for a solution. Not really finding anything likely. I'm just not sure how this thing works.
Let's just reboot everything all the time.
User avatar
mark9117
 
Posts: 395
Joined: Sep 12th, '11, 20:32
Location: Eastern New Mexico -- Not Hell, but you can see it from here.

Re: Mageia live dvd on usb wants to boot as uefi

Postby gohlip » Feb 5th, '18, 03:13

grub2 install error: /usr/lib/grub/x86_64-efi/modinfo.sh doesn't exist. Please specify --target or --directory

This means your install media is not booted up in uefi.
Did you do step 1 and verify install media is booted up in uefi?

The fact of the matter is /usr/lib/grub does not exist. opened mcc and tried to configure boot. It appeared to install grub2-efi (3/3) and it crashed:

You cannot just do mcc in live media and expect it to work in installed Mageia OS.
Obviously you are going to get error "error: failed to get canonical path at overlay"
EFI system partition was /dev/sda1, Mageia system part was /dev/sda4 and /home was /dev/sda6.

Yet you mounted
Mounted sda4 and sda6 as described,

The steps outlined are very clear.
Can you follow each step in sequence and provide corresponding output along the way ?

....but I have determined that Windows is loaded uefi.

And how do you determine that?



Perused Google for a solution. Not really finding anything likely. I'm just not sure how this thing works.

Did you have a look here https://wiki.mageia.org/en/Installing_o ... I_firmware ?

I would recommend that before you do anything, just provide from the livecd terminal, (as root mainly)
test -d /sys/firmware/efi && echo UEFI || echo BIOS
parted -l
blkid
efibootmgr -v

Contents from installed Magiea OS (in sda 4)
/etc/fstab


And lastly, what Mageia version are you using? Mageia 6 or Mageia 4?
Why do we live? To prove not everything in nature has a purpose.
gohlip
 
Posts: 573
Joined: Jul 9th, '12, 10:50

Re: Mageia live dvd on usb wants to boot as uefi

Postby mark9117 » Feb 5th, '18, 07:21

gohlip wrote:
grub2 install error: /usr/lib/grub/x86_64-efi/modinfo.sh doesn't exist. Please specify --target or --directory

This means your install media is not booted up in uefi.
Did you do step 1 and verify install media is booted up in uefi?


Yup. See the output of "test -d /sys/firmware/efi && echo UEFI || echo BIOS" below. And it even says that it's in UEFI at the top of the desktop as per this example (the example is Mageia 5, I'm installing Mageia 6):

Image

The fact of the matter is /usr/lib/grub does not exist. opened mcc and tried to configure boot. It appeared to install grub2-efi (3/3) and it crashed:

You cannot just do mcc in live media and expect it to work in installed Mageia OS.
Obviously you are going to get error "error: failed to get canonical path at overlay"[/quote]

Fair enough. It was a hail Mary anyway.

EFI system partition was /dev/sda1, Mageia system part was /dev/sda4 and /home was /dev/sda6.

Yet you mounted
Mounted sda4 and sda6 as described,

The steps outlined are very clear.
Can you follow each step in sequence and provide corresponding output along the way ?


I can sort of. See below. And /dev/sda1 was mounted at /mnt/boot/EFI per the instructions (step 5)

....but I have determined that Windows is loaded uefi.

And how do you determine that?


I eventually resorted to installing something called easyuefi. It is a Windows boot manager of some kind. It doesn't install unless you are installed in uefi mode and if you are it provides a fairly nifty graphical boot manager utility.

Perused Google for a solution. Not really finding anything likely. I'm just not sure how this thing works.

Did you have a look here https://wiki.mageia.org/en/Installing_o ... I_firmware ?


In fact I have seen that page. Several times. This section in particular: https://wiki.mageia.org/en/Installing_o ... stallation

I would recommend that before you do anything, just provide from the livecd terminal, (as root mainly)
test -d /sys/firmware/efi && echo UEFI || echo BIOS
parted -l
blkid
efibootmgr -v

Contents from installed Magiea OS (in sda 4)
/etc/fstab


And lastly, what Mageia version are you using? Mageia 6 or Mageia 4?


It's Mageia 6 from a livedvd image on a usb stick.

As requested here is the information.

Code: Select all
[root@localhost live]# test -d /sys/firmware/efi && echo UEFI || echo BIOS
UEFI


Note: efibootmgr was not found. Hmm.
parted -l
Code: Select all
[root@localhost live]# parted -l & blkid & fdisk -l & efibootmgr -v
[1] 3380
[2] 3381
[3] 3382
bash: efibootmgr: command not found
[root@localhost live]# Disk /dev/ram0: 31.3 MiB, 32768000 bytes, 64000 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 /dev/ram1: 31.3 MiB, 32768000 bytes, 64000 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 /dev/ram2: 31.3 MiB, 32768000 bytes, 64000 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 /dev/ram3: 31.3 MiB, 32768000 bytes, 64000 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 /dev/ram4: 31.3 MiB, 32768000 bytes, 64000 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 /dev/ram5: 31.3 MiB, 32768000 bytes, 64000 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 /dev/ram6: 31.3 MiB, 32768000 bytes, 64000 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 /dev/ram7: 31.3 MiB, 32768000 bytes, 64000 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 /dev/ram8: 31.3 MiB, 32768000 bytes, 64000 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 /dev/ram9: 31.3 MiB, 32768000 bytes, 64000 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 /dev/ram10: 31.3 MiB, 32768000 bytes, 64000 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 /dev/ram11: 31.3 MiB, 32768000 bytes, 64000 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 /dev/ram12: 31.3 MiB, 32768000 bytes, 64000 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 /dev/ram13: 31.3 MiB, 32768000 bytes, 64000 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 /dev/ram14: 31.3 MiB, 32768000 bytes, 64000 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 /dev/ram15: 31.3 MiB, 32768000 bytes, 64000 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 /dev/sda: 465.8 GiB, 500107862016 bytes, 976773168 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
Disklabel type: gpt
Disk identifier: 93D8E80F-8C14-47ED-9759-768230D0DD84


blkid
Code: Select all
Device         Start       End   Sectors   Size Type
/dev/sda1       2048    206847    204800   100M EFI System
/dev/sda2     206848    468991    262144   128M Microsoft reserved
/dev/sda3     468992 661443873 660974882 315.2G Microsoft basic data
/dev/sda4  661444608 763967578 102522971  48.9G Linux filesystem
/dev/sda5  763969536 772356186   8386651     4G Linux swap
/dev/sda6  772358144 976773134 204414991  97.5G Linux filesystem


fdisk -l
Code: Select all
Disk /dev/loop0: 2.4 GiB, 2590146560 bytes, 5058880 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 /dev/sdb: 7.5 GiB, 8004304896 bytes, 15633408 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
Disklabel type: dos
Disk identifier: 0x2bc829b9

Device     Boot Start     End Sectors  Size Id Type
/dev/sdb1  *        0 5130239 5130240  2.5G  0 Empty
/dev/sdb2         304    8495    8192    4M ef EFI (FAT-12/16/32)
Model: ATA HITACHI HTS54755 (scsi)
Disk /dev/sda: 500GB
Sector size (logical/physical): 512B/4096B
Partition Table: gpt
Disk Flags:

Number  Start   End    Size    File system     Name                          Flags
 1      1049kB  106MB  105MB   fat32           EFI system partition          boot, esp
 2      106MB   240MB  134MB                   Microsoft reserved partition  msftres
 3      240MB   339GB  338GB   ntfs                                          msftdata
 4      339GB   391GB  52.5GB  ext4
 5      391GB   395GB  4294MB  linux-swap(v1)
 6      395GB   500GB  105GB   ext4


Model: SanDisk Cruzer Glide (scsi)
Disk /dev/sdb: 8004MB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags:

Number  Start  End     Size    Type     File system  Flags
 2      156kB  4350kB  4194kB  primary               esp


Warning: Unable to open /dev/sr0 read-write (Read-only file system).  /dev/sr0
has been opened read-only.
Error: /dev/sr0: unrecognised disk label
Model: TSSTcorp CDDVDW TS-L633F (scsi)                                   
Disk /dev/sr0: 3321MB
Sector size (logical/physical): 2048B/2048B
Partition Table: unknown
Disk Flags:

/dev/sda1: UUID="3400-1070" TYPE="vfat" PARTLABEL="EFI system partition" PARTUUID="bb07ff7f-915b-47a1-886f-12fa4e40dd29"
/dev/sda2: PARTLABEL="Microsoft reserved partition" PARTUUID="29cf1631-1051-4de1-81b7-970668d6eb3f"
/dev/sda3: UUID="CC22C3B422C3A1B6" TYPE="ntfs" PARTUUID="121fe3bd-ee5b-4f46-8ee8-af964ab51ca8"
/dev/sda4: UUID="7b17f016-d602-4135-9b0c-27056b72cac6" TYPE="ext4" PARTUUID="2127ccd6-9bfb-4fd4-bef4-fb8ad0c1ad73"
/dev/sda5: UUID="d8ae407c-d818-4d17-9ee6-e8de7a1eccbf" TYPE="swap" PARTUUID="04995b8a-4dfb-4262-b761-e3c22fd7aacb"
/dev/sda6: UUID="d350a7e9-d7ff-4410-8312-bd9a379059b5" TYPE="ext4" PARTUUID="3329e9f1-bb22-477d-9685-601509320d21"
/dev/loop0: TYPE="squashfs"
/dev/sr0: UUID="2011-04-12-02-38-58-00" LABEL="GSP1RMCHPXFRER_EN_DVD" TYPE="udf"
/dev/sdb1: UUID="2017-07-11-20-04-49-00" LABEL="Mageia-6-Plasma-LiveDVD" TYPE="iso9660" PTUUID="2bc829b9" PTTYPE="dos" PARTUUID="2bc829b9-01"
/dev/sdb2: SEC_TYPE="msdos" UUID="DA20-A358" TYPE="vfat" PARTUUID="2bc829b9-02"


I hope that helps. I do appreciate the attention. I've been stymied by this for awhile. I've been installing Mageia since it was Mandrake and this is the first time I've really had trouble. Given the age of this laptop, I never expected to have trouble with eufi issues. Live and learn.
Let's just reboot everything all the time.
User avatar
mark9117
 
Posts: 395
Joined: Sep 12th, '11, 20:32
Location: Eastern New Mexico -- Not Hell, but you can see it from here.

Re: Mageia live dvd on usb wants to boot as uefi

Postby gohlip » Feb 5th, '18, 08:02

Alright, good that you stick with it also. Just a quick and first observation.
i need to go away for a few hours. In meantime please take a look at it and comment if necessary.

Your sda disk (the main one)

Code: Select all
Disk /dev/sda: 465.8 GiB, 500107862016 bytes, 976773168 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
Disklabel type: gpt
Disk identifier: 93D8E80F-8C14-47ED-9759-768230D0DD84


Unless you truncated it by mistake, there is no details of its partitions.


Also there is no contents of your /etc/fstab.
This is also very important to proceed.


When boot up livecd, check individually that these packages are installed (at livecd). If not install them
efibootmgr
grub2-efi
dosfstools
efivar

ps: looks from your non output of 'efibootmgr, these packages are not at your livvecd, even though you've booted up in uefi.
But this command needs to be root in Mageia. Have you done this as root?

Then Assuming you've correctly done the processes (and there's an fstab entry for /boot/EFI - which we don't know as you did not provide fstab entries)
Please follow again the procedure laid out, (this time mount correct / and /boot/EFI)

At step 5. in this order only

mount /dev/sda4 /mnt
mount /dev/sda1 /mnt/boot/EFI

note: for clarity, please provide each step of the command and output so we can follow and not have to guess which area is having errors or where it occurs. thanks.
Why do we live? To prove not everything in nature has a purpose.
gohlip
 
Posts: 573
Joined: Jul 9th, '12, 10:50

Re: Mageia live dvd on usb wants to boot as uefi

Postby mark9117 » Feb 5th, '18, 09:48

I must go away for a few hours myself. More than a few actually. I am embarking on 7 hours of sleep followed by about 10 hours at work and then back home tomorrow evening. I'll address all these issues in detail. Not sure what happened to the block for /dev/sda. I think this is it.

Code: Select all
Disk /dev/sda: 465.8 GiB, 500107862016 bytes, 976773168 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
Disklabel type: gpt
Disk identifier: 93D8E80F-8C14-47ED-9759-768230D0DD84

Device         Start       End   Sectors   Size Type
/dev/sda1       2048    206847    204800   100M EFI System
/dev/sda2     206848    468991    262144   128M Microsoft reserved
/dev/sda3     468992 661443873 660974882 315.2G Microsoft basic data
/dev/sda4  661444608 763967578 102522971  48.9G Linux filesystem
/dev/sda5  763969536 772356186   8386651     4G Linux swap
/dev/sda6  772358144 976773134 204414991  97.5G Linux filesystem


I had to email myself this stuff and it's a little messy.

Fstab is basically empty, there is certainly no entry for /boot/EFI. I had to make that myself. It still couldn't find /usr/lib/grub.

As I said, when I get the time I will verify installation of efibootmgr, grub2-efi, dosfstools and efivar.

All of this is being done as root, and I'll see how it goes tomorrow night.

Thanks again. I'm off to bed.
Let's just reboot everything all the time.
User avatar
mark9117
 
Posts: 395
Joined: Sep 12th, '11, 20:32
Location: Eastern New Mexico -- Not Hell, but you can see it from here.

Re: Mageia live dvd on usb wants to boot as uefi

Postby gohlip » Feb 5th, '18, 10:23

Fstab is basically empty, there is certainly no entry for /boot/EFI

Make sure you also have for / partition and for home.
There you go. There's this problem.
But note this must be in your OS (sda4) not in your livecd /etc/fstab.
Hope you understand what I mean.


4. Also find that the /etc/fstab line in your Magia OS (sda5 in my example) contains /boot/EFI entry (and in my example refers to sda2 - check on what is your $esp).
If it is not there, make an entry for /boot/EFI in fstab, like this..


Is there really any problem in following these steps? Seriously, I'm wondering if these steps are clear enough.
Note, I'm on the other side of the world. So I may reply you much later as well.
Good night.
Why do we live? To prove not everything in nature has a purpose.
gohlip
 
Posts: 573
Joined: Jul 9th, '12, 10:50

Re: Mageia live dvd on usb wants to boot as uefi

Postby mark9117 » Feb 5th, '18, 20:00

At work replying on my phone.

But note this must be in your OS (sda4) not in your livecd /etc/fstab.
Hope you understand what I mean.


I do understand. There is a difference between the temporary copy of Mageia that the live DVD boots and the more persistent installation that actually sits on the hard drive partition. Pretty sure I'm making the right edits, but doing this stuff in the wee small hours leaves no guarantee. ;)

Seriously, I'm wondering if these steps are clear enough.
Note, I'm on the other side of the world. So I may reply you much later as well.


See above. If any way to clarify them occurs to me, I'll try and remember to pass it along.

More later.
Let's just reboot everything all the time.
User avatar
mark9117
 
Posts: 395
Joined: Sep 12th, '11, 20:32
Location: Eastern New Mexico -- Not Hell, but you can see it from here.

Re: Mageia live dvd on usb wants to boot as uefi

Postby martinw » Feb 6th, '18, 00:11

If the installer didn't report any errors, it's likely all the necessary files have already been installed correctly. You may just have laptop like mine, where the UEFI BIOS has been hardwired to load WIndows by default, rather than to pay attention to the values stored in the UEFI NVRAM (as written by efibootmgr). This is quite common - see this section in the errata. Before trying any of the workarounds described in the linked bug, it's best to check that the Mageia installation really is bootable. Does your BIOS provide an alternative boot menu? This is usually accessed by holding down a function key during boot (F8 or F9 are common choices), and like the option to enter the BIOS setup menu, usually only gives you a small window of opportunity to press the key. If so, there may be an option to browse the files stored in the EFI system partition and choose the one you want to boot from. The file you want is EFI\mageia\bootx64.efi.
martinw
 
Posts: 609
Joined: May 14th, '11, 10:59

Re: Mageia live dvd on usb wants to boot as uefi

Postby gohlip » Feb 6th, '18, 05:39

@martinw
The workaround is also at my post above. The last line there
cp /boot/grub2/x86_64-efi/core.efi /boot/EFI/EFI/boot/bootx64.efi
will make the Mageia boot default.
I included this is also just in case, like yours, the default is 'hard wired' to boot from /boot/bootx64.efi
Note grubx64.efi is itself a copy of core.efi so the workaround you mentioned is also similar to mine, just that I use the original file not the copied grubx64.efi.
And there is no problem to include this even if it is not required.

But good that you provided the additional linked reports.

Oh, I just downloaded the M6 iso again to see why the OP has difficulties. Mine was deleted because I was on M6 at the early stages of Cauldron.
Confirm that at the iso did not have packages efivar, efibootmgr and grub2-efi.
So he needs to install these at livecd before doing the repairs.

I also booted up the iso in bios-legacy (separately) and also find the packages grub and grub2 missing.
Repairs therefore at bios-legacy needs these packages installed for repair in bios-legacy as well.

Not only that, it may also explain why people have difficulties installing Mageia (no bootloader when installed) from the livecd (I did not test the install cd), on either bios-legacy or UEFI.
Perhaps the developers should include these in the livecd iso?

note: just to note why I did not have any problem installing Mageia - I have my own grub2 (OS-independent) bootloader (both bios-legacy and uefi systems) which will boot up any OS with or without any bootloader or on other bootloaders (systemd-boot, refind or grub-legacy (that's how I installed Mageia when grub-legacy was default) - and I also have refind and systemd-boot bootloaders in some of my OS's)
Why do we live? To prove not everything in nature has a purpose.
gohlip
 
Posts: 573
Joined: Jul 9th, '12, 10:50

Re: Mageia live dvd on usb wants to boot as uefi

Postby mark9117 » Feb 6th, '18, 08:58

Okay, got it installed. It's updating now.
I am working on what I believe may be a better version of the instructions.

In the meantime, I found an error.

Under step 6 this line appears:

Code: Select all
cp /boot/grub2/x86_64-efi/core.efi /boot/EFI/EFI/boot/bootx64.efi


This doesn't work because it incorrectly references the files in question. The line should read:

Code: Select all
cp /mnt/boot/grub2/x86_64-efi/core.efi /mng/boot/EFI/EFI/boot/bootx64.efi


Here is my attempt at revising these instructions. Warning; it was late when I did this. You'll want to proofread it closely before releasing it on the world. It may or may not be any better than yours. And thanks for all your help. I genuinely appreciate it.
=====================================


Boot up your Mageia install media in uefi.
Open a terminal.
Run the following commands as root.


1. Ensure your livecd is booted up in uefi with this command:

Code: Select all
 test -d /sys/firmware/efi && echo UEFI || echo BIOS



If the output of this command is not 'UEFI', reboot your livecd in uefi.

2. Verify the location of your installed Mageia OS partition by any using any one of these commands.

Code: Select all
lsblk -f
parted -l
blkid
fdisk -l


The following examples will assume that 'sda5' is your Mageia installed partition, and your /boot/EFI is 'sda2'; change these 'sdax' variables to reflect the variables you found on your system.


3. Open a file manager and look into /boot. Copy the kernel and initrd files found there, for example vmlinuz-4.14.13-desktop-1.mga6 and initrd-4.14.13-desktop-1.mga6.img


4. Mount the partitions installed on your hard drive under the running operating system:

Code: Select all
mount /dev/sda5 /mnt
mount /dev/sda2 /mnt/boot/EFI



5. Check /mnt/boot/EFI/etc/fstab for an entry mouting /boot/EFI:

Code: Select all
UUID=xxxxxxxx  /boot/EFI       vfat    umask=0077      0       1


If that line is not in /mnt/boot/EFI/etc/fstab, create it. You can find the UUID with the "blkid" command.

If your system is installed on an ssd, your syntax will be different. As long as it exists, leave it alone. Just understand that an fstab entry for /boot/EFI must exist in fstab.


6. Mount and grub-install

Code: Select all
grub2-install --target=x86_64-efi --efi-directory=/mnt/boot/EFI --bootloader-id=mageia --boot-directory=/mnt/boot --recheck --debug


Code: Select all
cp /mnt/boot/grub2/x86_64-efi/core.efi /mnt/boot/EFI/EFI/boot/bootx64.efi



7. Check that mageia is in uefi bootorder and mageia is at top of bootorder.

Code: Select all
efibootmgr



8. Reboot.

If it boots to grub prompt, [[use the same as above post but use linuxefi and initrdefi instead of linux16 and initrd16.
Sigh... just use linux and initrd. It will work for both uefi or bios-legacy.]] <-- I'm not sure I understand what this is all about. When I rebooted everything was just fine.

Install and configure grub2:

Code: Select all
grub2-install
grub2-mkconfig -o /boot/grub2/grub.cfg
Let's just reboot everything all the time.
User avatar
mark9117
 
Posts: 395
Joined: Sep 12th, '11, 20:32
Location: Eastern New Mexico -- Not Hell, but you can see it from here.

Re: Mageia live dvd on usb wants to boot as uefi

Postby gohlip » Feb 6th, '18, 09:09

Good to hear you've got it working.
And yes, at livecd, after mounting to /mnt
The path at commands should be prefixed with /mnt
Sorry about that too.
And thanks for correcting the commands

Cheers and take care.

[edit]

Sigh... just use linux and initrd. It will work for both uefi or bios-legacy.]] <-- I'm not sure I understand what this is all about. When I rebooted everything was just fine.

Mageia grub menuentry generates linux16 and intrd16 for bios-legacay grub and linuxefi and initrdefi for uefi grub.
Most other distros use linux and initrd whether it is for bios-legacy or for uefi.

I had tested Mageia and changed the lines to just linux and initd for both bios-legacy and uefi
And works just the same.

I had complained (in the past) Mageia likes to complicate things for no apparent benefit or gain like
o having 2 symlinks, vmlinuz and vmlinuz-desktop; initrd.img and initrd-desktop.img
o this linux16 and linuxefi
o /boot/EFI instead of /boot/efi
o grub2 directory instead of grub directory (yes, to separate menu.lst and grub.cfg, but why?)
o separate grub2 commands instead of unified grub commands
o and more....

And true, many are wholesale taken off RH/Fedora, but these complications often makes things more difficult for users.
Perhaps RH wants to keep things more esoteric for their paying customers so that they can justify continuing charging for their services.
But I have stopped complaining. So others please do not continue this OT answer for the OP.
As said before, my liking for Mageia may be for my own sentimental reasons. Not technical.
Why do we live? To prove not everything in nature has a purpose.
gohlip
 
Posts: 573
Joined: Jul 9th, '12, 10:50

Re: Mageia live dvd on usb wants to boot as uefi

Postby martinw » Feb 6th, '18, 11:13

gohlip wrote:@martinw
The workaround is also at my post above. The last line there
cp /boot/grub2/x86_64-efi/core.efi /boot/EFI/EFI/boot/bootx64.efi
will make the Mageia boot default.
I included this is also just in case, like yours, the default is 'hard wired' to boot from /boot/bootx64.efi
Note grubx64.efi is itself a copy of core.efi so the workaround you mentioned is also similar to mine, just that I use the original file not the copied grubx64.efi.
And there is no problem to include this even if it is not required.

Actually, on mine the default is \EFI\Microsoft\Boot\bootmgfw.efi, so your workaround wouldn't work for me.
Oh, I just downloaded the M6 iso again to see why the OP has difficulties. Mine was deleted because I was on M6 at the early stages of Cauldron.
Confirm that at the iso did not have packages efivar, efibootmgr and grub2-efi.

It does have those packages, they just aren't installed. That's because at the time M6 was released, the grub2 and grub2-efi packages conflicted, so couldn't both be installed at the same time. The installer on the Live system will install the appropriate packages. The Live system is set up with a small local repo containing all the necessary packages, so no need to set up additional repositories (or to have an internet connection).
So he needs to install these at livecd before doing the repairs.

Yes, if repairs are necessary. But they most likely weren't ;-)
I also booted up the iso in bios-legacy (separately) and also find the packages grub and grub2 missing.
Repairs therefore at bios-legacy needs these packages installed for repair in bios-legacy as well.

As above.
Not only that, it may also explain why people have difficulties installing Mageia (no bootloader when installed) from the livecd (I did not test the install cd), on either bios-legacy or UEFI.

All the bug reports I've seen about problems with bootloader installation have been failures of os-prober or grub2-install. These would get reported by the installer.
Perhaps the developers should include these in the livecd iso?

Already done ;-) (BTW, currently I am the person who builds the Live ISOs)
note: just to note why I did not have any problem installing Mageia - I have my own grub2 (OS-independent) bootloader (both bios-legacy and uefi systems) which will boot up any OS with or without any bootloader or on other bootloaders (systemd-boot, refind or grub-legacy (that's how I installed Mageia when grub-legacy was default) - and I also have refind and systemd-boot bootloaders in some of my OS's)

I use rEFInd myself.
martinw
 
Posts: 609
Joined: May 14th, '11, 10:59

Re: Mageia live dvd on usb wants to boot as uefi

Postby gohlip » Feb 6th, '18, 11:44

Already done ;-) (BTW, currently I am the person who builds the Live ISOs)

Great! I am pleasantly surprised on 2 counts.
1. "Already done" That's quick. Must be a record for Mageia. :lol:
2. A developer on the forum? Must be my lucky day. :D


Sarcasm aside, Thanks! I've one more reason to continue to like Mageia.

Cheers.
Why do we live? To prove not everything in nature has a purpose.
gohlip
 
Posts: 573
Joined: Jul 9th, '12, 10:50


Return to Basic support

Who is online

Users browsing this forum: No registered users and 1 guest

cron