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