Gentoo Archives: gentoo-user

From: David Relson <relson@×××××××××××××.com>
To: gentoo-user@l.g.o
Cc: sibok1981@×××××.com
Subject: Re: [gentoo-user] help with Persistent hard disk device names with udev
Date: Wed, 01 Sep 2010 11:31:59
Message-Id: 20100901073102.3bc1a9a4@osage.osagesoftware.com
In Reply to: [gentoo-user] help with Persistent hard disk device names with udev by Pau Peris
1 My udev rules use a combination of KERNEL, ATTRS(serial), and SYMLINK to
2 create named entries in /dev for my 2 USB hard drives.
3
4 With the following rules in /etc/udev/rules.d/10-local.rules:
5
6 KERNEL=="sd*", ATTRS{serial}=="FD...7264507", SYMLINK+="WD1"
7 KERNEL=="sd*", ATTRS{serial}=="FD...7285643", SYMLINK+="WD2"
8
9 Plugging them in results in /dev entries like:
10
11 brw-rw---- 1 root disk 8, 32 Aug 21 13:55 sdc
12 lrwxrwxrwx 1 root root 3 Aug 21 13:55 WD1 -> sdc
13 brw-rw---- 1 root disk 8, 32 Aug 21 13:55 sdd
14 lrwxrwxrwx 1 root root 3 Aug 21 13:55 WD2 -> sdd
15
16 And in /etc/fstab, I reference /dev/WD1 and /dev/WD2
17
18 HTH,
19
20 David
21
22 On Mon, 30 Aug 2010 15:00:28 +0200
23 Pau Peris wrote:
24
25 > Hi, i would like to give persistent device names to the system hard
26 > drives (just renaming its original device name to the one i want using
27 > its serial number as identifier). I've created the following rules
28 > which are not currently working. I'm trying to use device serial
29 > numbers to properly set its device name. One of the main reasons for
30 > doing that is i have a RAID composed by 3 disk (let's say sda sdc sdd)
31 > and when i plug another 4 disks sda becomes sde, sdc becomes sdg and
32 > so on while new drives take old device names, that's why i would like
33 > to make it sure device names remains always the same.
34 > Here are the rules
35 > Código:
36 >
37 > SUBSYSTEM=="block", ATTR{serial}="VNVB05G2RKTRZH", NAME="hda"
38 > SUBSYSTEM=="block", ATTR{serial}="9QK0T4WM", NAME="sda"
39 > SUBSYSTEM=="block", ATTR{serial}="3QD0X58D", NAME="sdb"
40 > SUBSYSTEM=="block", ATTR{serial}="9QK0RS9G", NAME="sdc"
41 > SUBSYSTEM=="block", ATTR{serial}="9VP0SBVN", NAME="sdc"
42 >
43 > KERNEL=="hd*", SUBSYSTEM=="block", ATTR{serial}="VNVB05G2RKTRZH",
44 > NAME="hda%n" KERNEL=="sd*", SUBSYSTEM=="block",
45 > ATTR{serial}="9QK0T4WM", NAME="sda%n" KERNEL=="sd*",
46 > SUBSYSTEM=="block", ATTR{serial}="3QD0X58D", NAME="sdb%n"
47 > KERNEL=="sd*", SUBSYSTEM=="block", ATTR{serial}="9QK0RS9G",
48 > NAME="sdc%n" KERNEL=="sd*", SUBSYSTEM=="block",
49 > ATTR{serial}="9VP0SBVN", NAME="sdc%n"
50 >
51 >
52 > Should this work? Do some one know how can i get it to work? thanks
53 > in advanced