# Kernel panic while booting with external SCSI drives attache

## charlesnadeau

My main Gentoo machine is based on a Gigabyte N680SLI-DQ6 motherboard with 9 SATA drives, an Intel Q6600 and 8 Gigs of RAM. I run kernel 2.6.25-gentoo-r7.

I added to my machine an Adaptec 29160 SCSI card connected to 4 external SCSI hard drives.

With this SCSI card, I can't boot the machine; I always get an error message saying: "Kernel panic - not syncing: VFS: Unable to mount FS on unknown-block (0,0)" right after the kernel has finish to enumerate/identify all the drives and their controllers.

Since I never had any problem to boot this machine before, I suspect that the order of the drives changes when the external hard drives are connected to the SCSI card. I added udev rules to "pin" my SATA drives to their letters but it didn't improve anything. Here are the rules I created in /etc/udev/rules.d/10-charles.rules:

```

#Rules for my SATA drives to be identified before the SCSI ones.

#Based on http://www.cyberciti.biz/tips/linux-assign-static-names-to-scsi-devices.html and http://gentoo-wiki.com/HOWTO_Customizing_UDEV#The_basics_of_writing_rules

KERNEL=="sda", BUS=="scsi", PROGRAM=="/sbin/scsi_id -g -u -s %p", RESULT=="SATA_ST3320620AS_6QF1A82N", ENV{ID_SERIAL}=="?*", SYMLINK+="disk/by-id/$env{ID_BUS}-$env{ID_SERIAL}-part%n"

KERNEL=="sdb", BUS=="scsi", PROGRAM=="/sbin/scsi_id -g -u -s %p", RESULT=="SATA_ST3750640AS_5QD10GFJ", ENV{ID_SERIAL}=="?*", SYMLINK+="disk/by-id/$env{ID_BUS}-$env{ID_SERIAL}-part%n"

KERNEL=="sdc", BUS=="scsi", PROGRAM=="/sbin/scsi_id -g -u -s %p", RESULT=="SATA_ST3750640AS_5QD0ZMT2", ENV{ID_SERIAL}=="?*", SYMLINK+="disk/by-id/$env{ID_BUS}-$env{ID_SERIAL}-part%n"

KERNEL=="sdd", BUS=="scsi", PROGRAM=="/sbin/scsi_id -g -u -s %p", RESULT=="SATA_ST3750640AS_5QD0VDLG", ENV{ID_SERIAL}=="?*", SYMLINK+="disk/by-id/$env{ID_BUS}-$env{ID_SERIAL}-part%n"

KERNEL=="sde", BUS=="scsi", PROGRAM=="/sbin/scsi_id -g -u -s %p", RESULT=="SATA_ST3750640AS_3QD0AF55", ENV{ID_SERIAL}=="?*", SYMLINK+="disk/by-id/$env{ID_BUS}-$env{ID_SERIAL}-part%n"

KERNEL=="sdg", BUS=="scsi", PROGRAM=="/sbin/scsi_id -g -u -s %p", RESULT=="SATA_ST3750640AS_5QD0ZEL6", ENV{ID_SERIAL}=="?*", SYMLINK+="disk/by-id/$env{ID_BUS}-$env{ID_SERIAL}-part%n"

KERNEL=="sdh", BUS=="scsi", PROGRAM=="/sbin/scsi_id -g -u -s %p", RESULT=="SATA_ST3750330AS_3QK0A55K", ENV{ID_SERIAL}=="?*", SYMLINK+="disk/by-id/$env{ID_BUS}-$env{ID_SERIAL}-part%n"

KERNEL=="sdi", BUS=="scsi", PROGRAM=="/sbin/scsi_id -g -u -s %p", RESULT=="SATA_ST3750640AS_3QD1BKH4", ENV{ID_SERIAL}=="?*", SYMLINK+="disk/by-id/$env{ID_BUS}-$env{ID_SERIAL}-part%n"

KERNEL=="sdj", BUS=="scsi", PROGRAM=="/sbin/scsi_id -g -u -s %p", RESULT=="SATA_ST3750330AS_3QK08ZAR", ENV{ID_SERIAL}=="?*", SYMLINK+="disk/by-id/$env{ID_BUS}-$env{ID_SERIAL}-part%n

```

Am I right to suspect that the SCSI drives change the order of the disk at some point during the boot sequence?

