Page 1 of 1

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

PostPosted: Mar 20th, '22, 02:38
by liuzhaoyzz
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?

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

PostPosted: Mar 20th, '22, 06:57
by benmc
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

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

PostPosted: Mar 20th, '22, 11:29
by liuzhaoyzz
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
}

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

PostPosted: Mar 20th, '22, 20:22
by benmc
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.

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

PostPosted: Mar 21st, '22, 01:41
by liuzhaoyzz
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.

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

PostPosted: Mar 21st, '22, 02:23
by benmc
do you have any error messages from the grub terminal when the boot fails?

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

PostPosted: Mar 21st, '22, 05:16
by liuzhaoyzz
Later,I try to upload a screenshot.

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

PostPosted: Mar 21st, '22, 08:53
by benmc
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?

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

PostPosted: Mar 21st, '22, 09:42
by liuzhaoyzz
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.

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

PostPosted: Mar 21st, '22, 10:00
by benmc
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 189051 times

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

PostPosted: Mar 21st, '22, 10:08
by liuzhaoyzz
Can Mageia use uuid instead of label?
I tried uuid,but failed.

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

PostPosted: Mar 21st, '22, 10:12
by benmc
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

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

PostPosted: Mar 21st, '22, 11:40
by liuzhaoyzz
LABEL=Mageia-8-Live-Xf
I got the same fail.

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

PostPosted: Mar 21st, '22, 11:44
by liuzhaoyzz
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.

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

PostPosted: Mar 21st, '22, 11:48
by liuzhaoyzz
etc/grub.d/40_custom,I didn't find,maybe because mageia didn't boot.

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

PostPosted: Mar 21st, '22, 11:52
by liuzhaoyzz
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?

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

PostPosted: Mar 21st, '22, 20:18
by benmc
live boot partition name.png
live boot partition name.png (73.3 KiB) Viewed 188977 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)

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

PostPosted: Mar 22nd, '22, 00:04
by benmc
removed as not valid

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

PostPosted: Mar 22nd, '22, 02:06
by liuzhaoyzz
In porteus,veket,slitaz,gparted, I can't format a partition into btrfs,it is gray.
I will try another linux dirtro later.

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

PostPosted: Mar 22nd, '22, 06:49
by liuzhaoyzz
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.

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

PostPosted: Mar 26th, '22, 23:55
by benmc
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.

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

PostPosted: Mar 28th, '22, 05:07
by liuzhaoyzz
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?

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

PostPosted: Mar 28th, '22, 05:11
by liuzhaoyzz
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.

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

PostPosted: Mar 31st, '22, 09:15
by liuzhaoyzz
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