Gentoo Archives: gentoo-user

From: Pau Peris <sibok1981@×××××.com>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] help with Persistent hard disk device names with udev
Date: Tue, 31 Aug 2010 12:59:40
Message-Id: AANLkTinOUdCB0vqAWdFd+z7mHhX3X=HZ3uEvVquOdzPP@mail.gmail.com
In Reply to: Re: [gentoo-user] help with Persistent hard disk device names with udev by Pau Peris
1 Hi, after following your tips the code gets like the following one:
2
3 SUBSYSTEM=="block", ATTR{serial}=="VNVB05G2RKTRZH", NAME="hda"
4 SUBSYSTEM=="block", ATTR{serial}=="9QK0T4WM", NAME="sda"
5 SUBSYSTEM=="block", ATTR{serial}=="3QD0X58D", NAME="sdb"
6 SUBSYSTEM=="block", ATTR{serial}=="9QK0RS9G", NAME="sdc"
7 SUBSYSTEM=="block", ATTR{serial}="9VP0SBVN", NAME="sdc"
8
9 KERNEL=="hd*", SUBSYSTEM=="block", ATTR{serial}=="VNVB05G2RKTRZH", NAME="hda%n"
10 KERNEL=="sd*", SUBSYSTEM=="block", ATTR{serial}=="9QK0T4WM", NAME="sda%n"
11 KERNEL=="sd*", SUBSYSTEM=="block", ATTR{serial}=="3QD0X58D", NAME="sdb%n"
12 KERNEL=="sd*", SUBSYSTEM=="block", ATTR{serial}=="9QK0RS9G", NAME="sdc%n"
13 KERNEL=="sd*", SUBSYSTEM=="block", ATTR{serial}=="9VP0SBVN", NAME="sdc%n"
14 That's not working, when i plug more devices they get named without
15 taking care of the rules above. Do someone know why? thanks. i would
16 like to be able to name devies using its serial number. Thanks in
17 advanced
18
19 2010/8/30 Pau Peris <sibok1981@×××××.com>:
20 > Thx a lot!
21 >
22 > 2010/8/30 J. Roeleveld <joost@××××××××.org>:
23 >> On Monday 30 August 2010 15:00:28 Pau Peris wrote:
24 >>> Hi, i would like to give persistent device names to the system hard
25 >>> drives (just renaming its original device name to the one i want using
26 >>> its serial number as identifier). I've created the following rules
27 >>> which are not currently working. I'm trying to use device serial
28 >>> numbers to properly set its device name. One of the main reasons for
29 >>> doing that is i have a RAID composed by 3 disk (let's say sda sdc sdd)
30 >>> and when i plug another 4 disks sda becomes sde, sdc becomes sdg and
31 >>> so on while new drives take old device names, that's why i would like
32 >>> to make it sure device names remains always the same.
33 >>> Here are the rules
34 >>> Código:
35 >>>
36 >>> SUBSYSTEM=="block", ATTR{serial}="VNVB05G2RKTRZH", NAME="hda"
37 >>> SUBSYSTEM=="block", ATTR{serial}="9QK0T4WM", NAME="sda"
38 >>> SUBSYSTEM=="block", ATTR{serial}="3QD0X58D", NAME="sdb"
39 >>> SUBSYSTEM=="block", ATTR{serial}="9QK0RS9G", NAME="sdc"
40 >>> SUBSYSTEM=="block", ATTR{serial}="9VP0SBVN", NAME="sdc"
41 >>>
42 >>> KERNEL=="hd*", SUBSYSTEM=="block", ATTR{serial}="VNVB05G2RKTRZH",
43 >>> NAME="hda%n" KERNEL=="sd*", SUBSYSTEM=="block", ATTR{serial}="9QK0T4WM",
44 >>> NAME="sda%n" KERNEL=="sd*", SUBSYSTEM=="block", ATTR{serial}="3QD0X58D",
45 >>> NAME="sdb%n" KERNEL=="sd*", SUBSYSTEM=="block", ATTR{serial}="9QK0RS9G",
46 >>> NAME="sdc%n" KERNEL=="sd*", SUBSYSTEM=="block", ATTR{serial}="9VP0SBVN",
47 >>> NAME="sdc%n"
48 >>>
49 >>> Should this work? Do some one know how can i get it to work? thanks in
50 >>> advanced
51 >>
52 >> Hi,
53 >>
54 >> You need to use double "=" for all the fields you want to match.
55 >> In other words, for sda, you need to use:
56 >>> SUBSYSTEM=="block", ATTR{serial}=="9QK0T4WM", NAME="sda"
57 >> instead of:
58 >>> SUBSYSTEM=="block", ATTR{serial}="9QK0T4WM", NAME="sda"
59 >>
60 >> Otherwise it doesn't match it correctly or will try to change the serial for
61 >> the all the block-devices it finds.
62 >>
63 >> (I found this out when trying to rename my network-interfaces)
64 >>
65 >> --
66 >> Joost
67 >>
68 >>
69 >

Replies

Subject Author
Re: [gentoo-user] help with Persistent hard disk device names with udev Alex Schuster <wonko@×××××××××.org>