LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 04-02-2009, 10:18 AM   #1
titopoquito
Senior Member
 
Registered: Jul 2004
Location: Lower Rhine region, Germany
Distribution: Slackware64 14.2 and current, SlackwareARM current
Posts: 1,646

Rep: Reputation: 147Reputation: 147
udev and symlink rules with two identical hard disks (was: udev upgrade)


If I want to upgrade udev (I have problems with two new hard disks and udev getting confused by my rules that I have added for them) - is/are there any package/s that I have to upgrade as well? - this would be on Slackware 12.2 with the stock kernel

And is there a bigger problem I might get with an upgrading udev than that my system doesn't boot properly?

Any input is welcome

Last edited by titopoquito; 04-02-2009 at 03:35 PM.
 
Old 04-02-2009, 02:01 PM   #2
titopoquito
Senior Member
 
Registered: Jul 2004
Location: Lower Rhine region, Germany
Distribution: Slackware64 14.2 and current, SlackwareARM current
Posts: 1,646

Original Poster
Rep: Reputation: 147Reputation: 147
To answer it myself: AFAIK the upgrade did not do any harm, booted without a problem. The underlying problem persists though, so reverting back to udev-135 from udev-140 ...
 
Old 04-02-2009, 02:51 PM   #3
rworkman
Slackware Contributor
 
Registered: Oct 2004
Location: Tuscaloosa, Alabama (USA)
Distribution: Slackware
Posts: 2,559

Rep: Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351
What problem are you seeing?
 
Old 04-02-2009, 03:32 PM   #4
titopoquito
Senior Member
 
Registered: Jul 2004
Location: Lower Rhine region, Germany
Distribution: Slackware64 14.2 and current, SlackwareARM current
Posts: 1,646

Original Poster
Rep: Reputation: 147Reputation: 147
Hi Robby!

I'll try to be not too redundant:

SATA disks in my system:
sda with sda1, sda2 and sda3 (Samsung SATA disk)
sdb with sdb1 the one and only partition (WD SATA disk)
sdc with sdc1 as one and only partiton (WD SATA disk, same model as sdb)

These device names are given properly if I let udev do it's thing and both sdb and sdc are plugged in when I boot. But sdb and sdc are installed in mobile racks with a seperate power switch each - so depending on which of them are powered on at startup the device names of sdb and sdc might change.

I tried to create udev rules to assign symlinks to both sdb and sdc according to their serial numbers. It didn't work at all . Funny thing is, if I boot without my home-made rules, "udevadm info --query=all --path=/sys/block/sd{a,b,c}" shows all information right, that means different models and/or different serial numbers for all three SATA drives. If I boot with my rules the device names (sd{a,b,c}) are ok, but udev totally messes up the symlinks. This lead to the following (from memory):

Code:
symlink  linked to   device
/dev/hugin   -->     /dev/sdc
/dev/hugin1  -->     /dev/sdc1
/dev/hugin2  -->     /dev/sda2
/dev/hugin3  -->     /dev/sda3
sdb wasn't assigned, I guess it was overwritten by sdc. Some race condition I guess. Furthermore the udevadm command got different usb numbers, but the same output for all three SATA disks, so same model and serial number for all of them. Not quite right ...


I am not sure if I'm "allowed" to use "ENV" parts in udev rules which is what I did. It's seen in all kind of tutorials. I used it because "udevadm info --attribute-walk ..." alone didn't give any information that is unique for sdb and sdc. Funnily there *is* a unique line for each, i. e. the symlink that udev creates in /dev/disk/by-id/. These are generated from the serial number of the drive, but udevadm --atribute-walk nevertheless doesn't show them as usable.

So if I do nothing, udevadm shows the serial numbers and info right, if I use an udev rule with the serial numbers udev seems to "forget" the serial numbers.

Example of one of the two rules I used, the other one differs only in serial and device name of course:

Code:
KERNEL=="sd*", ENV{ID_SERIAL}="SATA_WDC_WD6400AAKS-_WD-WCASY3969084", NAME="%k", SYMLINK+="munin%n"
For now I have created partitions of different size on both sdb and sdc, so the following rule works. It's a rather ugly workaround IMHO:

Code:
KERNEL=="sd?1", ATTR{size}=="1250242497", SYMLINK+="munin"
If you have any question or comment, feel free to ask/write
 
Old 04-02-2009, 03:48 PM   #5
titopoquito
Senior Member
 
Registered: Jul 2004
Location: Lower Rhine region, Germany
Distribution: Slackware64 14.2 and current, SlackwareARM current
Posts: 1,646

Original Poster
Rep: Reputation: 147Reputation: 147
Ok, hit me, I think I messed it up.

Code:
ENV{ID_SERIAL}=
should be

Code:
ENV{ID_SERIAL}==
with a double "==". No wonder it didn't work, frakking typo
 
Old 04-02-2009, 09:56 PM   #6
rworkman
Slackware Contributor
 
Registered: Oct 2004
Location: Tuscaloosa, Alabama (USA)
Distribution: Slackware
Posts: 2,559

Rep: Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351
Yep, that would do it :-)
I'm curious as to why you don't just use the persistent symlinks that udev provides natively -- see /dev/disk/by-uuid/
 
Old 04-03-2009, 03:56 AM   #7
titopoquito
Senior Member
 
Registered: Jul 2004
Location: Lower Rhine region, Germany
Distribution: Slackware64 14.2 and current, SlackwareARM current
Posts: 1,646

Original Poster
Rep: Reputation: 147Reputation: 147
Oh man, two days the typo was sitting right before my eyes

Why I don't use the /dev/disk/by-uuid links - hm, I don't remember it very clear. AFAIR I had problems with FAT drives in the past not getting a proper symlink. Maybe it is even a remainder of fiddling with grub and UUID, or ... - I don't remember exactly, caught me. These days I could at least go with /dev/disk/by-id or even with by-uuid I guess.

BTW, I might also reconsider my desire to give my hard disks names
 
  


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
udev and scanner - only as root since upgrade to -current niels.horn Slackware 23 11-16-2008 11:04 AM
Upgrade to UDEV? Prostetnic_Jeltz Slackware 1 05-14-2006 01:42 AM
How to upgrade to -current ? New udev for new kernel !? introuble Slackware 8 04-21-2006 02:47 PM
Upgrade Plextor Firmware with UDEV & pxupdate :How-to Thoreau Linux - Hardware 2 04-18-2005 03:20 AM
udev conficting with devfs after upgrade david.skinner Linux - Software 0 01-04-2005 03:14 PM

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

All times are GMT -5. The time now is 01:28 PM.

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