How to find driver usage.
Bryn M. Reeves
bmr at redhat.com
Wed Oct 14 15:26:41 UTC 2009
On Wed, 2009-10-14 at 15:52 +0100, Dan Track wrote:
> I've got two disks /dev/sda and /dev/sdb. I'd like to reload the
> driver that they are using. How can I find out what driver is being
> used by them?
The sysfs file system (normally mounted at /sys) is your friend, e.g:
$ ls -l /sys/block/sda/device/driver
lrwxrwxrwx 1 root root 0 2009-10-14 16:16 /sys/block/sda/device/driver
-> ../../../../../../bus/scsi/drivers/sd
But this just tells us that it's being driven by the SCSI disk driver
(sd) which is kinda obvious.
A lot more information is hidden away here however - you can use tools
like udevinfo or systool to trawl the file system and output the
information in a more readable format.
To get all attributes for sda:
$ udevinfo -ap /block/sda
http://pastebin.com/m1fb2047d
To get device attributes for all scsi disks on the system:
$ systool -c scsi_disk -v
http://pastebin.com/m263ebacc
Regards,
Bryn.
More information about the fedora-list
mailing list