LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 08-01-2017, 02:36 PM   #1
mR_Slug
LQ Newbie
 
Registered: Jan 2005
Posts: 12

Rep: Reputation: 3
How do you change the order SCSI/SATA controllers are detected?


I'm running Slackware 14.1. I have 2 SATA controllers, an on-board 6 channel device, and an old PCI 6 channel device. The on-board device uses the ahci module. The old PCI controller uses the aacraid module.

It seems whatever I do Linux wants to place the aacraid controller as the first controller. I have disabled the bios on the card, both in the cards configuration utility (accessed with Ctrl-A), and then in the system bios. If I boot the system with no drives connected to the second (aacraid) controller, everything works.

If I boot the system with one drive on the second controller, it gets to lilo, but when I select the kernel it has problems booting. Now sda is sdb, sdb is sdc etc. I want to have the drives on the aacraid controller show up after the ones on the ahci controller.

Ive tried adding either of these to the append= statement in lilo.conf:
scsihosts=ahci:accraid
modprobe.blacklist=aacraid

no luck. Any ideas?

I really want to get the boot drive as sda, second as sdb etc on the ahci controller as I do alot of dd'ing on this machine for drive images.

Thanks
 
Old 08-01-2017, 02:45 PM   #2
bassmadrigal
LQ Guru
 
Registered: Nov 2003
Location: West Jordan, UT, USA
Distribution: Slackware
Posts: 8,792

Rep: Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656
I'm not sure how to ensure one controller is loaded before the other, but if you can't figure it out, you could always use persistent naming in your fstab and lilo. That would prevent the system from not booting up if the order gets changed. But you would need to be careful when dd'ing since the drives could be different than what you expected.

https://docs.slackware.com/howtos:sl...sistent_naming

Hopefully someone else can help out with how to make one controller the primary all the time...
 
Old 08-01-2017, 03:25 PM   #3
Darth Vader
Senior Member
 
Registered: May 2008
Location: Romania
Distribution: DARKSTAR Linux 2008.1
Posts: 2,727

Rep: Reputation: 1247Reputation: 1247Reputation: 1247Reputation: 1247Reputation: 1247Reputation: 1247Reputation: 1247Reputation: 1247Reputation: 1247
The hard drives order is established by BIOS (and its extensions from whatever add-on cards), nothing the Linux can do.

I recommend the usage of UUID based mounting.
 
Old 08-01-2017, 08:10 PM   #4
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: Slackware (15 current), Slack15, Ubuntu studio, MX Linux, FreeBSD 13.1, WIn10
Posts: 10,342

Rep: Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242
UUID -- cuz cannot control which one gets picked first.
 
Old 08-01-2017, 08:41 PM   #5
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,126

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
Strictly speaking you don't care what order the BIOS enumerates things. It's the decision on what to name as /dev/sda that matters - and that is under Linux control. I did have similar issues with a SATA/(E)IDE mix years ago, but whimped out and just used a distro that gave me the same (correct for me) device as /dev/sda consistently.
udev rules would be the place to look, but the initrd would have to be munged similarly.

Edit: fuzzy memories slowly clearing ...
There is also the small matter of where (which MBR) the bootloader gets installed onto. This is known once the device naming can be relied on - but may not be /dev/sda as one might normally expect. Been there, done that ...

Last edited by syg00; 08-01-2017 at 08:46 PM.
 
Old 08-01-2017, 10:13 PM   #6
mR_Slug
LQ Newbie
 
Registered: Jan 2005
Posts: 12

Original Poster
Rep: Reputation: 3
Thanks for the replies, but I have now found a solution.

The drive order according to the BIOS was ok. Second controllers BIOS was disabled, so the BIOS had no knowledge of it. The problem was the order in which the kernel loads the built in modules. They seems to be roughly alphabetical order. aacraid is loaded before ahci. The built in modules cant be disabled as far as I can tell.

The trick is to remove the aacraid as a built in module and and set it as a loadable module. This causes the ahci module to be loaded first, then the aacraid module is loaded later. If the aacraid module *had* to be built-in I would still be screwed. According to the second resource you can edit the order of bulit-in modules in drivers/scsi/hosts.c of the kernel source. But perhaps this is old info as a grep for aacraid turned up no matches.

I am still passing the scsihosts=ahci:accraid command to the kernel in lilo, but it looks like this is doing nothing in kernel 4.5.2

The UUID method may work, but it looks like a elephantine solution to solve a simple problem. I suppose its good if you want to plug a drive into any spot on on a huge array, and it always comes up as sdb or whatever.

One last note, when building a kernel on a machine that things /dev/sda is /dev/sdb and vice-versa, lilo gets very confused. I had to boot without drives on the second controller and then run lilo.

Resources:
https://forums.gentoo.org/viewtopic-t-1007788.html
http://sg.danny.cz/scsi/scsihosts.html
http://www.tldp.org/HOWTO/SCSI-2.4-HOWTO/mlbparams.html
http://iimk.ac.in/gsdl/cgi-bin/libra...206ab2b78ea.10

Thanks.
 
3 members found this post helpful.
  


Reply



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
[SOLVED] disk device order gets scrambled at boot time with 3Ware controllers pisti Linux - Server 5 08-08-2011 10:34 AM
Set order of HDD controllers kripz Linux - Hardware 1 05-05-2010 09:11 AM
SCSI controllers and drives. DBabo Linux - Hardware 3 09-03-2006 09:59 PM
SCSI controllers and drives. DBabo Linux - Software 0 09-02-2006 12:56 PM
SCSI Raid Controllers tbayboy SUSE / openSUSE 1 09-03-2005 10:39 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 10:58 AM.

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
Open Source Consulting | Domain Registration