How to boot mageia.iso from hard disk with grub4dos/grub2?

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

How to boot mageia.iso from hard disk with grub4dos/grub2?

Postby liuzhaoyzz » Mar 20th, '22, 02:38

How to boot mageia.iso from hard disk with grub4dos/grub2?

#grub4dos
Code: Select all
title /linux2/Mageia/Mageia-8-Live-Xfce-x86_64.iso[free_driver]
find --ignore-floppies --ignore-cd --set-root /linux2/Mageia/Mageia-8-Live-Xfce-x86_64.iso
map /linux2/Mageia/Mageia-8-Live-Xfce-x86_64.iso (hd32) ;; map --hook
kernel (hd32)/boot/vmlinuz  iso-scan/filename=/linux2/Mageia/Mageia-8-Live-Xfce-x86_64.iso  root=mgalive:LABEL=Mageia-8-Live-Xfce-x86_64 ro lang=zh_CN kbd=en_US noiswmd audit=0 rd.luks=0 rd.lvm=0 rd.md=0 rd.dm=0 noxconf xdriver=free
initrd (hd32)/boot/initrd.img


#grub2
Code: Select all
menuentry "/linux2/Mageia/Mageia-8-Live-Xfce-x86_64.iso[free_driver]" "/linux2/Mageia/Mageia-8-Live-Xfce-x86_64.iso" {
set gfxpayload=keep
search --no-floppy --set --file $2
loopback loop $2
linux (loop)/boot/vmlinuz root=mgalive:LABEL=Mageia-8-Live-Xfce-x86_64 ro lang=zh_CN kbd=en_US noiswmd audit=0 rd.luks=0 rd.lvm=0 rd.md=0 rd.dm=0 noxconf xdriver=free
initrd (loop)/boot/initrd.img
}


The menu above can't boot mageia.iso from hard disk.
Does mageia kernel support iso-scan/filename or other boot code like debian/ubuntu/fodera?
Last edited by liuzhaoyzz on Mar 29th, '22, 07:59, edited 2 times in total.
liuzhaoyzz
 
Posts: 15
Joined: Mar 16th, '22, 12:49

Re: How to boot mageia.iso from hard disk with grub4dos/grub

Postby benmc » Mar 20th, '22, 06:57

for Live.isos, have a look here=> https://wiki.mageia.org/en/Booting_Mage ... sing_grub2

for Traditional / Classical Install .isos, have a look here => https://wiki.mageia.org/en/Installing_M ... sing_grub2
benmc
 
Posts: 1213
Joined: Sep 2nd, '11, 12:45
Location: Pirongia, New Zealand

Re: How to boot mageia.iso from hard disk with grub4dos/grub

Postby liuzhaoyzz » Mar 20th, '22, 11:29

I have seen the post above,but it seems do the similar thing like me,it won't work.

And I have seen the similar post: viewtopic.php?f=15&t=11364&p=66189&hilit=grub4dos#p66189
It won't work for Mageia-8-Live-Xfce-x86_64.iso,too.

I saw isofile boot code,but it seems work with network install.
Code: Select all
menuentry "Mageia 8 Network Install nonfree x86_64.iso" {
        insmod gzio
        insmod part_gpt
        insmod ext2
        insmod xfs
        insmod loopback
        insmod iso9660
        insmod udf
        set isofile="Mageia-8-netinstall-nonfree-x86_64.iso"
        set root="hd0,gpt5"
        loopback loop (hd0,gpt5)\$isofile
        linux (loop)/isolinux/x86_64/vmlinuz [b]isofile=\$isofile[/b]
        initrd (loop)/isolinux/x86_64/all.rdz
}


root=mgalive:LABEL=$name wont't work...
menuentry "Live Boot" {
set name=Mageia-8-Live-Plasma-x86_64
set isofile="/$name.iso"
loopback loop (hd0,20)$isofile
linux (loop)/boot/vmlinuz [b]root=mgalive:LABEL=$name[/b] rd.live.image noiswmd vga=788 splash quiet noxconf
initrd (loop)/boot/initrd.img
}
Last edited by doktor5000 on Mar 20th, '22, 12:02, edited 2 times in total.
Reason: Please place command-output between [CODE]-tags, to improve readability, thanks ahead!!! ;)
liuzhaoyzz
 
Posts: 15
Joined: Mar 16th, '22, 12:49

Re: How to boot mageia.iso from hard disk with grub4dos/grub

Postby benmc » Mar 20th, '22, 20:22

for the Live, the example given for the Plasma .iso stored at (hd0,20)
where is your Mageia-8-Live-Xfce-x86_64.iso stored(hd?,?), and is it a btrfs partition?

