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 1M8fm2-00063y-NX for garchives@archives.gentoo.org; Mon, 25 May 2009 19:23:51 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id C624CE0542; Mon, 25 May 2009 19:23:48 +0000 (UTC) Received: from mail-ew0-f213.google.com (mail-ew0-f213.google.com [209.85.219.213]) by pigeon.gentoo.org (Postfix) with ESMTP id 67E2FE0542 for ; Mon, 25 May 2009 19:23:48 +0000 (UTC) Received: by ewy9 with SMTP id 9so3022653ewy.34 for ; Mon, 25 May 2009 12:23:47 -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=LsStb6hTYggAZpMUSOU62C2Ymnkk7yRM29wOE/Anklc=; b=rAnnI5QfNjpcKMO2uoiTjIB9EKP8LW9h9koS3NhZ37GcKtuKzdtG1ixuyUnWR43TAD Jn7Ukkx5jxRNQRbJkSg2jsB1yOaKUNIFsjveQ0aafG2edJ189ASJagBfHlfJC+A/lfth 1rXews6I0OHWOMGdo/h48VPFUSk+c2ni0KQeA= 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=vc8aKHPURQW1JlSSYRzqabj05qBy15CSSs6lQBMTBq9MNWsSkf2Tb6zXbPbBEgZ8W/ 7BzEGUWFD5adFSJmJzsxBIsnDvBC52JwY+904Q25I+BoH38hUWgxhaCxADAaIYkKAO2I ipjafWXtNMUL6fTSP5glGTUgz8nUJq4wW9Pws= 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.216.3.206 with SMTP id 56mr2209168weh.99.1243279427730; Mon, 25 May 2009 12:23:47 -0700 (PDT) In-Reply-To: <5bdc1c8b0905251200g2ccb7466l3008fe8a2b4c56ed@mail.gmail.com> References: <5bdc1c8b0905251200g2ccb7466l3008fe8a2b4c56ed@mail.gmail.com> Date: Mon, 25 May 2009 22:23:47 +0300 Message-ID: <7c65e4a70905251223l7c87e2fas68b40ea80a60319f@mail.gmail.com> Subject: Re: [gentoo-user] Auto-mounting USB drive? From: =?UTF-8?B?0JDQu9GM0YTQsNGA?= To: gentoo-user@lists.gentoo.org Content-Type: multipart/alternative; boundary=0016364d2b29a5952a046ac18c9b X-Archives-Salt: e2fec4a0-ccb1-4ae6-a0a4-a26150a4176c X-Archives-Hash: 5d7ac95f3ab2b453b1d3d5255beb8c30 --0016364d2b29a5952a046ac18c9b Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable 2009/5/25 Mark Knecht > Hi, > I'm wondering what I need to read about and do to get a USB drive > to auto-mount reliably at boot time? I don't know anything about udev > so I tried what I thought used to work in my /etc/fstab file but it > doesn't work. The drive mounts by hand just fine: > > MacMini linux # cat /etc/fstab | grep video > /dev/sda1 /video ext3 auto,rw 0= 2 > MacMini linux # df > Filesystem 1K-blocks Used Available Use% Mounted on > /dev/hda4 75890040 60601600 11433376 85% / > udev 10240 164 10076 2% /dev > shm 257396 0 257396 0% /dev/shm > MacMini linux # mount /dev/sda1 /video > MacMini linux # df > Filesystem 1K-blocks Used Available Use% Mounted on > /dev/hda4 75890040 60601604 11433372 85% / > udev 10240 164 10076 2% /dev > shm 257396 0 257396 0% /dev/shm > /dev/sda1 157566568 192068 149370520 1% /video > MacMini linux # > > Must I use udev (and if so how - what do I study to make this work) > or can I do this in fstab and I've just forgotten something simple? > > Also, what's the feeling these days about the reliability of > automounting by device? Would I be better to use e2label on the > partition? > > Thanks in advance, > Mark > > run *lsusb =E2=80=93v* you will see somethin like this *Bus 003 Device 010: ID 152d:2338* *Device Descriptor:* *...dVendor 0x152d* * idProduct 0x2338* * bcdDevice 1.00* * **iManufacturer 1* * iProduct 2* * iSerial 5* * bNumConfigurations 1* Now make file /etc/udev/rule.d/z98-usb-flash.rules with this content *SUBSYSTEM**=3D=3D"block**", SYSFS**{idProduct**}=3D=3D"2338", SYSFS**{idVendor**}=3D=3D"152d**", NAME**=3D"name**" **RUN+=3D"/bin/mount /dev/name /media/name"* * Change idProduct and idVendor and to your data. And name too. With this name your device will apear in /dev. And of course mkfir /media/name * --0016364d2b29a5952a046ac18c9b Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable

