From mboxrd@z Thu Jan  1 00:00:00 1970
Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org)
	by finch.gentoo.org with esmtp (Exim 4.60)
	(envelope-from <gentoo-user+bounces-101279-garchives=archives.gentoo.org@lists.gentoo.org>)
	id 1MuA0q-0002ly-3b
	for garchives@archives.gentoo.org; Sat, 03 Oct 2009 19:11:24 +0000
Received: from pigeon.gentoo.org (localhost [127.0.0.1])
	by pigeon.gentoo.org (Postfix) with SMTP id 06F92E09FB;
	Sat,  3 Oct 2009 19:11:23 +0000 (UTC)
Received: from mail-fx0-f220.google.com (mail-fx0-f220.google.com [209.85.220.220])
	by pigeon.gentoo.org (Postfix) with ESMTP id A9423E09FB
	for <gentoo-user@lists.gentoo.org>; Sat,  3 Oct 2009 19:11:22 +0000 (UTC)
Received: by fxm20 with SMTP id 20so1909339fxm.14
        for <gentoo-user@lists.gentoo.org>; Sat, 03 Oct 2009 12:11:22 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=gamma;
        h=domainkey-signature:mime-version:received:in-reply-to:references
         :date:message-id:subject:from:to:content-type;
        bh=mnHvNqRzo090iuZeHTklMtWAAR+RJ44uBSKXNV2T4q4=;
        b=fCimixdq1qx7ouuQKDMcT9Th6iUXmFkysvlokDjj2yUQxeQJOSt2/sj9QZJ06f0NUk
         jYrqhtQ+b7P+gYYmBVcmil6FrK5gPHwtGp2gGixXrZUxlHRGTinCUkZNwkvR6e7KfZSo
         wRVhHLS9w+hZwx6MROl7tX1zu1ULkTGooAyjY=
DomainKey-Signature: a=rsa-sha1; c=nofws;
        d=gmail.com; s=gamma;
        h=mime-version:in-reply-to:references:date:message-id:subject:from:to
         :content-type;
        b=vlApshax7rlRHyGJEVRMekbQMa5vvR+NE8SUd09L+xkJmf1zj8+JPqSKI564Km0ruE
         DdyUvGaJZMxUoJYKgvoRxt9kQVh+4AXdGLJc/vGSpp4jXx6OGc7qloSud/KJTrabhJbN
         PYpols0/d9JAaGdvBLL1EYBfgyrQVo8h8WLL0=
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.239.168.144 with SMTP id k16mr405495hbe.103.1254597081941; 
	Sat, 03 Oct 2009 12:11:21 -0700 (PDT)
In-Reply-To: <4E750AB0-D4BE-47F9-A4EE-C43974902AC0@stellar.eclipse.co.uk>
References: <7bef1f890909280623g63134518pfa00614539e70019@mail.gmail.com>
	 <3ac129340910030730p183bd83as951f36504c6a7380@mail.gmail.com>
	 <4E750AB0-D4BE-47F9-A4EE-C43974902AC0@stellar.eclipse.co.uk>
Date: Sun, 4 Oct 2009 04:11:21 +0900
Message-ID: <3ac129340910031211t7d5be74bhb98deb2fae618730@mail.gmail.com>
Subject: Re: [gentoo-user] Double nautilus windows for each USB flash drive 
	plugged in
From: daid kahl <daidxor@gmail.com>
To: gentoo-user@lists.gentoo.org
Content-Type: multipart/alternative; boundary=00163649914b67c7fa04750ca512
X-Archives-Salt: 6e9f3fa2-6c99-4f0b-9450-c36068f5e6af
X-Archives-Hash: 53a52798317f632bc11926776ee962f4

--00163649914b67c7fa04750ca512
Content-Type: text/plain; charset=ISO-8859-1

> ...
>> Another useful notion is to use udev to automount flash drives (or
>> external usb harddrives)  to a specified location based on serial number.
>> ... I can either give an overview or dig up the url if anyone likes.
>>
>
> I'd have assumed you simple used any of the usual "automount drives with
> udev" guides. Am I wrong?
>
> This is the way I have always intended to approach this problem, so I'd be
> grateful to be corrected in advance if there's a better way.
>
>
That's correct, except not all of these guides discuss the drive serial
number.  If you want to ensure that different drives are mounted at
different points, you have to rely on the device serial (since the /dev
nodes are filled in order of the device connection, regardless of which
drive it is).

There are plenty of guides that mention how to find the serial number and
how to write the correct udev rules, but most the guides are outdated and
suggest use of the symlink udevinfo, which was removed upstream recently.
So, to get a device's serial number, for example (replace /dev/sdb with the
correct node) :

# udevadm info -a -p $(udevadm info -q path -n /dev/sdb) | grep
ATTRS{serial}

and use the (first) serial that doesn't have colons and periods.  Then for
the udev rule you just need to include ATTRS{serial}==" 0000000000"

This is also useful when you have external harddrives that use ext3
formatting and flashdrives that don't.

~daid

--00163649914b67c7fa04750ca512
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

<br><div class=3D"gmail_quote"><blockquote class=3D"gmail_quote" style=3D"b=
order-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; paddin=
g-left: 1ex;"><blockquote class=3D"gmail_quote" style=3D"border-left: 1px s=
olid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
...<br>
Another useful notion is to use udev to automount flash drives (or external=
 usb harddrives) =A0to a specified location based on serial number. ... I c=
an either give an overview or dig up the url if anyone likes.<br>
</blockquote>
<br>
I&#39;d have assumed you simple used any of the usual &quot;automount drive=
s with udev&quot; guides. Am I wrong?<br>
<br>
This is the way I have always intended to approach this problem, so I&#39;d=
 be grateful to be corrected in advance if there&#39;s a better way.<br>
<br>
</blockquote><div><br>That&#39;s correct, except not all of these guides di=
scuss the drive serial number.=A0 If you want to ensure that different driv=
es are mounted at different points, you have to rely on the device serial (=
since the /dev nodes are filled in order of the device connection, regardle=
ss of which drive it is).<br>
<br>There are plenty of guides that mention how to find the serial number a=
nd how to write the correct udev rules, but most the guides are outdated an=
d suggest use of the symlink udevinfo, which was removed upstream recently.=
=A0 So, to get a device&#39;s serial number, for example (replace /dev/sdb =
with the correct node) :<br>
<br># udevadm info -a -p $(udevadm info -q path -n /dev/sdb) | grep ATTRS{s=
erial}<br>=A0<br></div></div>and use the (first) serial that doesn&#39;t ha=
ve colons and periods.=A0 Then for the udev rule you just need to include A=
TTRS{serial}=3D=3D&quot; 0000000000&quot; <br>
<br>This is also useful when you have external harddrives that use ext3 for=
matting and flashdrives that don&#39;t.<br><br>~daid<br>

--00163649914b67c7fa04750ca512--