Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then 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 was just wondering if it was possible to have a linux system boot from one of two sources depending upon what was available. The reason for me asking is that I want my system to boot from a USB stick if it's plugged and if not from the normal flash memory. Is there some way of listing boot sources in a priority order?
Do you mean that you want your bootloader to be on both a USB stick and on your MBR? You could set your BIOS boot order to USB first and the hard disk second but you would probably get a conflict between the 2 bootloaders if you boot from USB.
Ah sorry. No the bootloader is in flash, the kernel is also in flash. The root partition is currently in flash but this is only 128MB and only has X windows on it. I would like to be able to boot the kernel and then boot the root from either flash or a USB flash drive (if attached). I don't have a bios and cannot adjust the boot loader so it would have to be something which is done from the initialisation of the kernal (which I don't really want to change).
Try to do it as XaviorP suggested but have the USB ahead of flash in the BIOS boot order. Then if the usb drive isn't present, flash would be used. You could instead have a usb entry in your grub or lilo menu, maybe having flash chainload the usb loader. I'm guessing what you want to accomplish is to always use the same /boot partition on flash so that the same kernel is always used, but to use a different root and home parition depending on whether a usb drive is plugged in, or to have different usb drives with linux on them for different purposes.
Whenever you have more than one distro involved you can end up with a situation of dualing distros. Even if the kernel is the same, the initrd file may not be, so be sure to uniquely name them. From a performance standpoint, adding a hard drive and dual booting would be much better.
Sorry as I said I don't have a bios. It's an embedded device with a custom bootloader so no grub or lilo. It's going in the car so hard drive is a little impractical for OS.
I'll keep trying with this, cheers for the help guys.
I didn't know that this was an embedded device. A arm based Simputer uses the blob boot loader for example.
As usual the devil is in the details. Supplying info that you are talking about an embedded device, what the device or project is would probably solicit better responses from people who use the same devices. If a 2.4 kernel is written to the very beginning of the usb disk, will the system boot from that instead? This is a particular hardware implementation detail and not a general Linux question.
There is an O'Reilly book on building embedded devices. Also the particular device probably has a number of wiki's and web home pages run by enthusiasts.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.