I would like to put several bootable disks on seperate primary partitions on my usb flash drive and choose between them with a bootloader (GRUB) at boottime. However it would appear as if the opensuse live disk doesn’t work as a bootable partition. The MBR in the first sector only works if written on the first sector of the drive i.e. if only the live disk is written to the drive.
Does someone know how to make it work or is it simply impossible with the current live disks? Also, why doesn’t it work? Can grub not load the bootcode from the MBR because it’s a Master Boot Record and not a Volume Boot Record or is it because the bootcode can’t work with the disk data begin shifted to a partition.
It can be done. Did this some years ago to be able to install a couple of openSUSE versions from one and the same USB disk. It requires quite a lot of reading and manual setup.
I created a small (100MB) bootpartition and 6 5GB partitions for content of DVD-iso’s.
Then ran mkbootdisk to create the content of the bootpartition.
Then edited the syslinux.cfg to create menu items, pointing to the proper partitions, kernels and initrds.
Problem for now is, I did all this by hand, don’t have the disk anymore. It looked like this, with the 10.2 installer background
-Boot from HDD
-Inst-10.2-x86
-Inst-10.2-x86_64
-Inst-10.3-x86
-Inst-10.3-x86_64
-Live-11.0
Can’t remember if the last one worked. The others did.
I know this is by no means a manual, can only point in the right direction
I’m not sure if it’ll work just the same for the 11.2 live disks since they changed the iso image significantly since 11.2. In any case, I gave it my best shot with GRUB so I’m going to need some more help.
Also, does anyone know a virtualization environment in which I could test my flash drive booting since rebooting everytime is tedious. Virtual box only works with certain special virtual disk file formats, not raw files.
You need to copy the kernel images from the install media to the bootpartition’s /boot. I.e. you would have kernel32.111, kernel64.111, kernel32.112 etc. same for initrd’s.
The file syslinux.cfg has a ‘grub menu.lst’-alike structure. I created analogies from what was already there.
This way, the root for the install media is set to the proper partition, it boots from there and loads the live CD. You can install from it as well.
Virtualizing: put the iso on the flash drive, tell VB to use the iso as install media for a new VM, boot VM Done.
Even I’m trying a multi-boot setup and having the same issues as you. The dd method just doesn’t work in this scenario. Will try copying to an ext3 partition next and let you know if it works.
For testing in VirtualBox, you’ll first have to unmount the drive, and as root, create a vmdk that points to your flash drive. You’ll also have to run the VM as root (or mess around with permissions).
Since dd simply dumps all data to that partition the file system is overwritten. The image is formatted with it’s own filesystem. I think it’s plain old ISO 9660. At some point the bootcode activates the isolinux bootloader (not GRUB) which is able to read the bootfiles from ISO 9660. See Hybrid Live Systems.
A flash drive can be seen either as a cdrom or as a a harddrive. It depends on BIOS capabilities and settings. Windows (as far as I know) handles flash drives as cdroms. A cdrom can contain only one partition. That’s why bootable cdroms use isolinux (to boot from images) and not grub. If your BIOS can handle flash drives as normal USB external harddrives and boot from them, you can do with a flash drive te same as you would do with a harddisk under Linux, like partitionate, install OS and Grub.
Okay, I’ll try to explain (in my understanding) the boot process in OpenSUSE/USB:
Booting the OpenSUSE live images involves treating the USB drive as a cdrom (ref. above post). This works at real mode (probably using INT 13) and is handled by the bootloader, whose job is to load the kernel and the initial ramdisk. Once the kernel is loaded the system enters into protected mode and thus is no longer aware of the physical filesystem, and loads special drivers to start scanning for compatible devices that holds the image file so that it can be mounted and the boot process would continue.
Now this is where opensuse does things a little bit different from other distros - in order to uniquely identify the device containing the image, it compares the MBR signature of any device it encounters with the known signature. Now if you’re using the dd method, you’ll be copying the exact MBR and thus the signature matches, but when you install the bootloader on your own, the signature may not (in most cases, will not) match.
The signature used for comparing is stored at /boot/grub/mbrid . All you have to do is edit the file and replace it with the signature of your MBR.
You can find out the signature of your device’s MBR using this command: (Assuming your device is /dev/sdb)
After this is done, the system can correctly identify the device and the boot process continues.
Also, note that the image file can reside on any kernel-supported filesystem (ext, vfat, iso9660 etc), but the kernel+initrd should be on a filesystem that’s supported by the bootloader. This explains why some people make a small vfat partition at the beginning, and keep the rest of the important data on superior filesystems…