Messages in this thread |  | | From | Gary_Lerhaupt@Dell ... | Subject | [ANNOUNCE] devlabel: consistent device access through symlinking | Date | Fri, 6 Sep 2002 12:40:08 -0500 |
| |
Attached is a program I have been working on to allow for consistent access to storage devices. It works by creating symlinks to actual storage device names. When coupled with the UUID of the disk in question, the symlink can consistently point to the right data even if the device name changes. Devices can thus be referenced by their symlink only and this symlink is user-definable.
Moreover, I've incorporated it into the current hotplug system (I did my testing on Red Hat 7.3/Advanced Server 2.1). You should, for example, be able to plug your flashcard reader into your USB slot, add a symlink to it and then use this symlink as its reference. Remove the cardreader from USB and the symlink should disappear. Re-insert and the symlink will come back. This should also work for PCMCIA devices as well as IEEE1394 (firewire). While patches are included with this RPM, the eventual idea would be to get the code added directly into hotplug.
The UUIDs gathered vary dependent on the device in question. For SCSI (this includes USB/firewire) it will attempt to search for IDS in the following order: Page83 type 3, Page83 type 2, Page83 type 1, Page 80, Page83 type 0, Manufacturer/Model Name. For IDE, it only looks in /proc/ide/hd#/identify (words 10-19, the serial number). In both cases it will always try to append the manufacturer/model data so that in the event that your device does not return any UUID (eg. megaraid) you will at least be able to use this as an ID. However, if more than one device on your system returns the same ID, neither will be usable with devlabel. It is also worth noting that USB/Firewire stuffs return the UUID of the reader and not of the storage contained within. This is not such a bad thing if you think about it, but you should probably label your symlink accordingly (eg. /dev/flashreader instead of /dev/flashdisk1).
Also included with the RPM is an rc.sysinit patch to run devlabel on boot. I am not quite sure I have placed this correctly and this is important if you wish to use your symlinks within /etc/fstab. Want to make sure that the symlink is correct before fstab gets ahold of it. I may also consider writing additional code to comment out references in fstab in the event that the symlink has been deleted because the UUID can no longer be determined/found (maybe a "restart safefstab" parameter or something).
I'm very interested in feedback. Thanks.
Gary Lerhaupt ESG Linux Solutions Dell Computer Corporation
[unhandled content-type:application/octet-stream] |  |