# Kernel drive's names with 3w-9xxx and mptsas

## Spambox

Howto change hdd drives names assigned with kernel? I have 3ware 9690SA-4I controller that uses kernel driver 3w-9xxx and Intel SAS controller that uses mptsas driver. System boot from SAS drive attached to  Intel SAS controller, in BIOS drives on Intel SAS controller show before 3ware, on POST Install SAS starts before 3ware, 3ware 9690SA-4I installed in PCI-E slot 5, and  Intel SAS controller installed in PCI-E slot 4 (also I try to change slot's without success). But after boot drives on 3ware always use names started with sda. And after I add drives to 3ware controller (it's attached to hotplug backplane, drives on controller not configured as raid, only as single drives), after reboot drives attached to Intell SAS change names (before reboot sdb and sdc, and after add 2 drives to 3ware sdf and sdg). I don't use modules, kernel is 2.6.38-hardened-r6, this is from dmesg

```

mpt2sas version 06.100.00.00 loaded

3ware 9000 Storage Controller device driver for Linux v2.26.02.014.

3w-9xxx 0000:05:00.0: PCI INT A -> GSI 19 (level, low) -> IRQ 19

3w-9xxx 0000:05:00.0: setting latency timer to 64

3w-9xxx: scsi0: AEN: INFO (0x04:0x0053): Battery capacity test is overdue:.

scsi0 : 3ware 9000 Storage Controller

3w-9xxx: scsi0: Found a 3ware 9000 Storage Controller at 0xfebdf000, IRQ: 19.

3w-9xxx: scsi0: Firmware FH9X 4.10.00.020, BIOS BE9X 4.08.00.003, Ports: 128.

scsi 0:0:0:0: Direct-Access     AMCC     9690SA-4I  DISK  4.10 PQ: 0 ANSI: 5

LSI 3ware SAS/SATA-RAID Controller device driver for Linux v3.26.02.000.

sd 0:0:0:0: [sda] 976541696 512-byte logical blocks: (499 GB/465 GiB)

sd 0:0:0:0: Attached scsi generic sg0 type 0

ahci 0000:00:11.0: version 3.0

ahci 0000:00:11.0: PCI INT A -> GSI 22 (level, low) -> IRQ 22

sd 0:0:0:0: [sda] Write Protect is off

sd 0:0:0:0: [sda] Mode Sense: 23 00 10 00

ahci 0000:00:11.0: AHCI 0001.0100 32 slots 4 ports 3 Gbps 0xf impl SATA mode

ahci 0000:00:11.0: flags: 64bit ncq sntf ilck pm led clo pmp pio slum part ccc 

sd 0:0:0:0: [sda] Write cache: enabled, read cache: enabled, supports DPO and FUA

scsi1 : ahci

scsi2 : ahci

scsi3 : ahci

scsi4 : ahci

ata1: SATA max UDMA/133 abar m1024@0xfe6fa400 port 0xfe6fa500 irq 22

ata2: SATA max UDMA/133 abar m1024@0xfe6fa400 port 0xfe6fa580 irq 22

ata3: SATA max UDMA/133 abar m1024@0xfe6fa400 port 0xfe6fa600 irq 22

ata4: SATA max UDMA/133 abar m1024@0xfe6fa400 port 0xfe6fa680 irq 22

sda: sda1

sd 0:0:0:0: [sda] Attached SCSI disk

Fusion MPT base driver 3.04.17

Copyright (c) 1999-2008 LSI Corporation

Fusion MPT SAS Host driver 3.04.17

mptsas 0000:04:00.0: PCI INT A -> GSI 16 (level, low) -> IRQ 16

mptbase: ioc0: Initiating bringup

ata1: SATA link down (SStatus 0 SControl 300)

ata4: SATA link down (SStatus 0 SControl 300)

ata2: SATA link down (SStatus 0 SControl 300)

ata3: SATA link down (SStatus 0 SControl 300)

ioc0: LSISAS1064E B3: Capabilities={Initiator}

mptsas 0000:04:00.0: setting latency timer to 64

scsi5 : ioc0: LSISAS1064E B3, FwRev=011a0000h, Ports=1, MaxQ=266, IRQ=16

mptsas: ioc0: attaching ssp device: fw_channel 0, fw_id 2, phy 2, sas_addr 0x5000c50028abb011

scsi 5:0:0:0: Direct-Access     SEAGATE  ST3146356SS      0007 PQ: 0 ANSI: 5

sd 5:0:0:0: Attached scsi generic sg1 type 0

sd 5:0:0:0: [sdb] 286749488 512-byte logical blocks: (146 GB/136 GiB)

mptsas: ioc0: attaching ssp device: fw_channel 0, fw_id 3, phy 3, sas_addr 0x5000c500234d0145

sd 5:0:0:0: [sdb] Write Protect is off

sd 5:0:0:0: [sdb] Mode Sense: b3 00 10 08

scsi 5:0:1:0: Direct-Access     SEAGATE  ST3146356SS      0007 PQ: 0 ANSI: 5

sd 5:0:0:0: [sdb] Write cache: enabled, read cache: enabled, supports DPO and FUA

sd 5:0:1:0: Attached scsi generic sg2 type 0

sd 5:0:1:0: [sdc] 286749488 512-byte logical blocks: (146 GB/136 GiB)

Fusion MPT misc device (ioctl) driver 3.04.17

mptctl: Registered with Fusion MPT base driver

mptctl: /dev/mptctl @ (major,minor=10,220)

```

I try use change scan order in BIOS, try to use kernel parameter  CONFIG_PCI_STUB, PCI_GOBIOS, PCI_GODIRECT, PCI_GOANY - without success.

----------

## krinn

Build booting card as include in kernel and others cards as module, this way your driver that is need to run your boot/root drive will keep constant hdd naming scheme as when it boot it is alone and can grab any hdd names.

later on boot when loading the 3ware drivers (because udev will autoload the module when it found them), 3ware drivers will face sda & sdb are already taken by intel sas and grab others names so.

Half solve your problem: intel sas drives always grab first disks names, 3ware could then grab others. (weakness if you were wishing to use a 3ware card to boot, but looks like your boot disk is on the intel sas)

and the label trick will now make your partitions mount to a fixed mount point, abstracting the need to know the drives names.

i explain that here: https://forums.gentoo.org/viewtopic-p-6183368.html#6183368 & https://forums.gentoo.org/viewtopic-t-550784-highlight-label.html

----------

## Spambox

Thanks for answer, but it's trivial, and I don't use modules. My question is why 3ware-xxx always is scsi0?

----------

## krinn

first load first served. Why 3ware is load first, no idea, that's a kernel thing.

And i know you don't use modules, but switching the 3ware as module will force it loading next to the one include in kernel. So you will then tell kernel who's first and who's after.

----------