My grub.conf is

```

# Which listing to boot as default. 0 is the first, 1 the second etc.

default 0

# How many seconds to wait before the default listing is booted.

timeout 30

# Nice, fat splash-image to spice things up :)

# Comment out if you don't have a graphics card installed

#splashimage=(hd0,0)/boot/grub/splash.xpm.gz

# Partition where the kernel image (or operating system) is located

title=Gentoo Linux 2.6.25-r7

root (hd0,0)

kernel /boot/G2625r7 root=/dev/sda2

# Partition where the kernel image (or operating system) is located

title=Gentoo Linux 2.6.24-r4 avec fix pour NCQ

root (hd0,0)

kernel /boot/G2624r4 root=/dev/sda2

# Partition where the kernel image (or operating system) is located

title=Gentoo Linux 2.6.23-r3 with VMWare tweaking

root (hd0,0)

kernel /boot/G2623r3VMWare root=/dev/sda2

# Partition where the kernel image (or operating system) is located

title=Gentoo Linux 2.6.23-r3

root (hd0,0)

kernel /boot/kernel-2.6.23-gentoo-r3 root=/dev/sda2

#Memtest pour tester ma memoire.

title=Memtest86Plus

root (hd0,0)

kernel /boot/memtest86plus/memtest.bin

#Memtest pour tester ma memoire.

title=Memtest86

root (hd0,0)

kernel /boot/memtest86/memtest.bin

```

And lspci returns

```

00:00.0 Host bridge: nVidia Corporation C55 Host Bridge (rev a2)

00:00.1 RAM memory: nVidia Corporation C55 Memory Controller (rev a1)

00:00.2 RAM memory: nVidia Corporation C55 Memory Controller (rev a1)

00:00.3 RAM memory: nVidia Corporation C55 Memory Controller (rev a1)

00:00.4 RAM memory: nVidia Corporation C55 Memory Controller (rev a1)

00:00.5 RAM memory: nVidia Corporation C55 Memory Controller (rev a2)

00:00.6 RAM memory: nVidia Corporation C55 Memory Controller (rev a1)

00:00.7 RAM memory: nVidia Corporation C55 Memory Controller (rev a1)

00:01.0 RAM memory: nVidia Corporation C55 Memory Controller (rev a1)

00:01.1 RAM memory: nVidia Corporation C55 Memory Controller (rev a1)

00:01.2 RAM memory: nVidia Corporation C55 Memory Controller (rev a1)

00:01.3 RAM memory: nVidia Corporation C55 Memory Controller (rev a1)

00:01.4 RAM memory: nVidia Corporation C55 Memory Controller (rev a1)

00:01.5 RAM memory: nVidia Corporation C55 Memory Controller (rev a1)

00:01.6 RAM memory: nVidia Corporation C55 Memory Controller (rev a1)

00:02.0 RAM memory: nVidia Corporation C55 Memory Controller (rev a1)

00:02.1 RAM memory: nVidia Corporation Unknown device 03bc (rev a1)

00:02.2 RAM memory: nVidia Corporation C55 Memory Controller (rev a1)

00:03.0 PCI bridge: nVidia Corporation C55 PCI Express bridge (rev a1)

00:09.0 RAM memory: nVidia Corporation MCP55 Memory Controller (rev a1)

00:0a.0 ISA bridge: nVidia Corporation MCP55 LPC Bridge (rev a2)

00:0a.1 SMBus: nVidia Corporation MCP55 SMBus (rev a2)

00:0b.0 USB Controller: nVidia Corporation MCP55 USB Controller (rev a1)

00:0b.1 USB Controller: nVidia Corporation MCP55 USB Controller (rev a2)

00:0d.0 IDE interface: nVidia Corporation MCP55 IDE (rev a1)

00:0e.0 IDE interface: nVidia Corporation MCP55 SATA Controller (rev a2)

00:0e.1 IDE interface: nVidia Corporation MCP55 SATA Controller (rev a2)

00:0e.2 IDE interface: nVidia Corporation MCP55 SATA Controller (rev a2)

00:0f.0 PCI bridge: nVidia Corporation MCP55 PCI bridge (rev a2)

00:0f.1 Audio device: nVidia Corporation MCP55 High Definition Audio (rev a2)

00:11.0 Bridge: nVidia Corporation MCP55 Ethernet (rev a2)

00:12.0 Bridge: nVidia Corporation MCP55 Ethernet (rev a2)

00:14.0 PCI bridge: nVidia Corporation MCP55 PCI Express bridge (rev a2)

00:15.0 PCI bridge: nVidia Corporation MCP55 PCI Express bridge (rev a2)

00:16.0 PCI bridge: nVidia Corporation MCP55 PCI Express bridge (rev a2)

00:17.0 PCI bridge: nVidia Corporation MCP55 PCI Express bridge (rev a2)

01:00.0 VGA compatible controller: nVidia Corporation G70 [GeForce 7600 GS] (rev a1)

02:07.0 SCSI storage controller: Adaptec AIC-7892A U160/m (rev 02)

02:0e.0 FireWire (IEEE 1394): Texas Instruments TSB43AB23 IEEE-1394a-2000 Controller (PHY/Link)

03:00.0 SATA controller: JMicron Technologies, Inc. JMicron 20360/20363 AHCI Controller (rev 02)

03:00.1 IDE interface: JMicron Technologies, Inc. JMicron 20360/20363 AHCI Controller (rev 02)

04:00.0 SATA controller: JMicron Technologies, Inc. JMicron 20360/20363 AHCI Controller (rev 02)

04:00.1 IDE interface: JMicron Technologies, Inc. JMicron 20360/20363 AHCI Controller (rev 02)

05:00.0 Ethernet controller: Marvell Technology Group Ltd. 88E8056 PCI-E Gigabit Ethernet Controller (rev 14)

06:00.0 Ethernet controller: Marvell Technology Group Ltd. 88E8052 PCI-E ASF Gigabit Ethernet Controller (rev 22)

```

