LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This 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


Reply
  Search this Thread
Old 12-19-2006, 03:39 PM   #1
OmnipotentOscar
Member
 
Registered: Jan 2005
Distribution: Fedora 5, Debian
Posts: 56

Rep: Reputation: 15
Possible to boot from two sources?


Hey guys,

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?

Thank you

Adam
 
Old 12-19-2006, 03:43 PM   #2
OmnipotentOscar
Member
 
Registered: Jan 2005
Distribution: Fedora 5, Debian
Posts: 56

Original Poster
Rep: Reputation: 15
Almost forgot to say... the kernel is always available but I don't really want to have to recompile it... suppose I'll have to if I must.
 
Old 12-19-2006, 03:48 PM   #3
XavierP
Moderator
 
Registered: Nov 2002
Location: Kent, England
Distribution: Debian Testing
Posts: 19,192
Blog Entries: 4

Rep: Reputation: 475Reputation: 475Reputation: 475Reputation: 475Reputation: 475
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.

Why do you want to do this?
 
Old 12-19-2006, 03:52 PM   #4
OmnipotentOscar
Member
 
Registered: Jan 2005
Distribution: Fedora 5, Debian
Posts: 56

Original Poster
Rep: Reputation: 15
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).
 
Old 12-20-2006, 09:36 PM   #5
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
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.
 
Old 12-20-2006, 11:37 PM   #6
OmnipotentOscar
Member
 
Registered: Jan 2005
Distribution: Fedora 5, Debian
Posts: 56

Original Poster
Rep: Reputation: 15
Hey jschiwal,

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.

Adam
 
Old 12-21-2006, 06:41 PM   #7
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
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.

Last edited by jschiwal; 12-21-2006 at 06:46 PM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Kernel Boot parameters sources? kushalkoolwal Debian 1 08-29-2005 08:19 PM
Ubuntu Sources List! I need some great sources lists! Jengo Linux - Newbie 1 06-24-2005 04:50 PM
Finally got a kernel-sources-2.6.9 to boot but I have 2 problems. Royle Debian 2 01-13-2005 03:29 PM
boot cd/sources question American Psycho Linux From Scratch 2 05-05-2004 06:27 AM
Software Sources Manager, how to add installation cd sources after deletion Lakota Mandriva 1 10-23-2003 12:39 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 07:19 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration