public inbox for gentoo-user@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-user] UDEV rule problem
@ 2016-11-14 14:31 Helmut Jarausch
  2016-11-14 14:51 ` Stefan G. Weichinger
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Helmut Jarausch @ 2016-11-14 14:31 UTC (permalink / raw
  To: gentoo-user

Hi,

I have two external USB3 hard disk enclosures. They have the same  
vendor, model and the same serial number (unfortunately).
Vendor, model and serial occur in the usb-subsystem only.

Since the hard drives within theses enclosures have different  
capacities, there is a different ATTR{size} value in the  
block-subsystem.
But this doesn't have any vendor info.

How can I write to different udev rules to distinguish these two  
external hard disks?

Many thanks for a hint,
Helmut


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [gentoo-user] UDEV rule problem
  2016-11-14 14:31 [gentoo-user] UDEV rule problem Helmut Jarausch
@ 2016-11-14 14:51 ` Stefan G. Weichinger
  2016-11-14 20:33 ` [gentoo-user] " Kai Krakow
  2016-11-15 10:20 ` Martin Vaeth
  2 siblings, 0 replies; 4+ messages in thread
From: Stefan G. Weichinger @ 2016-11-14 14:51 UTC (permalink / raw
  To: gentoo-user

Am 2016-11-14 um 15:31 schrieb Helmut Jarausch:
> Hi,
>
> I have two external USB3 hard disk enclosures. They have the same 
> vendor, model and the same serial number (unfortunately).
> Vendor, model and serial occur in the usb-subsystem only.
>
> Since the hard drives within theses enclosures have different 
> capacities, there is a different ATTR{size} value in the block-subsystem.
> But this doesn't have any vendor info.
>
> How can I write to different udev rules to distinguish these two 
> external hard disks? 

It's not udev, but why not use the UUIDs of the filesystems?

# ls -l /dev/disk/by-uuid

and then for example in /etc/fstab

UUID=028da5ef-4e73-405a-b739-d59204c54921 /mnt/externaldisk1 ext4 
relatime,noauto,user 0 1
UUID=fae458a3-da30-43c5-81f1-be2d49215b09 /mnt/externaldisk2 ext4 
relatime,noauto,user 0 1

just a suggestion, I don't know your specific use-case



^ permalink raw reply	[flat|nested] 4+ messages in thread

* [gentoo-user] Re: UDEV rule problem
  2016-11-14 14:31 [gentoo-user] UDEV rule problem Helmut Jarausch
  2016-11-14 14:51 ` Stefan G. Weichinger
@ 2016-11-14 20:33 ` Kai Krakow
  2016-11-15 10:20 ` Martin Vaeth
  2 siblings, 0 replies; 4+ messages in thread
From: Kai Krakow @ 2016-11-14 20:33 UTC (permalink / raw
  To: gentoo-user

Am Mon, 14 Nov 2016 15:31:58 +0100
schrieb Helmut Jarausch <jarausch@skynet.be>:

> Hi,
> 
> I have two external USB3 hard disk enclosures. They have the same  
> vendor, model and the same serial number (unfortunately).
> Vendor, model and serial occur in the usb-subsystem only.
> 
> Since the hard drives within theses enclosures have different  
> capacities, there is a different ATTR{size} value in the  
> block-subsystem.
> But this doesn't have any vendor info.
> 
> How can I write to different udev rules to distinguish these two  
> external hard disks?

I've seen many drives where really the serial number as reported by
Linux is the model number, and the serial number is somehow invisible...
Not sure if this is a kernel bug or some ATA protocol violation.
Especially USB enclosures are a problem with this...

-- 
Regards,
Kai

Replies to list-only preferred.



^ permalink raw reply	[flat|nested] 4+ messages in thread

* [gentoo-user] Re: UDEV rule problem
  2016-11-14 14:31 [gentoo-user] UDEV rule problem Helmut Jarausch
  2016-11-14 14:51 ` Stefan G. Weichinger
  2016-11-14 20:33 ` [gentoo-user] " Kai Krakow
@ 2016-11-15 10:20 ` Martin Vaeth
  2 siblings, 0 replies; 4+ messages in thread
From: Martin Vaeth @ 2016-11-15 10:20 UTC (permalink / raw
  To: gentoo-user

Helmut Jarausch <jarausch@skynet.be> wrote:
>
> Since the hard drives within theses enclosures have different
> capacities, there is a different ATTR{size} value in the
> block-subsystem.
>
> How can I write to different udev rules to distinguish these two
> external hard disks?

KERNEL=="sd[a-z]*", ATTR{size}=="31...", ATTRS{model}=="...", SYMLINK+="d1%n", OPTIONS="last_rule"



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-11-15 10:21 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-11-14 14:31 [gentoo-user] UDEV rule problem Helmut Jarausch
2016-11-14 14:51 ` Stefan G. Weichinger
2016-11-14 20:33 ` [gentoo-user] " Kai Krakow
2016-11-15 10:20 ` Martin Vaeth

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox