Gentoo Archives: gentoo-user

From: Matthias Schwarzott <zzam@g.o>
To: gentoo-user@l.g.o
Cc: Pau Peris <sibok1981@×××××.com>
Subject: Re: [gentoo-user] help with Persistent hard disk device names with udev
Date: Sat, 09 Oct 2010 12:03:08
Message-Id: 201010091358.56713.zzam@gentoo.org
In Reply to: [gentoo-user] help with Persistent hard disk device names with udev by Pau Peris
1 On Monday 30 August 2010, 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 >
28 > Should this work? Do some one know how can i get it to work? thanks in
29 > advanced
30
31 It could work if you fixed the rules as the other answers told you, but PLEASE
32 don't do this!
33
34 There are a lot of arguments like dmesg output and sysfs content will no
35 longer match userspace observations.
36 It will break once there is another disk that is not renamed and gets
37 KERNEL=sda assigned.
38
39 Why do you not just use /dev/disk/by-* links as everyone else does?
40
41 Regard
42 Matthias