I checked my .config file and I have all the right drivers for my disks controllers.

Any help would be appreciated.

Thanks!

Charles

----------

## charlesnadeau

I tried the suggestion here but it doesn't solve my problem. I still can't boot with the external SCSI drives.

Charles

----------

## pappy_mcfae

 *Quote:*   

> Since I never had any problem to boot this machine before, I suspect that the order of the drives changes when the external hard drives are connected to the SCSI card. I added udev rules to "pin" my SATA drives to their letters but it didn't improve anything. Here are the rules I created in /etc/udev/rules.d/10-charles.rules

 

UDEV rules don't quite work to fudge drive names. I would assume that since you've added those drives, they've become sda. sdb.sdc. and sdd respectively. 

I really don't think there's away around that particular problem. However, if you can get the SCSI adpater to run with a liveCD, you could move your Gentoo install from the SATA drive to the first SCSI drive, and reap the benefits of SCSI power and SCSI speed. You would have to compile a kernel that would support your SCSI adapter as well as the SATA. Other than that, it should be a fairly straightforward kind of thing. 

Here's a HOWTO about moving Gentoo from one drive to the next.

Good luck.

Blessed be!

Pappy

----------

## charlesnadeau

pappy_mcfae,

Thanks for the suggestion but it won't work in my situation:

My boot drive is a 320G drive and my SCSI drives are 18G: not enough space for a migration.

The SCSI RAID0 array will be used exclusively by a MySQL database.

I'll keep on digging.

Thanks!

Charles

----------

## cyrillic

If you want the SCSI drives to not interfere with the boot process, then just compile the Adaptec driver as a module.  This will insure that the SCSI drives are always enumerated after the onboard SATA drives.

----------

## emerald

Set the correct boot parameter in grub; now its like root=/dev/sdaX (or with initrd realroot=/dev/sdaX) and change that to reflect the scsi drives to be sda..sdd so change it to root=/dev/sdeX.

Change your fstab too to reflect that and you are ready to go (but it won't work without the scsi hdd's connected anymore).

If you want 'static' names in fstab use the entries in /dev/disk/by-id/ or /dev/disk/by-path/

----------

## charlesnadeau

 *cyrillic wrote:*   

> If you want the SCSI drives to not interfere with the boot process, then just compile the Adaptec driver as a module.  This will insure that the SCSI drives are always enumerated after the onboard SATA drives.

 

Bingo!! It works almost like I expected. I can successfully boot; my the SCSI (/dev/sd[fghi]) drives are now "in the middle" of the SATA (/dev/sd[abcde] and /dev/sd[jklm]) drives "range" but I can fix that easily.

