LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 11-25-2010, 10:02 AM   #1
d-niX
LQ Newbie
 
Registered: Nov 2010
Distribution: Ubuntu , Debian
Posts: 11

Rep: Reputation: 0
persistent device naming problem


Hello,

I have a problem defining persistent device naming on a Debian Lenny server.

I have:
RAID1 controller on the server machine with two SCSI disks.
external storage with RAID5. I have / mount on the first partition on the server SCSI disk and /storage mount on the external storage.

I'm experiencing a problem: The system recognizes the system disk (RAID 1), as sda or sdb – randomly.
I want: To control the recognition, and tell the system that sda (sda1) will always be the system disk.
The motivation: GRUB is configured to work with sda, and when the system disk doesn't, boot process fails, and I end up in the initramfs shell-like interface.
Code:
Booting the kernel
.
.
.
mount:mounting /dev on /root/dev failed: No such file or directory 
mount:mounting /sys on /root/sys failed: No such file or directory 
mount:mounting /proc on /root/proc failed: No such file or directory 
target filesystem does not have /sbin/init . No init found. Try passing init=bootarg.
(initramfs):  <--this is the prompt I get
Some more information:
Code:
# fdisk -l
Disk /dev/sda: 73.4 GB, 73406611456 bytes 
255 heads, 63 sectors/track, 8924 cylinders 
Units = cylinders of 16065 * 512 = 8225280 bytes 
Disk identifier: 0x000b1511 

   Device Boot      Start         End      Blocks   Id  System 
/dev/sda1   *           1        8681    69730101   83  Linux 
/dev/sda2            8682        8924     1951897+  82  Linux swap / Solaris 

Disk /dev/sdb: 1497.3 GB, 1497314099200 bytes 
255 heads, 63 sectors/track, 182038 cylinders 
Units = cylinders of 16065 * 512 = 8225280 bytes 
Disk identifier: 0x8aa13146 

   Device Boot      Start         End      Blocks   Id  System 
/dev/sdb1               1      182038  1462220203+  83  Linux
GRUB boot options:
Code:
kernel /boot/vmlinuz-2.6.26-2-686 root=/dev/sda1 ro quiet
Sometimes I can boot the system when I change the 'root=' option to /dev/sdb1, and if I'm lucky enough the system disk is recognized as /dev/sdb and then I can boot.


What I tried to do:
1. Tried to configure /etc/fstab with UUID option (instead of mentioning sda or sdb).
The following is the contents of /etc/fstab (scsi disks are defined too - with UUID)
Code:
proc            /proc           proc    defaults        0       0 
UUID=18fa3d1a-b401-4274-8bb5-35df0847f413   /   ext3   errors=remount-ro 0 1 
#/dev/sda1       /               ext3    errors=remount-ro 0       1 
/dev/sda2       none            swap    sw              0       0 
/dev/hda        /media/cdrom0   udf,iso9660 user,noauto     0       0 
/dev/fd0        /media/floppy0  auto    rw,user,noauto  0       0 
UUID=0148f6d2-d3fd-47c4-b0da-c4e6f3520460   /storage/   ext3  defaults  0  0 
#/dev/sdb1       /storage        ext3    defaults        0        0
2. I tried solving the problem by creating a new rules file under /etc/udev/rules.d so that the file name will be read first (in lexical order).
This is the file content - (each rule in one line of course, the attributes and values are taken from udevadm info –name=<dev-name> --attribute-walk ,when the disks names was O.K)

Code:
#rule for /dev/sda  (server disk [RAID1])
SUBSYSTEM=="block" , ATTR{size}=="143372288" , SUBSYSTEMS=="scsi" , ATTRS{model}=="SERVERAID" , NAME="sda"

#rule for /dev/sda1 (first bootable partition on server)
SUBSYSTEM=="block" , ATTR{size}=="139460202" , SUBSYSTEMS=="block" , ATTRS{size}=="143372288" , NAME="sda1"

#rule for /dev/sda2 (swap partition on server)
SUBSYSTEM=="block" , ATTR{size}=="3903795" , SUBSYSTEMS=="block" , ATTRS{size}=="143372288" , NAME="sda2"

#rule for /dev/sdb (external storage)
SUBSYSTEM=="block" , ATTR{size}=="2924441600" , SUBSYSTEMS=="scsi" , ATTRS{model}=="1726-4xx  FAStT" , NAME="sdb"

#rule for /dev/sdb1 (external storage, has only one partition)
SUBSYSTEM=="block" , ATTR{size}=="2924440407" , SUBSYSTEMS=="block" , ATTRS{size}=="2924441600" , NAME="sdb1"
when I reboot the system again I get the same problem!!

One more important question:
What is the reason Linux is not recognizing the system disk always as /dev/sda?


I will appreciate your help,
D-niX.
 
Old 11-25-2010, 10:50 AM   #2
Linux.tar.gz
Senior Member
 
Registered: Dec 2003
Location: Paris
Distribution: Slackware forever.
Posts: 2,534

Rep: Reputation: 100Reputation: 100
Dirty solution :

Blacklist the sdb scsi controller module. Then make it loaded in some rc.local, and mount it in rc.local too.

Anyway, what you did seems correct to me, although i think your udev rules may have to be tweaked furthermore, adding UUID parameter.
I don't know how to do it.
 
Old 11-26-2010, 05:05 AM   #3
Linux.tar.gz
Senior Member
 
Registered: Dec 2003
Location: Paris
Distribution: Slackware forever.
Posts: 2,534

Rep: Reputation: 100Reputation: 100
Though about the fact that maybe both of your scsi cards uses the same driver/module.

I remember i had this kind of problem with audio cards.

Show us the output of :
lsmod
 
Old 11-26-2010, 12:05 PM   #4
d-niX
LQ Newbie
 
Registered: Nov 2010
Distribution: Ubuntu , Debian
Posts: 11

Original Poster
Rep: Reputation: 0
lsmod output

Code:
lsmod

Module                  Size  Used by
ipv6                  235396  24
loop                   12748  0
snd_pcm                62660  0
snd_timer              17800  1 snd_pcm
snd                    45636  2 snd_pcm,snd_timer
soundcore               6368  1 snd
snd_page_alloc          7816  1 snd_pcm
pcspkr                  2432  0
serio_raw               4740  0
psmouse                32336  0
button                  6096  0
i2c_i801                7920  0
rng_core                3940  0
i2c_core               19828  1 i2c_i801
e752x_edac             10824  0
shpchp                 25528  0
pci_hotplug            23460  1 shpchp
edac_core              36144  1 e752x_edac
evdev                   8000  0
ext3                  105576  2
jbd                    39476  1 ext3
mbcache                 7108  1 ext3
ide_cd_mod             27684  0
cdrom                  30176  1 ide_cd_mod
ide_pci_generic         3908  0 [permanent]
piix                    6568  0 [permanent]
ide_core               96168  3 ide_cd_mod,ide_pci_generic,piix
sg                     26964  0
sd_mod                 22200  5
ata_generic             4676  0
libata                140448  1 ata_generic
dock                    8304  1 libata
floppy                 47844  0
qla2xxx               151080  1
firmware_class          6816  1 qla2xxx
scsi_transport_fc      35908  1 qla2xxx
ips                    36380  2
uhci_hcd               18672  0
ehci_hcd               28428  0
scsi_tgt               11272  1 scsi_transport_fc
tg3                    84676  0
usbcore               118224  3 uhci_hcd,ehci_hcd
scsi_mod              129548  7 sg,sd_mod,libata,qla2xxx,scsi_transport_fc,ips,scsi_tgt
thermal                15228  0
processor              32576  1 thermal
fan                     4196  0
thermal_sys            10856  3 thermal,processor,fan

Thank you.
 
Old 11-29-2010, 07:45 AM   #5
Linux.tar.gz
Senior Member
 
Registered: Dec 2003
Location: Paris
Distribution: Slackware forever.
Posts: 2,534

Rep: Reputation: 100Reputation: 100
This qla2xxx driver supports all QLogic Fibre Channel PCI and PCIe host adapters.

As far as i know, it seems only one scsi controller module is loaded, so both of your controllers uses this same module.

To ensure, type :
lspci

This will list the hardware.

If i'm right, then you will have to create modules aliases for your cards in /etc/modprobe.d/modprobe.conf, specifying which one is first. Can't remember syntax by now.
 
Old 12-06-2010, 11:36 AM   #6
d-niX
LQ Newbie
 
Registered: Nov 2010
Distribution: Ubuntu , Debian
Posts: 11

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by Linux.tar.gz View Post
This qla2xxx driver supports all QLogic Fibre Channel PCI and PCIe host adapters.

