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 01-02-2009, 10:34 PM   #1
dbeck
LQ Newbie
 
Registered: May 2006
Location: MN State Univ., Mankato
Distribution: Slackware 12.2, CentOS 5.4
Posts: 22

Rep: Reputation: 15
Drive names change with use of mkinitrd


Hi - I am setting up a Dell Poweredge 2600 as a new samba server using Slackware 12.2. The machine has an mpt Fusion internal scsi interface, a Adaptec 3960 scsi adaptor, and a Sil 3124 Serial ATA Controller.

Initially when I installed the system, I could not be the mpt Fusion driver to work so installed the operating system on /dev/sda which was a drive on the Adaptec. There were two additional drives on the Adaptec which came up as /dev/sdb and /dev/sdc. Also there were two large SATA drives on the Sil controller. They appeared as sdd, and sde.

Today I used mkinitrd -c -k 2.6.27.7 -m aic7xxx:mbcache:jbd:ext3 -f ext3 -r /dev/sda3. My goal was to load the aic7xxx driver only and later load modules to load the other drives. This incantation allowed all the interfaces to load and the drives to appear but now the drive order has changed with the SATA drive being /dev/sda and /dev/sdb.

I would like suggestions on a method control the order the drives appear. I would like sda to be the drive on the adaptec and not a drive on the Sil ATA controller. Also I would like the ATA drives to follow all the scsi drives. They are going to be for backup and I want to remove or swap them around if that would work.

Also I saw another mkinitrd that had an option like --preload module-name which seems like something I want to do.

Thanks...
 
Old 01-03-2009, 05:25 AM   #2
guanx
Senior Member
 
Registered: Dec 2008
Posts: 1,176

Rep: Reputation: 233Reputation: 233Reputation: 233
At least the SCSI drive numbers are not guaranteed to be in fixed order on every boot (probe). So use UUID=******** instead of /dev/sd* if possible.
 
Old 01-04-2009, 04:46 PM   #3
dbeck
LQ Newbie
 
Registered: May 2006
Location: MN State Univ., Mankato
Distribution: Slackware 12.2, CentOS 5.4
Posts: 22

Original Poster
Rep: Reputation: 15
After some searching on UUID scsi using google I have an idea what you are suggesting and how to get the UUID but I don't know how or where to use it. Would this be incorporated in the initrd somehow? Do I use UUID's in my /etc/fstab? If in the /etc/fstab, would I need to do the initrd? Do I use it in my LILO and change my /etc/fstab to use UUIDs?

However, I think I need to use initrd to control the order of the probing. I am not sure if my initrd is actually controlling the ordering but I do know that without the initrd, the adaptec and Sil cards/drives would work and loading the mptbase/mptscsi module would fail with an "Unexpected doorbell active" message. The system would boot and the drives would be found in such a way the root=sda3 would be correct even though the Sil drives were on. I say that because using the initrd and all the drives on, a different drive comes up as sda and the system will not boot.

From googling I found the following to work using LILO- 'Yes, lilo will boot by uuid. Instead of root= you have to add it to the append line as in append="root=/dev/disk/by-uuid/xxxx"' Is this all I need?

