* [gentoo-user] Auto-mounting USB drive?
@ 2009-05-25 19:00 Mark Knecht
2009-05-25 19:11 ` Jarry
2009-05-25 19:23 ` Альфар
0 siblings, 2 replies; 7+ messages in thread
From: Mark Knecht @ 2009-05-25 19:00 UTC (permalink / raw
To: gentoo-user
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
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [gentoo-user] Auto-mounting USB drive?
2009-05-25 19:00 [gentoo-user] Auto-mounting USB drive? Mark Knecht
@ 2009-05-25 19:11 ` Jarry
2009-05-25 19:24 ` Mark Knecht
2009-05-25 19:23 ` Альфар
1 sibling, 1 reply; 7+ messages in thread
From: Jarry @ 2009-05-25 19:11 UTC (permalink / raw
To: gentoo-user
Mark Knecht wrote:
> Hi,
> I'm wondering what I need to read about and do to get a USB drive
> to auto-mount reliably at boot time?
Try this:
http://www.gentoo.org/doc/en/usb-guide.xml
I do not use usb-automounting now, but I tested it some time ago
on my laptop, and it worked well. Just follow that guide...
Jarry
--
_______________________________________________________________
This mailbox accepts e-mails only from selected mailing-lists!
Everything else is considered to be spam and therefore deleted.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [gentoo-user] Auto-mounting USB drive?
2009-05-25 19:00 [gentoo-user] Auto-mounting USB drive? Mark Knecht
2009-05-25 19:11 ` Jarry
@ 2009-05-25 19:23 ` Альфар
2009-05-26 4:35 ` Stroller
1 sibling, 1 reply; 7+ messages in thread
From: Альфар @ 2009-05-25 19:23 UTC (permalink / raw
To: gentoo-user
[-- Attachment #1: Type: text/plain, Size: 2207 bytes --]
2009/5/25 Mark Knecht <markknecht@gmail.com>
> 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 –v*
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**=="block**", SYSFS**{idProduct**}=="2338",
SYSFS**{idVendor**}=="152d**", NAME**="name**" **RUN+="/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
*
[-- Attachment #2: Type: text/html, Size: 3541 bytes --]
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [gentoo-user] Auto-mounting USB drive?
2009-05-25 19:23 ` Альфар
@ 2009-05-26 4:35 ` Stroller
2009-05-26 7:53 ` Neil Bothwick
0 siblings, 1 reply; 7+ messages in thread
From: Stroller @ 2009-05-26 4:35 UTC (permalink / raw
To: gentoo-user
On 25 May 2009, at 20:23, Альфар wrote:
> ...
> Now make file /etc/udev/rule.d/z98-usb-flash.rules with this content
> SUBSYSTEM=="block", SYSFS{idProduct}=="2338",
> SYSFS{idVendor}=="152d", NAME="name" RUN+="/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
I hope you won't be offended, but this seems a whole load more complex
than the OP's single line in /etc/fstab, which really ought to work.
Of course /etc/fstab is no good if the drive's going to be plugged &
unplugged at whim throughout the day - I know there are better ways to
do that - but I would be bothered, myself, why something's not working
as it _so obviously_ ought to.
Mark: yes, I don't see any reason NOT to address by label (e2label or
whatever XFS / Reiser use) these days. The only thing I can think of
is that your USB drivers or the kernel module that does USB mass-
storage is not loaded in time during boot. Aren't there any messages
about failed mounts amongst the kernel messages on the screen?
Stroller.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [gentoo-user] Auto-mounting USB drive?
2009-05-26 4:35 ` Stroller
@ 2009-05-26 7:53 ` Neil Bothwick
2009-05-26 22:37 ` Mark Knecht
0 siblings, 1 reply; 7+ messages in thread
From: Neil Bothwick @ 2009-05-26 7:53 UTC (permalink / raw
To: gentoo-user
[-- Attachment #1: Type: text/plain, Size: 838 bytes --]
On Tue, 26 May 2009 05:35:46 +0100, Stroller wrote:
> Mark: yes, I don't see any reason NOT to address by label (e2label or
> whatever XFS / Reiser use) these days. The only thing I can think of
> is that your USB drivers or the kernel module that does USB mass-
> storage is not loaded in time during boot. Aren't there any messages
> about failed mounts amongst the kernel messages on the screen?
That's most likely the problem, I had a similar situation trying to mount
an SD card at boot time. Two solutions are to mount the device later in
the boot sequence, from /etc/conf.d/local, or to build the necessary
modules into the kernel. Since you're mounting the USB device on boot,
there's no point in having separate modules for USB.
--
Neil Bothwick
This is as bad as it can get; but don't bet on it.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 198 bytes --]
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [gentoo-user] Auto-mounting USB drive?
2009-05-26 7:53 ` Neil Bothwick
@ 2009-05-26 22:37 ` Mark Knecht
0 siblings, 0 replies; 7+ messages in thread
From: Mark Knecht @ 2009-05-26 22:37 UTC (permalink / raw
To: gentoo-user
On Tue, May 26, 2009 at 12:53 AM, Neil Bothwick <neil@digimed.co.uk> wrote:
> On Tue, 26 May 2009 05:35:46 +0100, Stroller wrote:
>
>> Mark: yes, I don't see any reason NOT to address by label (e2label or
>> whatever XFS / Reiser use) these days. The only thing I can think of
>> is that your USB drivers or the kernel module that does USB mass-
>> storage is not loaded in time during boot. Aren't there any messages
>> about failed mounts amongst the kernel messages on the screen?
>
> That's most likely the problem, I had a similar situation trying to mount
> an SD card at boot time. Two solutions are to mount the device later in
> the boot sequence, from /etc/conf.d/local, or to build the necessary
> modules into the kernel. Since you're mounting the USB device on boot,
> there's no point in having separate modules for USB.
>
>
> --
> Neil Bothwick
Stroller & Neil,
Thanks. I don't know why but I hadn't considered the idea that the
USB driver would be better built into the kernel for this application.
Basically, this is a little PowerPC Mac Mini that I've turned into a
new HD Homerun/USB video storage MythTV backend server. I want to be
pretty confident that the hard drive is mounted because the machine is
headless and sitting in a corner. If someone turns it on after a power
failure I don't want to have to mess around to get the external
storage mounted. I don't need the drive mounted at boot time, but I
certainly want it up and running before the mythbackend script gets
started. If I get a power failure and someone restarts everything it
could be in the middle of a previous recording and I need the partial
recording to end up on USB.
I'll look at building in the USB driver into the kernel and using
e2label also.
I did actually manage to get it working using some udev rules that
I found in the forum, but I must say I don't really understand them
and never thought they were necessary. I'm glad you guys are thinking
the same way.
Thanks,
Mark
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2009-05-26 22:37 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-05-25 19:00 [gentoo-user] Auto-mounting USB drive? Mark Knecht
2009-05-25 19:11 ` Jarry
2009-05-25 19:24 ` Mark Knecht
2009-05-25 19:23 ` Альфар
2009-05-26 4:35 ` Stroller
2009-05-26 7:53 ` Neil Bothwick
2009-05-26 22:37 ` Mark Knecht
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox