Comment 5 for bug 474790

Revision history for this message
Dennis Craven (dcraven) wrote : Re: DeviceKit should ignore SmartWare partitions when using Western Digital external drives

So. Here is what I did...

First I tried to create a rule matching what Martin suggested in comment #2. I added a rule to/lib/udev/rules.d/95-devkit-disks.rules. It looked like this:
    ENV{ID_FS_TYPE}=="WD_SmartWare", ENV{DKD_PARTITION_SCHEME}=="apm", ENV{DKD_PRESENTATION_HIDE}="1"

This rule for some reason did not match/work. After restarting udev (is this even necessary?) and plugging in the drive, that rule was ignored and the SmartWare partition mounted as a CD.

Based on the autogenerated entry in /etc/udev/rules.d/70-persistent-cd.rules when the drive is detected, I tried adding this rule to the /lib/udev/rules.d/95-devkit-disks.rules file:
    SUBSYSTEM=="block", ENV{ID_CDROM}=="?*", ENV{ID_SERIAL}=="WD_Virtual_CD*", ENV{DKD_PRESENTATION_HIDE}="1"

This worked fine, and the drive is hidden. Is this an appropriate and sufficiently generic rule in that it will work across other people's systems? Notice the * expression when specifying ID_SERIAL.