LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This 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


Reply
  Search this Thread
Old 12-27-2007, 12:04 PM   #1
scristiv
LQ Newbie
 
Registered: Sep 2005
Location: Timisoara
Distribution: Slackware
Posts: 4

Rep: Reputation: 0
Post Get the correct boot device


If I have an IDE and a SATA or SCSI disk, and both are recognize by BIOS and Linux, it is possible to find where the BIOS boot from without parsing grub/lilo conf files or reading this info from BIOS? Is it a place where Linux save such an information?

Thanks.
 
Old 12-27-2007, 12:20 PM   #2
mrrangerman
Member
 
Registered: Oct 2007
Location: MI
Distribution: Debian Slackware
Posts: 528

Rep: Reputation: 50
Open a terminal and type cfdisk it will show the bootable partition. If you have a mix of harddrives ie. IDE/SATA/SCSI chose the dev. to look at cfdisk /dev/sdx
 
Old 12-27-2007, 12:34 PM   #3
scristiv
LQ Newbie
 
Registered: Sep 2005
Location: Timisoara
Distribution: Slackware
Posts: 4

Original Poster
Rep: Reputation: 0
Post Get the correct boot device

So, for a mix of harddisks can I assume that only one partition from all of them is marked as bootable? Isn't it possible to have 2 bootable marked partitions on 2 different disks?
 
Old 12-27-2007, 01:40 PM   #4
David1357
Senior Member
 
Registered: Aug 2007
Location: South Carolina, U.S.A.
Distribution: Ubuntu, Fedora Core, Red Hat, SUSE, Gentoo, DSL, coLinux, uClinux
Posts: 1,302
Blog Entries: 1

Rep: Reputation: 107Reputation: 107
Quote:
Originally Posted by scristiv View Post
Isn't it possible to have 2 bootable marked partitions on 2 different disks?
Yes it is. You need to make sure that the drive you want to boot from is the only one with a partition with the "bootable" flag. In fdisk, it is the "a" command.
 
Old 12-28-2007, 08:32 AM   #5
scristiv
LQ Newbie
 
Registered: Sep 2005
Location: Timisoara
Distribution: Slackware
Posts: 4

Original Poster
Rep: Reputation: 0
So in the worst case somebody have to decide which is the bootable disk. You can not do that from a script or program.

Thanks.
 
Old 12-28-2007, 09:16 AM   #6
saikee
Senior Member
 
Registered: Sep 2005
Location: Newcastle upon Tyne UK
Distribution: Any free distro.
Posts: 3,398
Blog Entries: 1

Rep: Reputation: 112Reputation: 112
The hard disks should be described according to their model names in the Bios. They are detected in the order built into the mobo which typically detect the IDE controller (for Pata disks) before scanning the Sata disk controller. eSata is present and simulated as a SCSI may go straight to the front of the detection.

The disk order in the Bios can be rearranged by the user but the controllers have an impact on how the disks are subsequently named in a Linux.

The first disk shown up in the Bios is always booted first if there is no other bootable medium before the hard disk.

This is an example of one Sata, one Pata and one eSata.

The Bios was arranged to boot the Sata as the first disk so it booted up as sda in Slax, Debian, Slackware but as sdc in Ubuntu. Ubuntu's gave sda to eSata and sdb to the Pata but booted sdc as the first disk.

When a floppy was introduced and booted, thereby the hard disk order instructed in the Bios was not executed, the 1st disk recognised is the Pata, the second Sata and the last eSata.

I know the abouve is as clear as mud but the things to remember are

(1) If hard disk is to be booted then the first disk nominated in the Bios will get booted.

(2) The disk device names in the Linux are controlled by the controllers and remain unchanged. However different Linux may assisgn different names.

(3) Within the same type of hard disks the connectors on the mobo can also determine the device names. Thus 3 Sata connected to Sata 1, 2, 3 with have sda assigned to No 1, sdb assigned to No.2 and sdc assigned to No.3, even if you elect to put sdc as the first disk and boot it up.

The above cannot be controlled by a script. It is more important to understand what is done in the hardware first and then anticipate it in the software second.

Last edited by saikee; 12-28-2007 at 09:18 AM.
 
Old 12-28-2007, 04:23 PM   #7
scristiv
LQ Newbie
 
Registered: Sep 2005
Location: Timisoara
Distribution: Slackware
Posts: 4

Original Poster
Rep: Reputation: 0
I know that in Windows the signature (disk identity) of the booted MBR is stored in Registry and is the basis to index all the disk devices, also I know that with a compliant PnP BIOS you can get the list of the bootable devices (network, disk, floppy, etc) and the boot priority list and you have access to these even from protected mode (Windows/Linux OS), but my question is: Linux stores somewhere this signature?
 
Old 12-28-2007, 04:36 PM   #8
saikee
Senior Member
 
Registered: Sep 2005
Location: Newcastle upon Tyne UK
Distribution: Any free distro.
Posts: 3,398
Blog Entries: 1

Rep: Reputation: 112Reputation: 112
But one can installs a MS Windows in the 1st disk and then relocates it to boot up as the 2nd, 3rd, 4th, 5th ....disk.

I had Vista and XP in an internal disk, cloned it to an eSata and boot it up as an external disk.

A Windows, just like any PC system, has to work with the Bios information which can be rearranged by the user or the boot loader.

Each PC system when installed will have the information of which partition and which disk recorded in the system. For a Linux the information is jointly held in the boot loader configuration file, which is /boot/grub/menu.lst for Grub and /etc/lilo.conf for Lilo, and the /etc/fstab. The latter is the partitions a kernel must load in order to complete the booting of the Linux.

A Linxu can be relocated anywhere in the PC in different partition or different disk ( or a different computer). Updating the above files will fire up the Linux again.

Unlike MS systems there is no restriction to prevent the migration of Linux.

Last edited by saikee; 12-28-2007 at 04:41 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
getting the correct USB device for attached mobile phone drkstr Linux - Software 14 02-19-2008 05:14 AM
UL 1.0 GRUB: could not find device for /boot: not found or not a block device cma Linux - General 4 12-12-2005 04:35 AM
CD does not boot but BIOS correct vees Linux - Hardware 3 11-09-2005 01:39 PM
Can't Boot Correct Kernel in Slack 10.0 Sorata-Daidouji Slackware 14 07-03-2005 02:27 AM


All times are GMT -5. The time now is 02:34 PM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration