Quantcast

Automounting a USB hard disk in Ubuntu server - how?

classic Classic list List threaded Threaded
14 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Automounting a USB hard disk in Ubuntu server - how?

Chris Green
I have an external USB hard disk connected to an Ubuntu server 7.10
system.  What do I need to do (install something?) to get it to
automount?

It currently works quite happily with the following line in
/etc/fstab:-

    /dev/sdb1       /backup         ext3    user,noauto        0 0

but as it's quite slow to appear I can't remove the noauto I don't
think as the drive isn't yet there when the system is booted.  In
addition it's not *guaranteed* to be /dev/sdb1.

--
Chris Green

--
ubuntu-users mailing list
[hidden email]
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Automounting a USB hard disk in Ubuntu server - how?

Karl Larsen
Chris G wrote:

> I have an external USB hard disk connected to an Ubuntu server 7.10
> system.  What do I need to do (install something?) to get it to
> automount?
>
> It currently works quite happily with the following line in
> /etc/fstab:-
>
>     /dev/sdb1       /backup         ext3    user,noauto        0 0
>
> but as it's quite slow to appear I can't remove the noauto I don't
> think as the drive isn't yet there when the system is booted.  In
> addition it's not *guaranteed* to be /dev/sdb1.
>
>  
    Take all that stuff you added to /etc/fstab out of the file. Let
Ubuntu load it automatic and mine comes up fast as /media/disk. If you
do not have an ext3 file system on the portable hard drive do it now.

Karl


--

        Karl F. Larsen, AKA K5DI
        Linux User
        #450462   http://counter.li.org.
   PGP 4208 4D6E 595F 22B9 FF1C  ECB6 4A3C 2C54 FE23 53A7


--
ubuntu-users mailing list
[hidden email]
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Automounting a USB hard disk in Ubuntu server - how?

Chris Green
On Tue, Apr 29, 2008 at 06:56:02AM -0600, Karl Larsen wrote:

> Chris G wrote:
> > I have an external USB hard disk connected to an Ubuntu server 7.10
> > system.  What do I need to do (install something?) to get it to
> > automount?
> >
> > It currently works quite happily with the following line in
> > /etc/fstab:-
> >
> >     /dev/sdb1       /backup         ext3    user,noauto        0 0
> >
> > but as it's quite slow to appear I can't remove the noauto I don't
> > think as the drive isn't yet there when the system is booted.  In
> > addition it's not *guaranteed* to be /dev/sdb1.
> >
> >  
>     Take all that stuff you added to /etc/fstab out of the file. Let
> Ubuntu load it automatic and mine comes up fast as /media/disk. If you
> do not have an ext3 file system on the portable hard drive do it now.
>
The USB drive is already formatted ext3 and has backups on it (hence
its name!).

I've taken the line above out of /etc/fstab, when I reboot the system
I see the following in dmesg:-

    [   20.424000] usb-storage: device scan complete
    [   20.424000] scsi 2:0:0:0: Direct-Access     SAMSUNG  HD501LJ PQ: 0 ANSI: 2 CCS
    [   20.424000] sd 2:0:0:0: [sdb] 976773168 512-byte hardware sectors (500108 MB)
    [   20.424000] sd 2:0:0:0: [sdb] Write Protect is off
    [   20.424000] sd 2:0:0:0: [sdb] Mode Sense: 00 38 00 00
    [   20.424000] sd 2:0:0:0: [sdb] Assuming drive cache: write through
    [   20.428000] sd 2:0:0:0: [sdb] 976773168 512-byte hardware sectors (500108 MB)
    [   20.428000] sd 2:0:0:0: [sdb] Write Protect is off
    [   20.428000] sd 2:0:0:0: [sdb] Mode Sense: 00 38 00 00
    [   20.428000] sd 2:0:0:0: [sdb] Assuming drive cache: write through
    [   20.428000]  sdb:<7>eth0: no IPv6 routers present
    [   24.696000] Installing knfsd (copyright (C) 1996 [hidden email]).
    [   24.820000] NFSD: Using /var/lib/nfs/v4recovery as the NFSv4 state recovery directory
    [   24.832000] NFSD: starting 90-second grace period
    [   27.856000]  sdb1
    [   27.856000] sd 2:0:0:0: [sdb] Attached SCSI disk
    [   27.856000] sd 2:0:0:0: Attached scsi generic sg1 type 0

.... and then nothing.  The disk doesn't get mounted, at least I can't
see it anywhere and 'mount' doesn't report anything.


I'm not convinced that things will get automounted (by default) in
Ubuntu Server, remember there isn't any GUI running.

--
Chris Green

--
ubuntu-users mailing list
[hidden email]
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Automounting a USB hard disk in Ubuntu server - how?

Mario Vukelic
On Tue, 2008-04-29 at 14:36 +0100, Chris G wrote:
>
> I'm not convinced that things will get automounted (by default) in
> Ubuntu Server, remember there isn't any GUI running.

Google is your friend :) I searched for "mount an external usb disk in
ubuntu server" (without the quotes):


<http://www.google.com/search?q=mount+an+external+usb+disk+in+ubuntu
+server>

First hit: <http://ubuntuforums.org/showthread.php?t=245566>

It seems you need to load module usb-storage. Do so with "sudo modprobe
usb-storage", then plug in the drive and see whether it works. If so,
you can enter "usb-storage" into /etc/modules to make it load on boot.


--
ubuntu-users mailing list
[hidden email]
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Automounting a USB hard disk in Ubuntu server - how?

Karl Larsen
In reply to this post by Chris Green
Chris G wrote:

> On Tue, Apr 29, 2008 at 06:56:02AM -0600, Karl Larsen wrote:
>  
>> Chris G wrote:
>>    
>>> I have an external USB hard disk connected to an Ubuntu server 7.10
>>> system.  What do I need to do (install something?) to get it to
>>> automount?
>>>
>>> It currently works quite happily with the following line in
>>> /etc/fstab:-
>>>
>>>     /dev/sdb1       /backup         ext3    user,noauto        0 0
>>>
>>> but as it's quite slow to appear I can't remove the noauto I don't
>>> think as the drive isn't yet there when the system is booted.  In
>>> addition it's not *guaranteed* to be /dev/sdb1.
>>>
>>>  
>>>      
>>     Take all that stuff you added to /etc/fstab out of the file. Let
>> Ubuntu load it automatic and mine comes up fast as /media/disk. If you
>> do not have an ext3 file system on the portable hard drive do it now.
>>
>>    
> The USB drive is already formatted ext3 and has backups on it (hence
> its name!).
>
> I've taken the line above out of /etc/fstab, when I reboot the system
> I see the following in dmesg:-
>
>     [   20.424000] usb-storage: device scan complete
>     [   20.424000] scsi 2:0:0:0: Direct-Access     SAMSUNG  HD501LJ PQ: 0 ANSI: 2 CCS
>     [   20.424000] sd 2:0:0:0: [sdb] 976773168 512-byte hardware sectors (500108 MB)
>     [   20.424000] sd 2:0:0:0: [sdb] Write Protect is off
>     [   20.424000] sd 2:0:0:0: [sdb] Mode Sense: 00 38 00 00
>     [   20.424000] sd 2:0:0:0: [sdb] Assuming drive cache: write through
>     [   20.428000] sd 2:0:0:0: [sdb] 976773168 512-byte hardware sectors (500108 MB)
>     [   20.428000] sd 2:0:0:0: [sdb] Write Protect is off
>     [   20.428000] sd 2:0:0:0: [sdb] Mode Sense: 00 38 00 00
>     [   20.428000] sd 2:0:0:0: [sdb] Assuming drive cache: write through
>     [   20.428000]  sdb:<7>eth0: no IPv6 routers present
>     [   24.696000] Installing knfsd (copyright (C) 1996 [hidden email]).
>     [   24.820000] NFSD: Using /var/lib/nfs/v4recovery as the NFSv4 state recovery directory
>     [   24.832000] NFSD: starting 90-second grace period
>     [   27.856000]  sdb1
>     [   27.856000] sd 2:0:0:0: [sdb] Attached SCSI disk
>     [   27.856000] sd 2:0:0:0: Attached scsi generic sg1 type 0
>
> .... and then nothing.  The disk doesn't get mounted, at least I can't
> see it anywhere and 'mount' doesn't report anything.
>
>
> I'm not convinced that things will get automounted (by default) in
> Ubuntu Server, remember there isn't any GUI running.
>
>  
    Well the Desktop isn't what controls the USB system. But it sure
looks like your USB system is not working.

Karl


--

        Karl F. Larsen, AKA K5DI
        Linux User
        #450462   http://counter.li.org.
   PGP 4208 4D6E 595F 22B9 FF1C  ECB6 4A3C 2C54 FE23 53A7


--
ubuntu-users mailing list
[hidden email]
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Automounting a USB hard disk in Ubuntu server - how?

Mario Vukelic
On Tue, 2008-04-29 at 08:51 -0600, Karl Larsen wrote:
>     Well the Desktop isn't what controls the USB system.

You are mistaken abut the far-reaching differences between the Server
and the Desktop version.

> But it sure
> looks like your USB system is not working.

Probably not. See my other reply.


--
ubuntu-users mailing list
[hidden email]
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Automounting a USB hard disk in Ubuntu server - how?

Chris Green
In reply to this post by Mario Vukelic
On Tue, Apr 29, 2008 at 03:50:25PM +0200, Mario Vukelic wrote:

> On Tue, 2008-04-29 at 14:36 +0100, Chris G wrote:
> >
> > I'm not convinced that things will get automounted (by default) in
> > Ubuntu Server, remember there isn't any GUI running.
>
> Google is your friend :) I searched for "mount an external usb disk in
> ubuntu server" (without the quotes):
>
>
> <http://www.google.com/search?q=mount+an+external+usb+disk+in+ubuntu
> +server>
>
> First hit: <http://ubuntuforums.org/showthread.php?t=245566>
>
> It seems you need to load module usb-storage. Do so with "sudo modprobe
> usb-storage", then plug in the drive and see whether it works. If so,
> you can enter "usb-storage" into /etc/modules to make it load on boot.
>
No, I already have usb-storage, it reports a little higher up dmesg, I
should have included more:-

    [   15.296000] Initializing USB Mass Storage driver...
    [   15.300000] scsi2 : SCSI emulation for USB Mass Storage devices
    [   15.328000] usb-storage: device found at 2
    [   15.328000] usb-storage: waiting for device to settle before scanning
    [   15.328000] usbcore: registered new interface driver usb-storage
    [   15.328000] USB Mass Storage support registered.

    [   20.328000] usb-storage: device scan complete
    [   20.328000] scsi 2:0:0:0: Direct-Access     SAMSUNG  HD501LJ               PQ: 0 ANSI: 2 CCS
    [   20.328000] sd 2:0:0:0: [sdb] 976773168 512-byte hardware sectors (500108 MB)
    [   20.328000] sd 2:0:0:0: [sdb] Write Protect is off
    [   20.328000] sd 2:0:0:0: [sdb] Mode Sense: 00 38 00 00
    [   20.328000] sd 2:0:0:0: [sdb] Assuming drive cache: write through
    [   20.332000] sd 2:0:0:0: [sdb] 976773168 512-byte hardware sectors (500108 MB)
    [   20.332000] sd 2:0:0:0: [sdb] Write Protect is off
    [   20.332000] sd 2:0:0:0: [sdb] Mode Sense: 00 38 00 00
    [   20.332000] sd 2:0:0:0: [sdb] Assuming drive cache: write through
    [   20.332000]  sdb:<7>eth0: no IPv6 routers present
    [   24.620000] Installing knfsd (copyright (C) 1996 [hidden email]).
    [   24.776000] NFSD: Using /var/lib/nfs/v4recovery as the NFSv4 state recovery directory
    [   24.780000] NFSD: starting 90-second grace period
    [   27.832000]  sdb1
    [   27.832000] sd 2:0:0:0: [sdb] Attached SCSI disk
    [   27.832000] sd 2:0:0:0: Attached scsi generic sg1 type 0

I don't think usb-storage has anything to do with *mounting* the disk
drive, it's just a driver that recognises the disk.

What I need is something to automount the drive after all the above
has happened.

--
Chris Green

--
ubuntu-users mailing list
[hidden email]
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Automounting a USB hard disk in Ubuntu server - how?

Mario Vukelic
On Tue, 2008-04-29 at 17:43 +0100, Chris G wrote:
> No, I already have usb-storage, it reports a little higher up dmesg,

I see

> I don't think usb-storage has anything to do with *mounting* the disk
> drive, it's just a driver that recognises the disk.
>
> What I need is something to automount the drive after all the above
> has happened.

I was mislead by the guy on the linked page finished with, "That was my
problem. usb-storage isn't loading at boot. A quick modprobe loaded it
and my usb drive appeared."

Well, sorry then, I don't have experience with the server and Google
just gives me the same question over and over, but no answers.

Hmmm, probably with an udev rule, there is even an example for USB
harddisk:  http://reactivated.net/writing_udev_rules.html


--
ubuntu-users mailing list
[hidden email]
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Automounting a USB hard disk in Ubuntu server - how?

