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

Replies

Subject Author
Re: [gentoo-user] help with Persistent hard disk device names with udev Pau Peris <sibok1981@×××××.com>