USB Drive changes ATTRS{serial} everytime plugged in - Hardware
This is a discussion on USB Drive changes ATTRS{serial} everytime plugged in - Hardware ; Hello everyone,
I was trying to get udev mounting my encrypted partition automagically
when my USB drive with the key on it is plugged in. Mounting works
fine (when script is run by hand), but I didn't manage to get ...
-
USB Drive changes ATTRS{serial} everytime plugged in
Hello everyone,
I was trying to get udev mounting my encrypted partition automagically
when my USB drive with the key on it is plugged in. Mounting works
fine (when script is run by hand), but I didn't manage to get the udev
rule working. Now I found why.
Everytime I plug in the USB drive it gets a different ATTRS{serial} as
reported by:
udevinfo -a -p `udevinfo -q path -n /dev/sdg`| grep serial
The reported serial number is only 2 hex digits long and seems to be
random.
I have another identical USB drive (same model) which provides a quite
long number that does NOT change. That is what I do actually need...
(Please do not recommend using the other device instead -- one of them
will be plugged into my docking station, the other one is for "mobile"
use)
You know why this happens? I cannot imagine a sensible explanation.
Except this detail the USB drive works without problems -- it does not
seem to be damaged/broken.
I would be glad to get some hints what could cause this problem. If
needed I will provide more information or logs. Just ask for
particular ones.
Kind regards
Daniel Böhmer, Germany
-
Re: USB Drive changes ATTRS{serial} everytime plugged in
boehmerdaniel@web.de wrote:
> Hello everyone,
>
> I was trying to get udev mounting my encrypted partition automagically
> when my USB drive with the key on it is plugged in. Mounting works
> fine (when script is run by hand), but I didn't manage to get the udev
> rule working. Now I found why.
>
> Everytime I plug in the USB drive it gets a different ATTRS{serial} as
> reported by:
>
> udevinfo -a -p `udevinfo -q path -n /dev/sdg`| grep serial
>
> The reported serial number is only 2 hex digits long and seems to be
> random.
You have a broken device.
>
> I have another identical USB drive (same model) which provides a quite
> long number that does NOT change. That is what I do actually need...
> (Please do not recommend using the other device instead -- one of them
> will be plugged into my docking station, the other one is for "mobile"
> use)
The problem is you have one good behaving device, and one bad
one. The ability to use some kind persistent name is somewhat
critical, but maybe not in your case. It's possible that you
could write a custom udev rule that says if the vendor is such and
such, then do the following symlink or something like that.
I've got several devices at my house that do NOT have
serial numbers...well it's in the drive, but not exposed
through the USB (which unfortunately is the only one that
matters)... In my case, I'm just stuck, there is no way of
differentiating the devices (sigh) since they all look alike
to the system.
>
>
> You know why this happens? I cannot imagine a sensible explanation.
> Except this detail the USB drive works without problems -- it does not
> seem to be damaged/broken.
Well it is broken if it's serial number changes all of the time.
Something isn't right.
>
> I would be glad to get some hints what could cause this problem. If
> needed I will provide more information or logs. Just ask for
> particular ones.
I say your device is broken with regards to serial number info.
It's possible it's a bug... but doubtful... I'd think we'd be
hearing many people complain.