How to figure out the necessary boot parameters to boot an iso file from a multiboot usb driver?
0
votes
0
answers
571
views
This is my first posting here and I would like to have asked a general question, namely "Is there a general procedure to deduce the boot parameters necessary to boot from an iso file on an usb drive, from the content of the iso file AND of another usb drive onto which the target iso file has been 'dd-ed'?" as I am not sure of how I should interpret the information on the introductory tour as to the kind of questions appreciated and I am therefore presenting one of 3 concrete actual practical problems I am struggling with.
If there is excessive verbose it is because I understood that you prefer lots of detail. Let me know if I have overdone and it won't happen again.
I am trying to add Void Linux iso to the multiboot hybrid usb I travel with.
Testing is being done on a Bios machine (Fujitsu Lifebook) and I am getting dracut warnings like
*
could not boot
* /dev/root does not exist
* mount: /sysroot: special device /dev/mapper/live-rw does not exist
The structure of the usb is the following:
sdc 8:32 1 57.8G 0 disk
├─sdc1 8:33 1 33M 0 part # bios boot
├─sdc2 8:34 1 512M 0 part # ESP
├─sdc3 8:35 1 8G 0 part /run/media/anon/artix
└─sdc4 8:36 1 49.2G 0 part /run/media/anon/ISOs
Where sdc3 contains a minimal, base install of artix Linux which holds Grub.
Path to Void's iso file in sdc4 is: /MocaccinoOS-MATE-0.20220903.iso
I have also expanded its content to a folder in sdc4: /loop_mounting/Void
I have been trying different menu entries by varying which version (iso vs expanded) and which value I asign to 'root' in the linux command line - ('VOID_LIVE' vs 'ISOs') and ('root:live=CDLABEL=' vs 'root_LABEL=').
The choice of 'VOID_LINUX' was due to the output below:
[esprimo-II wan]# lsblk -f
NAME FSTYPE FSVER LABEL UUID FSAVAIL FSUSE% MOUNTPOINTS
loop0 iso966 Jolie VOID_LIVE 2022-10-01-18-20-01-00 0 100% /mnt/iso
The initial part of my grub.cfg grub.cfg (i.e. that before the entries):
# Config for GNU GRand Unified Bootloader (GRUB)# /boot/grub/grub.cfg
# januari 12, 2023
# Timeout for menu
set timeout=-1
# Default boot entry
set default=0
# Menu Colours
set menu_color_normal=white/black
set menu_color_highlight=white/green
# persistent block device naming
# define globally (i.e outside any menuentry)
insmod search_fs_uuid
insmod gzio
insmod part_gpg
insmod part_msdos
insmod fat
insmod loopback
insmod iso9660
insmod ext2
insmod all_video
set gfxpayload=keep
set root=(hd0,gpt4)
The entries I used in the initial tests fo this post:
menuentry "void iso" {
set isofile='/void-live-x86_64-20221001-xfce.iso'
loopback loop $isofile
probe --label --set=cd_label (loop)
bootoptions="iso-scan/filename=$isofile findiso=$isofile root=live:CDLABEL=$cd_label init=/sbin/init ro rd.luks=0 rd.md=0 rd.dm=0 loglevel=4 vconsole.unicode=1 vconsole.keymap=us locale.LANG=en_US.UTF-8"
# bootoptions="iso-scan/filename=$isofile findiso=$isofile root=live:CDLABEL=VOID_LIVE init=/sbin/init ro rd.luks=0 rd.md=0 rd.dm=0 loglevel=4 vconsole.unicode=1 vconsole.keymap=us locale.LANG=en_US.UTF-8"
# bootoptions="iso-scan/filename=$isofile findiso=$isofile root=live:CDLABEL=ISOs init=/sbin/init ro rd.luks=0 rd.md=0 rd.dm=0 loglevel=4 vconsole.unicode=1 vconsole.keymap=us locale.LANG=en_US.UTF-8"
# bootoptions="iso-scan/filename=$isofile findiso=$isofile root=LABEL=ISOs init=/sbin/init ro rd.luks=0 rd.md=0 rd.dm=0 loglevel=4 vconsole.unicode=1 vconsole.keymap=us locale.LANG=en_US.UTF-8"
# bootoptions="iso-scan/filename=$isofile findiso=$isofile root=LABEL=VOID_LINUX init=/sbin/init ro rd.luks=0 rd.md=0 rd.dm=0 loglevel=4 vconsole.unicode=1 vconsole.keymap=us locale.LANG=en_US.UTF-8"
linux (loop)/boot/vmlinuz $bootoptions
initrd (loop)/boot/initrd
}
menuentry "void expanded" {
bootoptions="root=live:CDLABEL=ISOs init=/sbin/init ro rd.luks=0 rd.md=0 rd.dm=0 loglevel=4 vconsole.unicode=1 vconsole.keymap=us locale.LANG=en_US.UTF-8
# bootoptions="root=LABEL=ISOs init=/sbin/init ro rd.luks=0 rd.md=0 rd.dm=0 loglevel=4 vconsole.unicode=1 vconsole.keymap=us locale.LANG=en_US.UTF-8"
# bootoptions="root=live:CDLABEL=VOID_LINUX init=/sbin/init ro rd.luks=0 rd.md=0 rd.dm=0 loglevel=4 vconsole.unicode=1 vconsole.keymap=us locale.LANG=en_US.UTF-8"
# bootoptions="root=LABEL=VOID_LINUX init=/sbin/init ro rd.luks=0 rd.md=0 rd.dm=0 loglevel=4 vconsole.unicode=1 vconsole.keymap=us locale.LANG=en_US.UTF-8"
linux /loop_mounting/Void/boot/vmlinuz $bootoptions
initrd /loop_mounting/Void//boot/initrd
}
a) 'root=live:CDLABEL=$cd_label' ended with dracut warnings:
- "could not boot"
- "/dev/disk/by-label/VOID_LIVE does not exist"
- "/dev/root does not exist"
more at rdsosreport_1_0117 (attach.)
b) 'root=live:CDLABEL=VOID_LIVE' - I did not run this one because in the trial above it was reported that the value of 'cdlabel\ was "VOID_LIVE"
c) 'root=live:CDLABEL=ISOs' - dracut warning: 'can't mount root file system' after
"mount: /sysroot: special device /dev/mapper/live-rw does not exist"
more at rdsosreport_3_0117 (attach.)
d) 'root=LABEL=VOID_LIVE' - dracut warnings:
- "could not boot"
- "/dev/disk/by-label/VOID_LIVE does not exist"
more at rdsosreport_4_0117 (attach.)
e) 'root=LABEL=ISOs' - - same result as I.c above
more at rdsosreport_5_0117 (attach.)
II) When booting from "void expanded":
a) 'root=live:CDLABEL=VOID_LIVE' - same result as in I.a
more at rdsosreport_6_0117 (attach.)
b) 'root=live:CDLABEL=ISOs' same result as in I.c
more at rdsosreport_7_0117 (attach.)
c) 'root=LABEL=VOID_LIVE' - -dracut warnings:
- "could not boot"
- "/dev/disk/by-label/VOID_LIVE does not exist"
more at rdsosreport_8_0117 (attach.)
d) 'root=LABEL=ISOs' - dracut warning: 'can't mount root file system'
more at rdsosreport_9_0117 (attach.)
`
Another usb drive, with iso file dd-ed onto it, boots nicely, and the
iso on the target multi usb driver has the correct check sum.
The structure of the iso file when loop mounted is:
├── boot
│ ├── grub
│ │ ├── efiboot.img
│ │ ├── fonts
│ │ │ └── unicode.pf2
│ │ ├── grub.cfg
│ │ └── grub_void.cfg
│ ├── initrd
│ ├── isolinux
│ │ ├── boot.cat
│ │ ├── chain.c32
│ │ ├── isolinux.bin
│ │ ├── isolinux.cfg
│ │ ├── ldlinux.c32
│ │ ├── libcom32.c32
│ │ ├── libutil.c32
│ │ ├── splash.png
│ │ └── vesamenu.c32
│ └── vmlinuz
└── LiveOS
└── squashfs.img
Here how lsblk lists the loop mounted iso file:
NAME LABEL MOUNTPOINT
loop0 VOID_LIVE /mnt/iso
These are the three boot entries in the loop mounted iso (which I copied into the target usb) is:
1 - /boot/isolinux/isolinux.cfg:
LABEL linux
MENU LABEL Void Linux 5.19.10_1 x86_64
KERNEL /boot/vmlinuz
APPEND initrd=/boot/initrd
root=live:CDLABEL=VOID_LIVE init=/sbin/init ro rd.luks=0 rd.md=0 rd.dm=0 loglevel=4 vconsole.unicode=1 vconsole.keymap=us locale.LANG=en_US.UTF-8 rd.live.overlay.overlayfs=1
LABEL linuxram
2 - /boot/grub/grub_void.cfg
set pager="1"
set locale_dir="(${voidlive})/boot/grub/locale"
if [ -e "${prefix}/${grub_cpu}-${grub_platform}/all_video.mod" ]; then
insmod all_video
else
insmod efi_gop
insmod efi_uga
insmod video_bochs
insmod video_cirrus
fi
insmod font
if loadfont "(${voidlive})/boot/grub/fonts/unicode.pf2" ; then
insmod gfxterm
set gfxmode="auto"
terminal_input console
terminal_output gfxterm
insmod png
background_image "(${voidlive})/boot/isolinux/splash.png"
fi
if [ cpuid -l ]; then
menuentry "Void Linux 5.19.10_1 (x86_64)" {
set gfxpayload="keep"
linux (${voidlive})/boot/vmlinuz \
root=live:CDLABEL=VOID_LIVE ro init=/sbin/init \
rd.luks=0 rd.md=0 rd.dm=0 loglevel=4 gpt add_efi_memmap \
vconsole.unicode=1 vconsole.keymap=us \
locale.LANG=en_US.UTF-8 rd.live.overlay.overlayfs=1
initrd (${voidlive})/boot/initrd
}
menuentry "Void Linux 5.19.10_1 (x86_64) (RAM)" {
set gfxpayload="keep"
linux (${voidlive})/boot/vmlinuz \
root=live:CDLABEL=VOID_LIVE ro init=/sbin/init \
rd.luks=0 rd.md=0 rd.dm=0 loglevel=4 gpt add_efi_memmap \
vconsole.unicode=1 vconsole.keymap=us \
locale.LANG=en_US.UTF-8 rd.live.overlay.overlayfs=1 rd.live.ram
initrd (${voidlive})/boot/initrd
}
fi
3- /boot/grub/grub.cfg
insmod usbms
insmod usb_keyboard
insmod part_gpt
insmod part_msdos
insmod fat
insmod iso9660
insmod udf
insmod ext2
insmod reiserfs
insmod ntfs
insmod hfsplus
insmod linux
insmod chain
search --file --no-floppy --set=voidlive "/boot/grub/grub_void.cfg"
source "(${voidlive})/boot/grub/grub_void.cfg"
This is how lsblk lists the dd-ed ('VOID-LIVE') usb:
NAME LABEL MOUNTPOINT
sdc VOID_LIVE
├─sdc1 VOID_LIVE /run/media/arthur/VOID_LIVE
└─sdc2 grub_uefi
The only differences I was able to identify between the tree structure of the loop mounted and of the LIVE (i.e. the dd-ed one) versions of the original iso file is the presence of a grub-uefi partition in the tree-structure of the LIVE usb and their respective paths as shown in the filemanager's box.
My intuition is that difference in paths must be related to labels which is what I use to point at my isos.
This is the content of the menu entry shown by the LIVE usb's GRUB-menu when I press 'e':
set gfxpayload="keep"
linux (${voidlive})/boot/vmlinuz root=live:CDLABEL=VOID_LABEL ro init=/sbin/init rd.luks=0 rd.md=0 rd.dm=0 loglevel=4 gpt add_efi_memmap vconsole.unicode=1 locale.LANG=en_us.UTF-8 rd.live.overlay.overlayfs=1
initrd (${voidlive})/boot/initrd
I have wondered how the variable 'voidlive'(which I suspect holds the solution) gets its value. I have no idea whatsoever except a suspicion that it may be negotiated between files '/boot/grub/grub.cfg' and '/boot/grub/grub_void.cfg'.
I have, since I started writing this post, done some more attempts which I may report here if desirable.
The entry used today was:
menuentry "Void ISO-Live"{
set root='hd0,gpt4'
set gfxpayload="keep"
linux /loop_mounting/Void/boot/vmlinuz root=live:CDLABEL=ISOs ro init=/sbin/init \
rd.luks=0 rd.md=0 rd.dm=0 rd.debug=1 loglevel=4 gpt add_efi_memmap vconsole.unicode=1 \
locale.LANG=en_us.UTF-8 rd.live.overlay.overlayfs=1
sleep 3
initrd /loop_mounting/Void/boot/initrd
}
It produced 'rdsosreport_12_230120.txt' which like the ones mentioned above are to large for me to dare including them in the post. I imagine I must find some place to put them online, as I did not see any links for attachments.
Here I will briefly quote a few of those parts I found most interesting:
1)
//lib/dracut/hooks/mount/99-mount-root.sh@130(mount_root): '[' -f /sysroot/forcefsck ']'
//lib/dracut/hooks/mount/99-mount-root.sh@131(mount_root): '[' -f /sysroot/.autofsck ']'
/init@249(): ismounted /sysroot
/lib/dracut-lib.sh@568(ismounted): findmnt /sysroot
/init@250(): usable_root /sysroot
/lib/dracut-lib.sh@742(usable_root): local _i
/lib/dracut-lib.sh@744(usable_root): '[' -d
/sysroot ']'
/lib/dracut-lib.sh@746(usable_root): for _i in "$1"/usr/lib*/ld-*.so "$1"/lib*/ld-*.so
/lib/dracut-lib.sh@747(usable_root): '[' -e '/sysroot/usr/lib*/ld-*.so' ']'
/lib/dracut-lib.sh@746(usable_root): for _i in "$1"/usr/lib*/ld-*.so "$1"/lib*/ld-*.so
/lib/dracut-lib.sh@747(usable_root): '[' -e '/sysroot/lib*/ld-*.so' ']'
/lib/dracut-lib.sh@750(usable_root): for _i in proc sys dev
/lib/dracut-lib.sh@751(usable_root): '[' -e /sysroot/proc ']'
/lib/dracut-lib.sh@751(usable_root): return 1
/init@251(): warn '/sysroot has no proper rootfs layout, ignoring and removing offending mount hook'
/lib/dracut-lib.sh@66(warn): check_quiet
/lib/dracut-lib.sh@488(check_quiet): '[' -z yes ']'
/lib/dracut-lib.sh@67(warn): echo 'dracut Warning: /sysroot has no proper rootfs layout, ignoring and removing offending mount hook'
/lib/dracut-lib.sh@68(warn): echo 'dracut Warning: /sysroot has no proper rootfs layout, ignoring and removing offending mount hook'
dracut Warning /sysroot has no proper rootfs layout, ignoring and removing offending mount hook
/init@252(): umount /sysroot
/init@253(): rm -f -- /lib/dracut/hooks/mount/99-mount-root.sh
2)
/init@257(): _i_mount=20
/init@258(): '[' 20 -gt 20 ']'
/init@242(): :
/init@243(): ismounted /sysroot
/lib/dracut-lib.sh@568(ismounted): findmnt /sysroot
/init@247(): for f in $hookdir/mount/*.sh
/init@248(): '[' -f '/lib/dracut/hooks/mount/*.sh' ']'
/init@249(): ismounted /sysroot
/lib/dracut-lib.sh@568(ismounted): findmnt /sysroot
/init@257(): _i_mount=21
/init@258(): '[' 21 -gt 20 ']'
/init@259(): flock -s 9
/init@259(): emergency_shell 'Can'''t mount root filesystem'
/lib/dracut-lib.sh@1094(emergency_shell): local _ctty
/lib/dracut-lib.sh@1095(emergency_shell): set +e
/lib/dracut-lib.sh@1096(emergency_shell): local _rdshell_name=dracut action=Boot hook=emergency
/lib/dracut-lib.sh@1097(emergency_shell): local _emergency_action
/lib/dracut-lib.sh@1099(emergency_shell): '[' 'Can'''t mount root filesystem' = -n ']'
/lib/dracut-lib.sh@1102(emergency_shell): '[' 'Can'''t mount root filesystem' = --shutdown ']'
/lib/dracut-lib.sh@1112(emergency_shell): echo
/lib/dracut-lib.sh@1112(emergency_shell): echo
/lib/dracut-lib.sh@1113(emergency_shell): warn 'Can'''t mount root filesystem'
/lib/dracut-lib.sh@66(warn): check_quiet
/lib/dracut-lib.sh@488(check_quiet): '[' -z yes ']'
/lib/dracut-lib.sh@67(warn): echo 'dracut Warning: Can'''t mount root filesystem'
/lib/dracut-lib.sh@68(warn): echo 'dracut Warning: Can'''t mount root filesystem'
dracut Warning: Can't mount root filesystem
/lib/dracut-lib.sh@1114(emergency_shell): echo
As mentioned above the same iso file boots fine when dd-ed into another usb drive, and the iso file in the target usb-drive is verified and has the correct checksum.
Asked by fredmyra
(1 rep)
Jan 22, 2023, 08:24 AM
Last activity: Jan 29, 2023, 11:25 AM
Last activity: Jan 29, 2023, 11:25 AM