for the Live Xfce.iso, you would have to :
create the btrfs partition and label it "Mageia-8-Live-Xfce-x86_64"
then 'name' becomes 'name=Mageia-8-Live-Xfce-x86_64'
in the 'loopback loop (hd0,20)$isofile' line, you would put your partition #, as, in the example 1st hd (hd0), twentieth partition (,20), yours will likely be different.

If you want to install from the Live, you will need to create the btrfs partition on a HDD/SSD different than the target HDD/SSD, so a multi HDD/SSD system is required.
This is a function of how the Live installer works, so, an enhancement request has been created to allow use on a single HDD/SSD system ( https://bugs.mageia.org/show_bug.cgi?id=30096: allow draklive-install to run and complete from internal boot device if only 1 internal boot device(via grub2 entry) )

hope this helps.
benmc
 
Posts: 1213
Joined: Sep 2nd, '11, 12:45
Location: Pirongia, New Zealand

Re: How to boot mageia.iso from hard disk with grub4dos/grub

Postby liuzhaoyzz » Mar 21st, '22, 01:41

I put mageia in the directory /linux2/mageia/mageia-8-live-xfce-x86 _ 64.iso.
Grub4dos/grub2 menu has the following statement:
find --ignore-floppies --ignore-cd --set-root /linux2/Mageia/Mageia-8-Live-Xfce-x86_64.iso
search --no-floppy --set --file /linux2/Mageia/Mageia-8-Live-Xfce-x86_64.iso
The above statement will set the drive letter of mageia to root, so it can be placed in any partition supported by grub4dos/grub2, and this file is unique.
I tried to put it in the FAT/EXFAT/NTFS/EXT4 partition, and the result was the same. I didn't try to put it in the btrfs partition.


I'm sure Mageia-8-Live-Xfce-x86_64.iso. The label of this iso is mageia-8-live-xfce-x86 _ 64.
liuzhaoyzz
 
Posts: 15
Joined: Mar 16th, '22, 12:49

Re: How to boot mageia.iso from hard disk with grub4dos/grub

Postby benmc » Mar 21st, '22, 02:23

do you have any error messages from the grub terminal when the boot fails?
benmc
 
Posts: 1213
Joined: Sep 2nd, '11, 12:45
Location: Pirongia, New Zealand

Re: How to boot mageia.iso from hard disk with grub4dos/grub

Postby liuzhaoyzz » Mar 21st, '22, 05:16

Later,I try to upload a screenshot.
Attachments
linux64 位-2022-03-21-12-22-23.png
linux64 位-2022-03-21-12-22-23.png (18.24 KiB) Viewed 51874 times
linux64 位-2022-03-21-12-19-52.png
linux64 位-2022-03-21-12-19-52.png (24.73 KiB) Viewed 51874 times
linux64 位-2022-03-21-12-17-19.png
linux64 位-2022-03-21-12-17-19.png (27.4 KiB) Viewed 51874 times
liuzhaoyzz
 
Posts: 15
Joined: Mar 16th, '22, 12:49

Re: How to boot mageia.iso from hard disk with grub4dos/grub

Postby benmc » Mar 21st, '22, 08:53

were these photos from a grub4dos or Grub2 boot?

Have a look at timestamp 139:55.... through
Code: Select all
264:126.... Scanning for all  btrfs devices.
As earlier suggested, this implies that a btrfs file system is required. You can create one via diskdrake (if using Mageia) or gParted.

Looking at timestamp
Code: Select all
264:151...dracut Warning: /dev/disk/by-label/Mageia-8-Live-Xfce-x86_64 does not exist
This implies that you do not have a partition (/dev/disk/) labelled "Mageia-8-Live-Xfce-x86_64".
[edit: should you have burned the Mageia-8-Live-Xfce-x86_64.iso to DVd or USB, they would have the label "Mageia-8-Live-Xfce-x86_64". as you have a partition, it should be labelled "Mageia-8-Live-Xfce-x86_64". end edit]
So, your boot method indicates that you are required to label one "Mageia-8-Live-Xfce-x86_64", (ideally the one that has the "Mageia-8-Live-Xfce-x86_64.iso" in it. ;) )
As only a btrfs file system supports this many characters for a label, you require a btrfs partition.

I am impressed that you have managed to boot the Mageia-8-Live-Xfce-x86_64.iso thus far.
Would you mind posting your etc/grub.d/40_custom file if you are using one to create your grub2 entry?
Last edited by benmc on Mar 21st, '22, 09:44, edited 1 time in total.
benmc
 
Posts: 1213
Joined: Sep 2nd, '11, 12:45
Location: Pirongia, New Zealand

Re: How to boot mageia.iso from hard disk with grub4dos/grub

Postby liuzhaoyzz » Mar 21st, '22, 09:42

It's very strange Mageia need btrfs,why fat/ext4 not work???Most of linux distros support ext4.

Later I will try btrfs,now I reply with my mobilephone.

The label is right,I'm sure.Maybe mageia can't read iso from ext4 partition?

etc/grub.d/40_custom,I will upload later.
liuzhaoyzz
 
Posts: 15
Joined: Mar 16th, '22, 12:49

Re: How to boot mageia.iso from hard disk with grub4dos/grub

Postby benmc » Mar 21st, '22, 10:00

Mageia can surely read ext4 partitions, it is the usual default file system type.
Should you boot a Classical.iso from internal partition, ext4 partitions are fine, it is just the Lives that are *particular*.

I cannot answer why, when Live booting from grub2 on a internal partition, it requires a btrfs system, as, when booted from a USB, it is a "Hidden HPFS/NTFS"

the label will have been truncated to be "Mageia-8-Live-Xf", I found this myself when trying to Live boot from a partition.
Mageia-8-Live-Xf.png
Mageia-8-Live-Xf.png (44.61 KiB) Viewed 51865 times
Last edited by benmc on Mar 21st, '22, 10:10, edited 1 time in total.
benmc
 
Posts: 1213
Joined: Sep 2nd, '11, 12:45
Location: Pirongia, New Zealand

Re: How to boot mageia.iso from hard disk with grub4dos/grub

Postby liuzhaoyzz » Mar 21st, '22, 10:08

Can Mageia use uuid instead of label?
I tried uuid,but failed.
liuzhaoyzz
 
Posts: 15
Joined: Mar 16th, '22, 12:49

Re: How to boot mageia.iso from hard disk with grub4dos/grub

Postby benmc » Mar 21st, '22, 10:12

liuzhaoyzz wrote:Can Mageia use uuid instead of label?


the failure indicated by your photo (/dev/disk/by-label), which I also experienced, would imply that the Lives will not.

Mageia does use UUIDs as partition indentifiers
benmc
 
Posts: 1213
Joined: Sep 2nd, '11, 12:45
Location: Pirongia, New Zealand

Re: How to boot mageia.iso from hard disk with grub4dos/grub

Postby liuzhaoyzz » Mar 21st, '22, 11:40

LABEL=Mageia-8-Live-Xf
I got the same fail.
liuzhaoyzz
 
Posts: 15
Joined: Mar 16th, '22, 12:49

Re: How to boot mageia.iso from hard disk with grub4dos/grub

Postby liuzhaoyzz » Mar 21st, '22, 11:44

As only a btrfs file system supports this many characters for a label, you require a btrfs partition.


No,the label should refer to the mageia.iso,not the partition of where mageia.iso is located.
liuzhaoyzz
 
Posts: 15
Joined: Mar 16th, '22, 12:49

Re: How to boot mageia.iso from hard disk with grub4dos/grub

Postby liuzhaoyzz » Mar 21st, '22, 11:48

etc/grub.d/40_custom,I didn't find,maybe because mageia didn't boot.
liuzhaoyzz
 
Posts: 15
Joined: Mar 16th, '22, 12:49

Re: How to boot mageia.iso from hard disk with grub4dos/grub

Postby liuzhaoyzz » Mar 21st, '22, 11:52

I put mageia.iso in ext4 partition,I got the same fail,so I don't think it is because of btrfs partition.
Maybe when mageia was installed to disk,it will use btrfs partiton?
liuzhaoyzz
 
Posts: 15
Joined: Mar 16th, '22, 12:49

Re: How to boot mageia.iso from hard disk with grub4dos/grub

Postby benmc » Mar 21st, '22, 20:18

live boot partition name.png
live boot partition name.png (73.3 KiB) Viewed 51791 times
example of Live boot from btrfs partition (/dev/sda6).
I could find no other way of Live booting from a partition.

please copy/paste your grub2 menuentry for your current Mageia-8-Live-Xfce-x86_64.iso boot attempt , thanks

liuzhaoyzz wrote:root=mgalive:LABEL=Mageia-8-Live-Xfce-x86_64

this means that you need a device (DVD-rom, USB or partition) with the LABEL "Mageia-8-Live-Xfce-x86_64"
an ext4 partition has a label limit of 16 characters ( Mageia-8-Live-Xf ) so cannot be used.
a btrfs partition does not have this limit, and will allow the partition label to be correct (Mageia-8-Live-Xfce-x86_64)
benmc
 