Peter Garrett
In reply to this post by Chris Green
On Tue, 29 Apr 2008 17:43:22 +0100
Chris G <[hidden email]> wrote:

> What I need is something to automount the drive after all the above
> has happened.

Have a look at the "usbmount" package. ( apt-cache show usbmount)

It creates entries for usb in /media , and automounts devices there
( by default /media/usb0 for the first device, then  /media/usb1,2 etc )

If you need to mount FAT file systems, you can configure that in
/etc/usbmount/usbmount.conf

The file is well commented, the addition is a copy-paste, and you only
need this edit if you are not using ext2, ext3 for your usb drive(s)

--
Peter Garrett <[hidden email]>

--
ubuntu-users mailing list
[hidden email]
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Automounting a USB hard disk in Ubuntu server - how?

Mario Vukelic
On Wed, 2008-04-30 at 03:21 +1000, Peter Garrett wrote:
>
> Have a look at the "usbmount" package.

D'oh! Thanks :)


--
ubuntu-users mailing list
[hidden email]
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Automounting a USB hard disk in Ubuntu server - how?

Derek Broughton-2
In reply to this post by Chris Green
Chris G wrote:

> I don't think usb-storage has anything to do with *mounting* the disk
> drive, it's just a driver that recognises the disk.

No, Hal & udev should manage the mounting.  Also somewhere in there is a
program called pmount.

--
derek


--
ubuntu-users mailing list
[hidden email]
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Automounting a USB hard disk in Ubuntu server - how?

Chris Green
In reply to this post by Peter Garrett
On Wed, Apr 30, 2008 at 03:21:22AM +1000, Peter Garrett wrote:

> On Tue, 29 Apr 2008 17:43:22 +0100
> Chris G <[hidden email]> wrote:
>
> > What I need is something to automount the drive after all the above
> > has happened.
>
> Have a look at the "usbmount" package. ( apt-cache show usbmount)
>
> It creates entries for usb in /media , and automounts devices there
> ( by default /media/usb0 for the first device, then  /media/usb1,2 etc )
>
> If you need to mount FAT file systems, you can configure that in
> /etc/usbmount/usbmount.conf
>
> The file is well commented, the addition is a copy-paste, and you only
> need this edit if you are not using ext2, ext3 for your usb drive(s)
>
Brilliant, that's what I needed, thank you.

All I did was "sudo apt-get usbmount" and it all works perfectly
without any changes at all (my external USB drive is ext3 formatted).
After a reboot /dev/sdb1 is mounted as it should be which it wasn't
before usbmount was installed.

--
Chris Green

--
ubuntu-users mailing list
[hidden email]
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

RE: Automounting a USB hard disk in Ubuntu server - how?

Macval
In reply to this post by Chris Green
Re: Automounting a USB hard disk in Ubuntu server - how?
De:  Chris G
Enviado el: mar 29/04/2008 18:43
Para: [hidden email]
Asunto: Re: Automounting a USB hard disk in Ubuntu server - how?


>I don't think usb-storage has anything to do with *mounting* the disk
drive, it's just a driver that recognises the disk.

>What I need is something to automount the drive after all the above
has happened.

See:

https://help.ubuntu.com/community/Mount/USB

Includes interesting links (you can improve it with the results of your experience).

Regards.

 


--
ubuntu-users mailing list
[hidden email]
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Automounting a USB hard disk in Ubuntu server - how?

Chris Green
On Wed, Apr 30, 2008 at 11:21:00AM +0200, PEDRO MACANAS VALVERDE wrote:

> De:  Chris G
> Enviado el: mar 29/04/2008 18:43
> Para: [hidden email]
> Asunto: Re: Automounting a USB hard disk in Ubuntu server - how?
>
>
> >I don't think usb-storage has anything to do with *mounting* the disk
> drive, it's just a driver that recognises the disk.
>
> >What I need is something to automount the drive after all the above
> has happened.
>
> See:
>
> https://help.ubuntu.com/community/Mount/USB
>
That doesn't address the problem, it tells you how to get the USB
drive recognised and then how to manually "mount" and "umount" it but
nothing at all about automatically mounting it at system startup
time.

The bit at the end about automounting is (again) about a system with a
GUI.


> Includes interesting links (you can improve it with the results of your experience).
>
Not really I can't as I don't have the difficulties that page is
talking about.

The solution for me was (as noted above in this thread) to install
usbmount.

--
Chris Green

--
ubuntu-users mailing list
[hidden email]
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
Loading...