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 ) id 1MuiX2-0004Ng-MF for garchives@archives.gentoo.org; Mon, 05 Oct 2009 08:02:56 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 7E4D6E0ABD; Mon, 5 Oct 2009 08:02:55 +0000 (UTC) Received: from mail-iw0-f171.google.com (mail-iw0-f171.google.com [209.85.223.171]) by pigeon.gentoo.org (Postfix) with ESMTP id 5C443E0ABD for ; Mon, 5 Oct 2009 08:02:55 +0000 (UTC) Received: by iwn1 with SMTP id 1so1710143iwn.2 for ; Mon, 05 Oct 2009 01:02:55 -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 :from:date:message-id:subject:to:content-type; bh=4KRwcMNRFkl2dHoVNrsjg1bFp6pjlslEM4GCISVdKz8=; b=esZN+PdRQO9cos73LzcvpHhLm+4QGyuIaxpiXTevjh1BH8Xk6tLUNBE677UQLgKrV5 iD280z8+jZUU1m9x8e9sGGoJxNYy4NAnz5suRMpHr/cU+ChlIFtzx8azdxppMZyHa3Jo YWxsVGbK9mVDlrj7fZrbG9I5TSU6KXIHChLQM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; b=reGEgWsSJ3DJF/9mZ7PS0zZfC+Z6BfyOaLCEgBfSc2JWbXEWDXQ7LeANzULLQd36j+ 4jFWS0AA0oNRjOgb3JCk9hZ6N58W3J6tji405bhx+0kVk1A9SGZhTEj3EFXUaNm9M2j3 LnuL/ha19+hDEv+Cu0sCYHkdYVh3i9WuOovlU= Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-user@lists.gentoo.org Reply-to: gentoo-user@lists.gentoo.org MIME-Version: 1.0 Received: by 10.231.48.210 with SMTP id s18mr12178022ibf.3.1254729775110; Mon, 05 Oct 2009 01:02:55 -0700 (PDT) In-Reply-To: <20CBCC6E-20D8-43F9-A904-8E6A4FD5E725@stellar.eclipse.co.uk> References: <7bef1f890909280623g63134518pfa00614539e70019@mail.gmail.com> <3ac129340910030730p183bd83as951f36504c6a7380@mail.gmail.com> <4E750AB0-D4BE-47F9-A4EE-C43974902AC0@stellar.eclipse.co.uk> <3ac129340910031211t7d5be74bhb98deb2fae618730@mail.gmail.com> <20CBCC6E-20D8-43F9-A904-8E6A4FD5E725@stellar.eclipse.co.uk> From: "Alan E. Davis" Date: Mon, 5 Oct 2009 18:02:35 +1000 Message-ID: <7bef1f890910050102v1ca6498ak497967d5c4a83ce3@mail.gmail.com> Subject: Re: [gentoo-user] Double nautilus windows for each USB flash drive plugged in To: gentoo-user@lists.gentoo.org Content-Type: multipart/alternative; boundary=0015176f115c88e1a404752b8ad1 X-Archives-Salt: 0a32acb6-6784-44d3-a595-b0a910e66a7b X-Archives-Hash: 016d4846fbc7dfc696d118dcd5324b61 --0015176f115c88e1a404752b8ad1 Content-Type: text/plain; charset=ISO-8859-1 With Flash drive partitions labeled, the mounting is consistent. I have a git bare repo directory, on each of two flash drives to keep certain directories in sync on three machines. The repos are found consistently by git this method. I don't remember any specific method I used to get this mounting behavior into place, but I have had to specifically set GID for my user account on each machine to keep permissions in line. By the way, when I reformatted a drive, I just used the same label, which seemed to work fine. I wonder though whether this system might be defeated by convolutions of various kinds outside my control at a future time. Alan On Sun, Oct 4, 2009 at 5:24 AM, Stroller wrote: > > On 3 Oct 2009, at 20:11, daid kahl wrote: > >> ... >>> >>>> 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. >> > > Ooooops... I omitted a paste - I went to a terminal to check the details > and then appear to have completely forgotten to include them. Thus my > question is misphrased & incomplete. > > I intended to ask: > > I'd have assumed you simple used any of the usual "automount drives with > udev" guides, but based their entry in "/dev/disk/by-uuid/". Am I wrong? > > How do you find the serial, please? I'm guessing from `dmesg`? > > I think the entry in "/dev/disk/by-uuid/" may change if you reformat the > drive, so your response is most helpful. > > Thank you for your help, > > Stroller. > > > --0015176f115c88e1a404752b8ad1 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable With Flash drive partitions labeled, the mounting is consistent.=A0 I have = a git bare repo directory, on each of two flash drives to keep certain dire= ctories in sync on three machines.=A0 The repos are found consistently by = git this method.=A0 I don't remember any specific method I used to get = this mounting behavior into place, but I have had to specifically set GID f= or my user account on each machine to keep permissions in line.=A0

By the way, when I reformatted a drive, I just used the same label, whi= ch seemed to work fine.=A0 I wonder though whether this system might be def= eated by convolutions of various kinds outside my control at a future time.= =A0

Alan

On Sun, Oct 4, 2009 at 5:24 AM, = Stroller <stroller@stellar.eclipse.co.uk> wrote:

On 3 Oct 2009, at 20:11, daid kahl wrote:
...
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.

I'd have assumed you simple used any of the usual "automount drive= s 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. =A0If you want to ensure that different drives are mounted at diff= erent points, you have to rely on the device serial (since the /dev nodes a= re filled in order of the device connection, regardless of which drive it i= s).

There are plenty of guides that mention how to find the serial number and h= ow to write the correct udev rules, but most the guides are outdated and su= ggest use of the symlink udevinfo, which was removed upstream recently. =A0= 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{seria= l}

and use the (first) serial that doesn't have colons and periods. =A0The= n for the udev rule you just need to include ATTRS{serial}=3D=3D" 0000= 000000"

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

Ooooops... I omitted a paste - I went to a terminal to check the details an= d then appear to have completely forgotten to include them. Thus my questio= n is misphrased & incomplete.

I intended to ask:

=A0 I'd have assumed you simple used any of the usual "automount = drives with udev" guides, but based their entry in "/dev/disk/by-= uuid/". Am I wrong?

How do you find the serial, please? I'm guessing from `dmesg`?

I think the entry in "/dev/disk/by-uuid/" may change if you refor= mat the drive, so your response is most helpful.

Thank you for your help,

Stroller.



--0015176f115c88e1a404752b8ad1--