Linuxdoc Linux Questions
Click here to ask our community of linux experts!
Custom Search
Next Previous Contents

6. How do i know the BIOS number for my SCSI disks

The contribution from Marc Tanguy (mtanguy@ens.uvsq.fr), 2001-09-27

6.1 The theory

Actually, it exists two ways to know it :

If you have an adaptec scsi card (2940u2, 29160, 39160), you simply use the 'diagnose' mode (using BIOS v3.10.0 recommended). It must be activated in the scsi card BIOS menu. Then you just have to wait and see something like :


... ID LUN Vendor Product Rev Size Sync Bus HD#
... 0 0 QUANTUM ATLAS10K2 DDD6 17GB 160 16 80h
... 1 0 QUANTUM ATLAS10K2 DDD6 17GB 160 16 81h
... 2 0 IBM DDRS DC1B 4GB 80 16 82h
... 3 0 IBM DNES SAH0 9GB 80 16 83h

If you don't own an adaptec card, you have to know what is the 'booting' disk (usually ID 0, but not necessary, it can be defined in the scsi card BIOS) where LILO is going to be found and start : this is the first disk so it has number 0x80. Then it's very simple, the BIOS follows the IDs.

By example :

ID 0 -> boot  -> 0x80
ID 1 -> empty
ID 2 -> disk  -> 0x81
ID 3 -> disk  -> 0x82

or

ID 0 -> disk  -> 0x81
ID 1 -> empty
ID 2 -> disk  -> 0x82
ID 3 -> boot  -> 0x80
ID 4 -> disk  -> 0x83

This part doesn't care at all of what is installed on the scsi drives. But you should note that if you use an ID higher than the SCSI adapter it c an be a problem. So you should always try to set the SCSI adapter ID after the SCSI devices IDs.

6.2 How to swap linux and NT booting ?

OK, but NT must be the first disk to boot, so i want it in 0x80, but i already have LILO and a full ext2 only drive on 0x80 and my NT drive is in 0x83. How can i 'swap' linux and NT ? This a very easy : you just have to tell BIOS that NT drive is now 0x80 and the Linux drive is 0x83.

other=/dev/sdd1
      label=nt
      map-drive = 0x83
      to = 0x80
      map-drive = 0x80
      to = 0x83

This change will produce a warning :

  Warning: BIOS drive 0x8? may not be accessible

but if you know what you are doing it will run without problem.

I used it on this configuration which has a Red Hat Linux 7.1 and a Windows 2000 Pro :

Name        Flags      Part Type  FS Type          [Label]        Size (MB)

Disk Drive: /dev/sda - 0x80
sda1        Boot        Primary   Linux ext2       [/boot]            24.68
sda2                    Primary   Linux Swap                         139.83
sda3                    Primary   Linux ext2       [/usr]           3150.29
sda4                    Primary   Linux ext2       [/home]         15044.04

Disk Drive: /dev/sdb - 0x81
sdb1                    Primary   Linux Swap                         139.83
sdb2                    Primary   Linux ext2       [/]              3150.29
sdb3                    Primary   Linux ext2       [/opt]           1052.84
sdb4                    Primary   Linux ext2       [/public]       14015.88

Disk Drive: /dev/sdc - 0x82
sdc1                    Primary   Linux ext2       [/var]           1052.84
sdc2                    Primary   Linux ext2       [/tmp]            106.93
sdc3                    Primary   Linux ext2       [/cache]         1052.84
sdc4                    Primary   Linux ext2       [/chroot]        2352.44

Disk Drive: /dev/sdd - 0x83
sdd1        Boot        Primary   NTFS             [WINDOWS_2000]   9162.97

My full /etc/lilo.conf :

boot=/dev/sda
map=/boot/map
install=/boot/boot.b
prompt
default=Linux
read-only
compact
image=/boot/vmlinuz
  label=Linux
  root=/dev/sdb2
other=/dev/sdd1
  label=Windows
  map-drive = 0x83
  to = 0x80
  map-drive = 0x80
  to = 0x83

6.3 Miscellaneous

I just plugged a new scsi drive, and now LILO refuse to boot, what's going on ?

When you plug a disk, you must be careful with the IDs. If you add a drive between two already plugged disks the BIOS numbers are changed :

         Before            ---->             After
scsi id -       - BIOS id        scsi id -          - BIOS id
ID 0    - disk  - 0x80           ID 0    - disk     - 0x80
ID 1    - empty                  ID 1    - new disk - 0x81
ID 2    - disk  - 0x81           ID 2    - disk     - 0x82 !!

If you change the BIOS ids, you have to re-evaluate them.


Next Previous Contents