Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Assistance Unsupported Software
  • Search

Creating multi-boot USB drives [SOLVED]

This forum covers all Gentoo-related software not officially supported by Gentoo. Ebuilds/software posted here might harm the health and stability of your system(s), and are not supported by Gentoo developers. Bugs/errors caused by ebuilds from overlays.gentoo.org are covered by this forum, too.
Post Reply
Advanced search
7 posts • Page 1 of 1
Author
Message
tld
Veteran
Veteran
Posts: 1889
Joined: Tue Dec 09, 2003 9:35 pm

Creating multi-boot USB drives [SOLVED]

  • Quote

Post by tld » Mon Dec 07, 2020 10:02 pm

I'm looking for any suggestions as to something for creating multi-boot USB drives. I tried to install MultiBootUSB from a repo here:

https://gpo.zugaina.org/sys-boot/multibootusb

That required udisks which I didn't have...nor dbus, polkit, etc. That sent me into the rabbit hole from hell which is that whole polkit thing with the spidermonkey dependency. No way will I accept that, so I hunted down one of the ebuilds for polkit with duktape instead of spidermonkey. After struggling through that mess and installing tons of stuff I really do NOT want, I was able to install MultiBootUSB 9.2.0, but ran into this unresolved bug:

https://github.com/mbusb/multibootusb/issues/468

Code: Select all

multibootusb -c
Using python version  3.7.9 (default, Oct  4 2020, 13:16:32) 
[GCC 9.3.0] on platform Linux-5.4.72-gentoo-i686-Intel-R-_Pentium-R-_4_CPU_2.53GHz-with-gentoo-2.7
Traceback (most recent call last):
  File "/usr/lib/python-exec/python3.7/multibootusb", line 187, in <module>
    if config.debug is True:
NameError: name 'config' is not defined
That's starting to give me the impression that MultiBootUSB is hopeless...especially given how many others got that and the fact that it's not resolved.

NOT very promising. Any suggestions? Thanks!

Tom
Last edited by tld on Wed Dec 09, 2020 11:52 am, edited 1 time in total.
Top
DawgG
l33t
l33t
User avatar
Posts: 880
Joined: Wed Sep 17, 2003 12:31 pm

  • Quote

Post by DawgG » Tue Dec 08, 2020 11:06 am

it's possible with grub2 alone; i did it a long time ago (with a grml-iso, i think). just install grub2 to the usb-drive and write a config that loopback-mounts the iso(s) (which must support this, but nowadays most isos do.)
a quick websearch turned up this short explanation: https://www.pendrivelinux.com/boot-mult ... ing-linux/
GOOD LUCK!
DUMM KLICKT GUT.
Top
tld
Veteran
Veteran
Posts: 1889
Joined: Tue Dec 09, 2003 9:35 pm

  • Quote

Post by tld » Tue Dec 08, 2020 2:41 pm

Yea...thanks for the suggestion! That may be the way to go, though I'd probably do it with syslinux instead if possible (which is what I use on all my machines). Thanks for the link too.

Tom

EDIT: Interesting...this looks promising:

https://wiki.archlinux.org/index.php/Mu ... nd_memdisk
Top
tld
Veteran
Veteran
Posts: 1889
Joined: Tue Dec 09, 2003 9:35 pm

  • Quote

Post by tld » Tue Dec 08, 2020 10:34 pm

Wow. All I've accomplished so far is proving to myself that there are about 1000 things here I don't understand...talk about a rabbit hole. Everything about this confuses me and I think I've managed to generate every possible error there is in syslinux.

Gave up for now.

Tom
Top
Irre
Guru
Guru
Posts: 434
Joined: Sat Nov 09, 2013 10:03 am
Location: Stockholm

  • Quote

Post by Irre » Wed Dec 09, 2020 7:13 am

Create an ext2 boot partition. Install LILO bootloader. Configure and run lilo. Done. :)
Top
tld
Veteran
Veteran
Posts: 1889
Joined: Tue Dec 09, 2003 9:35 pm

  • Quote

