LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Get the correct boot device (https://www.linuxquestions.org/questions/linux-newbie-8/get-the-correct-boot-device-609423/)

scristiv 12-27-2007 11:04 AM

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.

mrrangerman 12-27-2007 11:20 AM

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

scristiv 12-27-2007 11:34 AM

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?

David1357 12-27-2007 12:40 PM

Quote:

Originally Posted by scristiv (Post 3003027)
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.

scristiv 12-28-2007 07:32 AM

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.

saikee 12-28-2007 08:16 AM

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.

scristiv 12-28-2007 03:23 PM

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?

saikee 12-28-2007 03:36 PM

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.


All times are GMT -5. The time now is 09:29 AM.