Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I have a USB pen-drive which I was planning to fill with multiple image-files (ISO) of different OS'es (such as different linux-distro's and different versions of windows), so I won't have to dig around for my different disks every time I need to install a different system (I do this a lot at work, and such a device would save me a lot of time).
I therefore need a bootloader on this pen-drive, so I will be able to choose which image I wish to boot from, and I want this to work in both virtual and "real" machines.
My problem is:
As I have little experience with bootloaders in general, I have no idea which bootloader to use, or how to set this up.
If anyone here could give me a few pointers, or even a guide, it would be greatly appreciated.
One possibility would be to use the USB as if it were an HDD and install distros to it in a normal manner and use the default grub or lilo bootloader provided... not sure how well this would work but if you make a dedicated /boot on the USB it should work... not totally sure on this. It's an idea I thought of before, the one thing that did worry me hwoever is that drivers will change between machines and thus images on the USB won't actually be as portable as you might like. Also references may change as well...
But that's an idea, I don't have much knowledge of bootloaders either to be honest .
1. the bootloader needs to understand the filesystem of the USB stick (usually FAT16 or FAT32)
2. the bootloader needs to understand the ISO9600 file system
3. the bootloader needs to load the initrd and linux kernel (traditional bootloader role)
4. the bootloader needs to specify its own 'init' which will mount the iso image, perhaps set some environment variables (so that the installer uses the mounted *.iso rather than attempting to mount a non-existent CD), then chain to the 'init' script of the initrd image.
As far as I know, no one has done it - but it looks like a fantastic summer project.
Well, ONE thing that will work is:
1. Partition the USB stick into several parts
2. Unpack the contents of each *.iso into each part
3. Install GRUB in one partition (you may modify one of the partitions with an iso image for this purpose)
4. Configure GRUB to allow you to start whichever installer you wish.
Hmm... well, you'll have to try it to see if it works - I can't guarantee that the installer's init scripts don't attempt to mount and chroot to a nonexistent CD. Then again, even if they did, that just means a little extra work unpacking the initrd images and modifying their 'init' scripts. The only drawback is that you can't just change your boot/install options by copying yet another *.iso file to a single directory. Also, the number of installers you can boot is somewhat limited by the number of partitions you can create.
I think grub4dosdoes this exact thing you are looking for. There is one possible problem tho. grub needs to be able to recognize your usb stick. AND it will only boot at usb 2.0 there are some posts around the web on how to get around these problems but if you can manage with them it is much simpler.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.