Post by tld » Wed Dec 09, 2020 11:51 am

I actually got this working with syslinux. It was pretty confusing but I'll try to lay out what I did (hopefully I'll get all this right). What I did was similar to what's described here:

https://wiki.archlinux.org/index.php/Mu ... nd_memdisk

A few things to note: As noted above the ISO used gets loaded into memory so this isn't suitable for very large images. In my case the USB device was /dev/sdc and I mounted it's one partition at the directory /mnt/sdc1. Adjust these for your specific case of course.

Since the USB drive had an existing image put on it with dd I used fdisk to remove the partitions. Then I creates 1 primary partition, and used the "a" option to enable the boot option on that partition. Then I did the following:

I created a fat file system with:

Code: Select all

mkfs.vfat /dev/sdc1
Then I added the syslinux MBR (be VERY careful):

Code: Select all

dd bs=440 conv=notrunc count=1 if=/usr/share/syslinux/mbr.bin of=/dev/sdc
Then I mounted it with:

Code: Select all

mount /dev/sdc1 /mnt/sdc1
...and did the following:

Code: Select all

mkdir -p /mnt/sdc1/boot/extlinux
extlinux --install /mnt/sdc1/boot/extlinux
cd /usr/share/syslinux
cp menu.c32 memdisk libcom32.c32 libutil.c32 /mnt/sdc1/boot/extlinux
Then I created the syslinux config file at /mnt/sdc1/boot/extlinux/syslinux.cfg with this:

Code: Select all

cat /mnt/sdc1/boot/extlinux/syslinux.cfg 
UI menu.c32

LABEL wdlifeguard.iso
	LINUX memdisk
	INITRD /wdlifeguard.img
	APPEND raw

LABEL clonezilla-live-2.7.0-10-amd64.iso
	LINUX memdisk
	INITRD /clonezilla-live-2.7.0-10-amd64.iso
	APPEND iso

LABEL memtest86+-5.01.iso
	LINUX memdisk
	INITRD /memtest86+-5.01.iso
	APPEND iso
Note that all the files in those INITRD lines were copied to the root of the file system...that is, to /mnt/sdc1 in my case. Also note that, as per the explanation here:

https://wiki.syslinux.org/wiki/index.ph ... DISK#Usage

...that wdlifeguard.img (Western Digital Lifeguard) uses "APPEND raw" as it's a DOS disk (that boots to an A:> prompt) while the other two are bootable ISO images and use "APPEND iso".

Note that I tested this on a Windows laptop and that required going into the setup a) disabling secure boot, and b) allowing both UEFI or legacy BIOS booting. In any case, sure enough I got a menu with those three options and they all worked.

Tom
Top
tld
Veteran
Veteran
Posts: 1889
Joined: Tue Dec 09, 2003 9:35 pm

  • Quote

Post by tld » Mon Jan 04, 2021 12:23 am

An update to this: The multi-boot USB created with syslinux and memdisk was so unreliable on my system I had to abandon it. Looking further into this, I just don't see any good options for doing this. The problem with using grub2 and loopback mounts is that a) You loose any boot menu that the existing image may have had, and b) The grub.cfg file on your USB drive needs to have entries for each boot option, which means you need to know the exact boot options you want for each. Really ugly.

I also looked into using refind, where you can apparently do this by having separate file systems for each system you want to boot, and writing the raw images to those partitions. The problem I see with that is that....unless I'm missing something...it only appears to find bootable Linux system and not systems from other iso images...at least it seems that way.

On my new AMD based system I was trying booting to actual CDs using a USB burner I have. For whatever reason, I'm having issues even with that, specifically for booting Linux systems. For example, I can write a clonzilla ISO image to a USB drive with dd and it works perfectly. However if I burn the exact same ISO to a CD (for example using cdrdao) which I've been doing forever, it start to boot from the CD but then does really screwy crap like complaining about unknopwn file systems, and won't boot. Totally sucks.

Tom
Top
Post Reply

7 posts • Page 1 of 1

Return to “Unsupported Software”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy

 

 

magic