Posts: 1213
Joined: Sep 2nd, '11, 12:45
Location: Pirongia, New Zealand

Re: How to boot mageia.iso from hard disk with grub4dos/grub

Postby benmc » Mar 22nd, '22, 00:04

removed as not valid
benmc
 
Posts: 1213
Joined: Sep 2nd, '11, 12:45
Location: Pirongia, New Zealand

Re: How to boot mageia.iso from hard disk with grub4dos/grub

Postby liuzhaoyzz » Mar 22nd, '22, 02:06

In porteus,veket,slitaz,gparted, I can't format a partition into btrfs,it is gray.
I will try another linux dirtro later.
liuzhaoyzz
 
Posts: 15
Joined: Mar 16th, '22, 12:49

Re: How to boot mageia.iso from hard disk with grub4dos/grub

Postby liuzhaoyzz » Mar 22nd, '22, 06:49

ubuntu-20.10-desktop-amd64,gparted,I format /dev/sdc3 to btrfs,but I can't make directory or copy/paste any files into it.
ext4,either.
FAT32/EXFAT/NTFS can read and write files.
maybe it was mounted as read-only.
Attachments
linux64 位-2022-03-22-12-42-52.png
linux64 位-2022-03-22-12-42-52.png (77.09 KiB) Viewed 51734 times
linux64 位-2022-03-22-12-42-32.png
linux64 位-2022-03-22-12-42-32.png (66.35 KiB) Viewed 51734 times
liuzhaoyzz
 
Posts: 15
Joined: Mar 16th, '22, 12:49

Re: How to boot mageia.iso from hard disk with grub4dos/grub

Postby benmc » Mar 26th, '22, 23:55

I have created a bug report: https://bugs.mageia.org/show_bug.cgi?id=30206.

there is an example (#comment 11) that gives an ext partition boot, but it also requires an .isos extracted contents to operate.
benmc
 
Posts: 1213
Joined: Sep 2nd, '11, 12:45
Location: Pirongia, New Zealand

Re: How to boot mageia.iso from hard disk with grub4dos/grub

Postby liuzhaoyzz » Mar 28th, '22, 05:07

Martin Whitaker 2022-03-26 11:48:26 CET
This doesn't work because the GRUB loopback command only sets up a loopback device for use by GRUB itself. Once control is passed to the Linux kernel, that loopback has gone.

What Martin Whitaker said was right.

As you cited,https://www.linuxbabe.com/desktop-linux/boot-from-iso-files-using-grub2-boot-loader
Ubuntu -iso-scan/filename
Debian -findiso
Arch -img_loop
Clonezilla -findiso
RHEL 8/CentOS-inst.stage2
Fedora- iso-scan/filename
OpenSUSE -iso-scan/filename
Kali -findiso
Linux Mint-iso-scan/filename

But,what is the boot code for Mageia?What is the boot code to mount the iso and pass it to the linux kernel?That is the crucial point.
I have mentioned this in the first post.
Maybe Mageia didn't have such boot code.It does not handle the iso when boot by grub4dos/grub2.

Mageia uses systemd instead of init,all the boot codes are not visible,systemd is very complicated.
I didn't see any handbook about this in Mageia home page.
Who can get the boot code from the source code of Mageia?
Last edited by liuzhaoyzz on Mar 28th, '22, 05:20, edited 1 time in total.
liuzhaoyzz
 
Posts: 15
Joined: Mar 16th, '22, 12:49

Re: How to boot mageia.iso from hard disk with grub4dos/grub

Postby liuzhaoyzz » Mar 28th, '22, 05:11

By the way,I don't want to boot Mageia with partnew,partnew need 3 main partition,and it requires iso must have not fragment,it support only MBR partition.

And I don't want to extract iso to boot,for I don't think it is necessary.I'm not very interested in this.
liuzhaoyzz
 
Posts: 15
Joined: Mar 16th, '22, 12:49

Re: How to boot mageia.iso from hard disk with grub4dos/grub

Postby liuzhaoyzz » Mar 31st, '22, 09:15

Looking forward Mageia support loopback.cfg,not loopback.
Code: Select all
menuentry "TITLE" {
  iso_path=PATH
  export iso_path
  search --set=root --file $iso_path
  loopback loop $iso_path
  root=(loop)
  configfile /boot/grub/loopback.cfg
  loopback --delete loop
}


https://www.supergrubdisk.org/wiki/Loopback.cfg
liuzhaoyzz
 
Posts: 15
Joined: Mar 16th, '22, 12:49


Return to Basic support

Who is online

Users browsing this forum: No registered users and 1 guest