2

how can i boot the iso files from the raid 1 in grub2?

i have a raid 1 (intel raid, ntfs) with some boot iso files. once i selected the entry in the grub2 boot menu say ubuntu iso, it booted and the splash screen shown, but a few seconds later it showed "/iso/xxx.iso" not found and stopped, which "/iso/xxx.iso" is the real path to the iso file on the raid 1.

here's what the entry looks like:

set isofile="/iso/linux.iso"
search --fs-uuid --no-floppy --set=root RAID_1_UUID
loopback loop (${root})$isofile

i also tried to run the above lines in the grub2 command prompt and i could see the file, so both set root and loopback work but i think the os (inside the iso) couldnt find the iso to load the kernel, perhaps they cant read the raid at this point. i booted another iso but it prompted "cannot mount /dev/sdd" and "cannot mount /dev/sde" (the raid partitions), and gparted iso showed a message that i should mount the raid before loading.

although i finally managed to boot it by adding "toram" to the kernel parameter, i am unable to boot other iso files like gparted, etc

so what's the proper way to do it? i have googled but didnt find anything related to booting iso files stored on the raid 1.

thanks

edit, for example, this entry works before the raid1 is created but now will show "cannot find //iso/Porteus-CINNAMON-v4.0-x86_64.iso" during boot (note the double slashes there)

   menuentry 'Porteus CINNAMON v4.0' {
    set isofile="/iso/Porteus-CINNAMON-v4.0-x86_64.iso"
    search --fs-uuid --no-floppy --set=root $raid_uuid
    loopback loop (${root})$isofile
    linux (loop)/boot/syslinux/vmlinuz from=$isofile copy2ram noswap noauto login=guest quiet timezone=Asia/Hong_Kong kmap=us
    initrd (loop)/boot/syslinux/initrd.xz
    boot
}
  • Grub has a lot of .mod files or loadable modules for drivers that are not default. See /boot/grub/x86_64-efi. There may be one for your type of RAID of at least work with it. I see two labeled as RAID. You use the loadable modeles like this from my grub insmod part_gpt which grub added itself as it saw I used gpt. – oldfred May 18 '19 at 20:26
  • i have insmod mdraid1x but still couldnt find the iso. eg the entry above (just added) failed to boot due to "cannot find xxx.iso" – johnsonttc May 19 '19 at 11:58
  • Do you set $raid_uuid somewhere? See https://ubuntuforums.org/showthread.php?t=1769482&page=163 & https://gist.github.com/Pysis868/27203177bdef15fbb70c I have always found getting path & drive correct as major issues. I now use labels and a configfile in grub, so I only edit a text file and do not have to remember to run sudo update-grub with every edit. But still have issues with drive numbers changing when rebooting with flash drive plugged in. https://askubuntu.com/questions/344125/how-to-add-a-grub2-menu-entry-for-booting-installed-ubuntu-on-a-usb-drive – oldfred May 19 '19 at 14:22
  • yes of coz. since i have a number of entries and i didnt want to change all of them every time so i use a variable to store the uuid. i used to use path before but since the x y etc will change when adding new disks so i used uuid instead and that the uuid is correct since i can boot ubuntu/mint with the same uuid with toram – johnsonttc May 19 '19 at 18:02
  • and some more info, 1 of the iso files reported mounting /dev/sda .... /dev/mapped/iswxxxxxxx during boot but still unable to find the iso required – johnsonttc May 19 '19 at 18:09
  • and when i tried to add to ram/copytoram etc with the above or other entries it didn't work, could be due to different distro – johnsonttc May 19 '19 at 18:16
  • Have only booted Ubuntu & gparted with loopmount. Found Debian does not yet allow grub loopmount, so not all ISO can be booted that way. – oldfred May 19 '19 at 18:24
  • but i could boot all of them before making the drive to raid1 and the only changes was the raid_uuid – johnsonttc May 19 '19 at 18:49

0 Answers0