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