The existing RAID5 array works perfectly in spite of this re-ordering. I just had to change the drives for my swap in /etc/fstab and everything is fine!

Now I'll set up my RAID0 with my SCSI drives.

Thanks a lot, I would have NEVER thought of this solution.

Charles

----------

## charlesnadeau

 *cyrillic wrote:*   

> If you want the SCSI drives to not interfere with the boot process, then just compile the Adaptec driver as a module.  This will insure that the SCSI drives are always enumerated after the onboard SATA drives.

 

I just found a problem: my DVD burner has disappeared completely, nowhere to be found. It used to be /dev/sr0 but this doesn't exist anymore.

The only thing I changed is the driver for the 29160 that I set to be modular.

Any clue/tip?

Thanks!

Charles

----------

## cyrillic

The only thing I can suggest is to take a look at dmesg and see what the kernel has to say about it.

You should be able to see where the controller that the DVD is plugged into is being detected by the kernel.

----------

## charlesnadeau

Cyrillic, 

Using lshw, I could find it but it is "UNCLAIMED":

```

 *-ide:1

             description: IDE interface

             product: MCP55 SATA Controller

             vendor: nVidia Corporation

             physical id: e

             bus info: pci@0000:00:0e.0

             logical name: scsi0

             logical name: scsi1

             version: a2

             width: 32 bits

             clock: 66MHz

             capabilities: ide pm msi ht bus_master cap_list emulated

             configuration: driver=sata_nv latency=0 maxlatency=1 mingnt=3 module=sata_nv

           *-cdrom UNCLAIMED

                description: SCSI CD-ROM

                product: DVDRAM GSA-H62L

                vendor: HL-DT-ST

                physical id: 0

                bus info: scsi@0:0.0.0

                version: DL00

                capabilities: removable

                configuration: ansiversion=5

```

dmesg lists it as detected as well

```

Uniform Multi-Platform E-IDE driver

ide: Assuming 33MHz system bus speed for PIO modes; override with idebus=xx

NFORCE-MCP55: 0000:00:0d.0 (rev a1) UDMA133 controller

NFORCE-MCP55: IDE controller (0x10de:0x036e rev 0xa1) at  PCI slot 0000:00:0d.0

NFORCE-MCP55: not 100% native mode: will probe irqs later

NFORCE-MCP55: IDE port disabled

    ide0: BM-DMA at 0xf000-0xf007, BIOS settings: hda:DMA, hdb:DMA

Probing IDE interface ide0...

JMB: IDE controller (0x197b:0x2363 rev 0x02) at  PCI slot 0000:03:00.1

PCI: Enabling device 0000:03:00.1 (0000 -> 0001)

ACPI: PCI Interrupt Link [APC6] enabled at IRQ 16

ACPI: PCI Interrupt 0000:03:00.1[B] -> Link [APC6] -> GSI 16 (level, low) -> IRQ 16

JMB: 100% native mode on irq 16

PCI: Setting latency timer of device 0000:03:00.1 to 64

    ide1: BM-DMA at 0x9400-0x9407, BIOS settings: hdc:PIO, hdd:PIO

    ide2: BM-DMA at 0x9408-0x940f, BIOS settings: hde:PIO, hdf:PIO

Probing IDE interface ide1...

Probing IDE interface ide2...

JMB: IDE controller (0x197b:0x2363 rev 0x02) at  PCI slot 0000:04:00.1

PCI: Enabling device 0000:04:00.1 (0000 -> 0001)

ACPI: PCI Interrupt Link [APC5] enabled at IRQ 16

ACPI: PCI Interrupt 0000:04:00.1[B] -> Link [APC5] -> GSI 16 (level, low) -> IRQ 16

JMB: 100% native mode on irq 16

PCI: Setting latency timer of device 0000:04:00.1 to 64

    ide3: BM-DMA at 0xa400-0xa407, BIOS settings: hdg:PIO, hdh:PIO

    ide4: BM-DMA at 0xa408-0xa40f, BIOS settings: hdi:PIO, hdj:PIO

Probing IDE interface ide3...

Probing IDE interface ide4...

Probing IDE interface ide0...

Probing IDE interface ide1...

Probing IDE interface ide2...

Probing IDE interface ide3...

Probing IDE interface ide4...

Loading iSCSI transport class v2.0-869.

Driver 'sd' needs updating - please use bus_type methods

sata_nv 0000:00:0e.0: version 3.5

ACPI: PCI Interrupt Link [APSI] enabled at IRQ 21

ACPI: PCI Interrupt 0000:00:0e.0[A] -> Link [APSI] -> GSI 21 (level, low) -> IRQ 21

PCI: Setting latency timer of device 0000:00:0e.0 to 64

scsi0 : sata_nv

scsi1 : sata_nv

ata1: SATA max UDMA/133 cmd 0xe200 ctl 0xe300 bmdma 0xd200 irq 21

ata2: SATA max UDMA/133 cmd 0xd000 ctl 0xd100 bmdma 0xd208 irq 21

ata1: SATA link up 1.5 Gbps (SStatus 113 SControl 300)

ata1.00: ATAPI: HL-DT-ST DVDRAM GSA-H62L, DL00, max UDMA/100

ata1.00: configured for UDMA/100

ata2: SATA link up 3.0 Gbps (SStatus 123 SControl 300)

ata2.00: HPA detected: current 625140335, native 625142448

ata2.00: ATA-7: ST3320620AS, 3.AAK, max UDMA/133

ata2.00: 625140335 sectors, multi 16: LBA48 NCQ (depth 0/32)

ata2.00: configured for UDMA/133

scsi 0:0:0:0: CD-ROM            HL-DT-ST DVDRAM GSA-H62L  DL00 PQ: 0 ANSI: 5

scsi 0:0:0:0: Attached scsi generic sg0 type 5

```