As far as i know, it seems only one scsi controller module is loaded, so both of your controllers uses this same module.

To ensure, type :
lspci

This will list the hardware.

If i'm right, then you will have to create modules aliases for your cards in /etc/modprobe.d/modprobe.conf, specifying which one is first. Can't remember syntax by now.


I want to thank you for your help so far.

here is lspci output:
Code:
lspci

00:00.0 Host bridge: Intel Corporation E7520 Memory Controller Hub (rev 0c)
00:00.1 Class ff00: Intel Corporation E7525/E7520 Error Reporting Registers (rev 0c)
00:02.0 PCI bridge: Intel Corporation E7525/E7520/E7320 PCI Express Port A (rev 0c)
00:04.0 PCI bridge: Intel Corporation E7525/E7520 PCI Express Port B (rev 0c)
00:05.0 PCI bridge: Intel Corporation E7520 PCI Express Port B1 (rev 0c)
00:06.0 PCI bridge: Intel Corporation E7520 PCI Express Port C (rev 0c)
00:08.0 System peripheral: Intel Corporation E7525/E7520/E7320 Extended Configuration Registers (rev 0c)
00:1d.0 USB Controller: Intel Corporation 82801EB/ER (ICH5/ICH5R) USB UHCI Controller #1 (rev 02)
00:1d.1 USB Controller: Intel Corporation 82801EB/ER (ICH5/ICH5R) USB UHCI Controller #2 (rev 02)
00:1d.7 USB Controller: Intel Corporation 82801EB/ER (ICH5/ICH5R) USB2 EHCI Controller (rev 02)
00:1e.0 PCI bridge: Intel Corporation 82801 PCI Bridge (rev c2)
00:1f.0 ISA bridge: Intel Corporation 82801EB/ER (ICH5/ICH5R) LPC Interface Bridge (rev 02)
00:1f.1 IDE interface: Intel Corporation 82801EB/ER (ICH5/ICH5R) IDE Controller (rev 02)
00:1f.3 SMBus: Intel Corporation 82801EB/ER (ICH5/ICH5R) SMBus Controller (rev 02)
01:06.0 VGA compatible controller: ATI Technologies Inc Radeon RV100 QY [Radeon 7000/VE]
02:00.0 PCI bridge: Intel Corporation 6700PXH PCI Express-to-PCI Bridge A (rev 09)
02:00.2 PCI bridge: Intel Corporation 6700PXH PCI Express-to-PCI Bridge B (rev 09)
03:03.0 SCSI storage controller: QLogic Corp. QLA2200 64-bit Fibre Channel Adapter (rev 05)
05:00.0 Ethernet controller: Broadcom Corporation NetXtreme BCM5721 Gigabit Ethernet PCI Express (rev 11)
06:00.0 Ethernet controller: Broadcom Corporation NetXtreme BCM5721 Gigabit Ethernet PCI Express (rev 11)
07:00.0 PCI bridge: Intel Corporation 80332 [Dobson] I/O processor (A-Segment Bridge) (rev 07)
07:00.2 PCI bridge: Intel Corporation 80332 [Dobson] I/O processor (B-Segment Bridge) (rev 07)
08:0e.0 RAID bus controller: Adaptec ServeRAID Controller (rev 07)
I will appreciate your professional opinion about it.
 
Old 01-06-2011, 04:14 AM   #7
d-niX
LQ Newbie
 
Registered: Nov 2010
Distribution: Ubuntu , Debian
Posts: 11

Original Poster
Rep: Reputation: 0
.

Hello ,

I still have this problem with the device naming

I will appreciate if someone can help me solve it.

TNX
 
Old 02-24-2011, 02:42 AM   #8
d-niX
LQ Newbie
 
Registered: Nov 2010
Distribution: Ubuntu , Debian
Posts: 11

Original Poster
Rep: Reputation: 0
Still need help with this problem

Thenk in advance .
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Changing UDEV persistent naming schemes orbit Slackware 5 04-21-2008 09:22 PM
device naming didi156 Linux - General 3 07-14-2006 06:37 AM
USB device naming problem brodskie Ubuntu 2 12-09-2005 03:09 AM
Naming device driver Crunch *BSD 2 02-12-2005 10:46 AM
mail server the naming naming convention problem kashan Linux - Newbie 0 07-16-2004 02:08 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

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