(I am doing this from my mac at home so can't test linux stuff but I would like to get ideas/solutions to get it running tomorrow as soon as possible.)

Thanks...
 
Old 01-04-2009, 05:08 PM   #4
astrogeek
Moderator
 
Registered: Oct 2008
Distribution: Slackware [64]-X.{0|1|2|37|-current} ::12<=X<=15, FreeBSD_12{.0|.1}
Posts: 6,263
Blog Entries: 24

Rep: Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194
Quote:
Originally Posted by dbeck View Post
I have an idea what you are suggesting and how to get the UUID but I don't know how or where to use it. Would this be incorporated in the initrd somehow? Do I use UUID's in my /etc/fstab? If in the /etc/fstab, would I need to do the initrd? Do I use it in my LILO and change my /etc/fstab to use UUIDs?
As I understand your question and previous answer, you would use the UUIDs in LILO and fstab.

I do this with SATA and IDE drives but not SCSI, but should be the same as I understand it. The problem is that you actually cannot control the ordering assigned to the drives at boot, but you can control which physical devices mount where by specifying the unique ID, UUID.

I don't think you need to specify the full path to the device for LILO, just something like root="UUID=abd123..." will suffice.

In case you don't know, you can also use labels on ext2/3 filesystems. Use e2label to assign a label to each drive/partition then use LABEL=mydisk in LILO and fstab. I use labels where possible, sure helps keep things human readable!
 
Old 01-05-2009, 11:35 AM   #5
TSquaredF
Member
 
Registered: Dec 2005
Location: "The South Coast of Texas"
Distribution: Slackware64-current
Posts: 564

Rep: Reputation: Disabled
This thread contains a link by uppman that will allow you to dynamically determine the type of the root filesystem (ext3, reiser or whatever) and his HowTo provides even better instructions on using root=LABEL=* or root=UUID=* in your lilo.conf or menu.lst. I am using both methods (with GRUB) & copy my boot partition, unmodified, between a desktop (IDE with ext3) & a laptop (SATA with reiserfs) with no problems at all.

Last edited by TSquaredF; 01-06-2009 at 09:24 AM. Reason: Repair link, Tnx askalon9f2.
 
Old 01-06-2009, 03:33 AM   #6
askalon9f2
LQ Newbie
 
Registered: Feb 2008
Location: Antwerp, Belgium
Distribution: Slackware 12.2, slamd64 12.1
Posts: 18

Rep: Reputation: 0
TSquaredF, your links were the answer to a problem I had quite similar to the op's but I never got round to fixing it (switching hd between machines & controllers). Thanks for that. (btw, your first link has a typo in it at the start (http://http//www.linuxquestions.org/...orking-671890/ instead of http://www. ...)
 
Old 01-08-2009, 05:29 PM   #7
dbeck
LQ Newbie
 
Registered: May 2006
Location: MN State Univ., Mankato
Distribution: Slackware 12.2, CentOS 5.4
Posts: 22

Original Poster
Rep: Reputation: 15
Once again thanks for the help. It took a couple of days but I got my system to boot the way I wanted to plus learned about labeling drives and using drive LABEL= statement in my fstab.

The biggest problem, using the drive LABEL in the lilo and initrd, was solved by one of TSquaredF's replies in another thread. That thread included code for patching the initrd-tree/init file and incorporating the blkid program into the initrd-tree and init script to give initrd and lilo access to the drives through disk labels and UUID's. This post was in http://www.linuxquestions.org/questi...2/#post3349090
I found additional libraries were needed for blkid to function. These were libext2fs.so.2, libcom_err.so.2, libpthread.so.0 (which uppman included in his stuff to which TSqured provided a link).

I had one problem that I never got solved. That was using `blkid -c /dev/null` which would only return the information on the first partitions of each drive. My / was on /dev/sda3 at installation so when I tried to boot using the lilo.conf parm of 'root="LABEL=ROOT"' it wouldn't find it. Since I installed /boot on /dev/sda1 (LABEL=BOOT) I used used 'root="LABEL=BOOT"' in my lilo.conf and did the change below to have /dev/sd*3 as the root device which was the goal. I changed:

ROOTDEV=`echo $BLKID_ROOT | awk 'BEGIN{FS=":"}{print $1}'` to
ROOTDEV=`echo $BLKID_ROOT | awk 'BEGIN{FS=":"}{ sub("1","3") ; print $1}'`

Also another change I made that I didn't test to see if it was needed - in init I moved the module loading code to be before the processing of the input from lilo (`cat /proc/cmdline`). This was moved midway through the process and I forgot to move it back.

One thing that surprised me - for my mkinitrd I used:
mkinitrd -c -k 2.6.27.7-smp -m aic7xxx:mbcache:jbd:ext3 -r /dev/sda3
Maybe I didn't need to specify the module for my adaptec card but when I did and ran things later, the mptbase module loaded properly giving me access to the internal scsi controller. That had been a problem previously where I would get a message about the doorbell blah,blah, timeout error, and the controller couldn't be accessed.
 
  


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
Suddenly NIC names change ivanatora Linux - Networking 3 10-25-2007 07:05 AM
Change file names ajs_box Linux - General 1 12-10-2006 03:47 PM
GIMP | change layer names jinksys Linux - Software 2 01-28-2006 02:14 PM
How can i change names of multiple files? phz Linux - General 5 11-15-2003 10:06 AM
change file names to lowercase. david_wliu Programming 2 03-10-2003 12:59 PM

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

All times are GMT -5. The time now is 05:05 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