In my .config, SCSI and ATA CDROM/DVD are enabled:

```

#

# Please see Documentation/ide/ide.txt for help/info on IDE drives

#

# CONFIG_BLK_DEV_IDE_SATA is not set

# CONFIG_BLK_DEV_HD_IDE is not set

CONFIG_BLK_DEV_IDEDISK=m

CONFIG_IDEDISK_MULTI_MODE=y

CONFIG_BLK_DEV_IDECD=y

CONFIG_BLK_DEV_IDECD_VERBOSE_ERRORS=y

# CONFIG_BLK_DEV_IDETAPE is not set

# CONFIG_BLK_DEV_IDEFLOPPY is not set

CONFIG_BLK_DEV_IDESCSI=m

CONFIG_BLK_DEV_IDEACPI=y

# CONFIG_IDE_TASK_IOCTL is not set

CONFIG_IDE_PROC_FS=y

#

# SCSI support type (disk, tape, CD-ROM)

#

CONFIG_BLK_DEV_SD=y

CONFIG_CHR_DEV_ST=m

# CONFIG_CHR_DEV_OSST is not set

CONFIG_BLK_DEV_SR=y

# CONFIG_BLK_DEV_SR_VENDOR is not set

CONFIG_CHR_DEV_SG=y

# CONFIG_CHR_DEV_SCH is not set

```

How can I "claim" it back?

Thanks!

Charles

----------

## emerald

since the sata controller for the mcp55 controller probably uses the sata/pata framework you need to activate scsi cdrom support, the atapi/ide settings menu is complete irrelevant to all deviced from sata/pata menu.

----------

## charlesnadeau

emerald,

It is (7th line):

```

#

# SCSI support type (disk, tape, CD-ROM)

#

CONFIG_BLK_DEV_SD=y

CONFIG_CHR_DEV_ST=m

# CONFIG_CHR_DEV_OSST is not set

CONFIG_BLK_DEV_SR=y

# CONFIG_BLK_DEV_SR_VENDOR is not set

CONFIG_CHR_DEV_SG=y

# CONFIG_CHR_DEV_SCH is not set 

```

Charles

----------

## cyrillic

 *charlesnadeau wrote:*   

> How can I "claim" it back? 

 

From the dmesg output that you posted, it looks like the legacy IDE driver is claiming devices before the libata driver has a chance.

You will probably get better results if you change

```
CONFIG_IDE=y 
```

to

```
# CONFIG_IDE is not set 
```

This will allow libata to claim all your devices without conflicts.

----------

## charlesnadeau

 *cyrillic wrote:*   

>  *charlesnadeau wrote:*   You will probably get better results if you change
> 
> ```
> CONFIG_IDE=y 
> ```
> ...

 

cyrillic,

You were right!

Thanks for the tip, everything works perfectly now!

Charles

----------

