From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <gentoo-user+bounces-140311-garchives=archives.gentoo.org@lists.gentoo.org>
Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80])
	by finch.gentoo.org (Postfix) with ESMTP id E7C6013800E
	for <garchives@archives.gentoo.org>; Thu,  2 Aug 2012 00:04:20 +0000 (UTC)
Received: from pigeon.gentoo.org (localhost [127.0.0.1])
	by pigeon.gentoo.org (Postfix) with SMTP id AE544E07FB;
	Thu,  2 Aug 2012 00:03:57 +0000 (UTC)
Received: from mail-gh0-f181.google.com (mail-gh0-f181.google.com [209.85.160.181])
	by pigeon.gentoo.org (Postfix) with ESMTP id A64F1E07B4
	for <gentoo-user@lists.gentoo.org>; Thu,  2 Aug 2012 00:01:54 +0000 (UTC)
Received: by ghbz13 with SMTP id z13so8574193ghb.40
        for <gentoo-user@lists.gentoo.org>; Wed, 01 Aug 2012 17:01:54 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20120113;
        h=mime-version:in-reply-to:references:date:message-id:subject:from:to
         :content-type:content-transfer-encoding;
        bh=wa43cDsmRX8LhQ4sC6xUjEXntsQ3pP7Eu3jPG6osIR0=;
        b=b1Od0wJXzPofjx7A/yHHYVjOsUJcReEcstvRjPVpHQwW0/x3rdqMN2IVwqHtYY8Qpt
         AY/gKhq9euDlj5hIFe2i5mGO9RqzPqr9t4OpDyxYObHUFybnoEZarNVUlsw9hxSUKkZE
         XiwkfL0veK+XyEUHgLtkM7pcj5AlfJUZLoYNUQWhR8+8Htik5XVxzig43+Nygp2zWgDZ
         Ony89+arTIUVxC8NLkGEAtkV+gMsds2AXrTNzPvlMfwJe3O5LpmR3usODDfv9tmZseb9
         KrVTCmLiuua3pr7QoDvCaf3SCRuD/w/ixmVMMH39gDooYh0pK5L6ZM+uYgzrmAJ1ENKd
         /Lsg==
Precedence: bulk
List-Post: <mailto:gentoo-user@lists.gentoo.org>
List-Help: <mailto:gentoo-user+help@lists.gentoo.org>
List-Unsubscribe: <mailto:gentoo-user+unsubscribe@lists.gentoo.org>
List-Subscribe: <mailto:gentoo-user+subscribe@lists.gentoo.org>
List-Id: Gentoo Linux mail <gentoo-user.gentoo.org>
X-BeenThere: gentoo-user@lists.gentoo.org
Reply-to: gentoo-user@lists.gentoo.org
MIME-Version: 1.0
Received: by 10.236.78.106 with SMTP id f70mr18864780yhe.51.1343865714152;
 Wed, 01 Aug 2012 17:01:54 -0700 (PDT)
Received: by 10.100.194.7 with HTTP; Wed, 1 Aug 2012 17:01:54 -0700 (PDT)
In-Reply-To: <CADPrc80MDOPdykn_G4mZ_DKyw=Rwr4buMbi-vDRZ4ZZu1s84Ew@mail.gmail.com>
References: <20120802013404.3c67615a@weird.wonkology.org>
	<CADPrc80MDOPdykn_G4mZ_DKyw=Rwr4buMbi-vDRZ4ZZu1s84Ew@mail.gmail.com>
Date: Wed, 1 Aug 2012 19:01:54 -0500
Message-ID: <CADPrc83viVv-+vPma99PYbbZ1OcY05GVbqodWM_EtPPsy=EtTQ@mail.gmail.com>
Subject: Re: [gentoo-user] Udev rules for identical hard drives
From: =?UTF-8?B?Q2FuZWsgUGVsw6FleiBWYWxkw6lz?= <caneko@gmail.com>
To: gentoo-user@lists.gentoo.org
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
X-Archives-Salt: 4faad17a-5ebe-496f-8d25-237cfce491f8
X-Archives-Hash: 0af523d75448e8603dc401e5f94b0255

On Wed, Aug 1, 2012 at 6:59 PM, Canek Pel=C3=A1ez Vald=C3=A9s <caneko@gmail=
.com> wrote:
> On Wed, Aug 1, 2012 at 6:34 PM, Alex Schuster <wonko@wonkology.org> wrote=
:
>> Hi there!
>>
>> I do not understand the numbering of my hard drives. There may be some
>> inherent logic, but whenever I make some changes, like replacing drives,
>> or changing BIOS settings, the order changes. Maybe it's even more rando=
m.
>>
>> So I made some udev rules like this, and my drives are called /dev/hd1,
>> hd2 and hd3:
>>
>> SUBSYSTEMS=3D=3D"scsi", KERNEL=3D=3D"sd?", ATTRS{model}=3D=3D"SAMSUNG HD=
154UI",
>> SYMLINK=3D"hd1"
>>
>> This works fine, and this way I can address them in scripts, smartd and
>> hdparm config files and such. But now I have two identical drives. I had
>> this before with the drive above, but while being identical models, the
>> two drives differed a little in size, so I just had to add ATTR{size}.
>> This does not help with my current drives, and I find nothing
>> in /sys/block/sd?/device/ that differs. Could there be another way to
>> distinguish the drives, like looking at the partition scheme or somethin=
g?
>
> If you want to distinguish partitions, I would recommend using labels
> (in fstab too); those never change unless you specifically change
> them. Then, no matter how you put them in your machine, they will get
> mounted correctly, and then you don't need to fuzz with udev rules.
> Also, as a superficial bonus, they get mounted using the label and it
> looks nice in your file browser.
>
> The drives themselves I see no reason to recognize them, why do you
> need to do that?

Oh, and I forgot; doesn't the links in /dev/disk/by-id,
/dev/disk/by-label, /dev/disk/by-uuid do what you want to?

Regards.
--=20
Canek Pel=C3=A1ez Vald=C3=A9s
Posgrado en Ciencia e Ingenier=C3=ADa de la Computaci=C3=B3n
Universidad Nacional Aut=C3=B3noma de M=C3=A9xico