fixed drive name

Allen Chen achen at harbourfrontcentre.com
Wed Jun 17 15:52:20 UTC 2009


Le Wen ??:
> I think that's the right command. According to "man scsi_id"
> In RHEL4, we use
> BUS="scsi", PROGRAM="/sbin/scsi_id", RESULT="312345", NAME="disk%n"
> that works in RHEL4
> while in RHEL5, we use 
> BUS=="scsi", PROGRAM=="/sbin/scsi_id -d %N -s %p", RESULT=="312345", 
> NAME="disk%n"
> and that doesn't work in RHEL5, definitely I tried 
> BUS="scsi", PROGRAM="/sbin/scsi_id", RESULT="312345", NAME="disk%n"
> in RHEL5, no luck.
>
> Wenle
>   
I did it like this on my REHL5.2 with SAN storage connected:
My objective is to give a partition a static name.
1. get the info from the partition, for example sdb3
# udevinfo -a -p /sys/block/sdb/sdb3
2. pick up the size info(all partitions have different size, I use the 
size to identify the partition), and create /etc/udev/rules.d/20-user.rules:
BUS=="scsi",SYSFS{size}=="398636417",SYSFS{start}=="62",SYMLINK="newname"
3. # /sbin/udevstart
4. use the static name /dev/newname to mount to a folder
5. (option) put a line into /etc/fstab to make it work on reboot


hope it help.

Allen




More information about the redhat-list mailing list