2009/5/25 Mark Knecht = <markknecht@gmail.com>
Hi,
=C2=A0 I'm wondering what I need to read about and do to get a USB dri= ve
to auto-mount reliably at boot time? I don't know anything about udev so I tried what I thought used to work in my /etc/fstab file but it
doesn't work. The drive mounts by hand just fine:

MacMini linux # cat /etc/fstab | grep video
/dev/sda1 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 /video =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0ext3 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0au= to,rw =C2=A0 =C2=A0 =C2=A0 =C2=A0 0 2
MacMini linux # df
Filesystem =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 1K-blocks =C2=A0 =C2=A0 =C2= =A0Used Available Use% Mounted on
/dev/hda4 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 75890040 =C2=A060601600= =C2=A011433376 =C2=A085% /
udev =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = 10240 =C2=A0 =C2=A0 =C2=A0 164 =C2=A0 =C2=A0 10076 =C2=A0 2% /dev
shm =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 2= 57396 =C2=A0 =C2=A0 =C2=A0 =C2=A0 0 =C2=A0 =C2=A0257396 =C2=A0 0% /dev/shm<= br> MacMini linux # mount /dev/sda1 /video
MacMini linux # df
Filesystem =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 1K-blocks =C2=A0 =C2=A0 =C2= =A0Used Available Use% Mounted on
/dev/hda4 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 75890040 =C2=A060601604= =C2=A011433372 =C2=A085% /
udev =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = 10240 =C2=A0 =C2=A0 =C2=A0 164 =C2=A0 =C2=A0 10076 =C2=A0 2% /dev
shm =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 2= 57396 =C2=A0 =C2=A0 =C2=A0 =C2=A0 0 =C2=A0 =C2=A0257396 =C2=A0 0% /dev/shm<= br> /dev/sda1 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0157566568 =C2=A0 =C2=A01= 92068 149370520 =C2=A0 1% /video
MacMini linux #

=C2=A0 Must I use udev (and if so how - what do I study to make this work)=
or can I do this in fstab and I've just forgotten something simple?

=C2=A0 Also, what's the feeling these days about the reliability of automounting by device? Would I be better to use e2label on the
partition?

Thanks in advance,
Mark



run lsusb =E2=80=93v

you will see somethin like this

Bu= s 003 Device 010: ID 152d:2338

Device Descriptor:

...dVendor=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 0x152d=

=C2=A0 idProduct=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 0x2338

=C2=A0 bcdDevice=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 1.00

=C2= =A0 iManufacturer=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 1

=C2=A0 iProduct=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 2

=C2=A0 iSerial=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0 5

=C2=A0 bNumConfi= gurations=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 1

Now make file /etc/udev/rule.d/z98-usb-
fla= sh.rules with this content
SUBSYSTEM=3D=3D"=
block", SYSFS{idPro=
duct}=3D=3D"2338", SYSFS{idVendor}=3D=3D"152d", <=
/span>NAME=3D"name" <=
/em>RUN+=3D"/bin/mount /dev/name /media/name"


Change idProduct and idVendor and to your data. And name = too. With this name your device will apear in /dev. And of course mkfir /me= dia/name

--0016364d2b29a5952a046ac18c9b--