Auto mount drives

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Auto mount drives

surruk51
Request - short version.
1) how to have extra mount commands run at machine start up
2) how to format a command to mount an SMB network volume (Remote OS:
Windows XP SP3) (is it possible by machine published machine name?
currently I am using IP address)
3) how to automatically trigger a mount only when needed (deferred
mount)
OS: Ubunto 8.04


Request - long version
(to hopefully answer question that the above might prompt)

I have been using Ubuntu as my main OS for about 6 months (8.04 Hardy)
and for all practical purposes this is my only contact with Unix/Linux.
I had been using Windows for much longer. I have been a systems analysts
and programmer in the past, so I am happy reading manuals, just need
someone to point me in the right direction.

I have a couple of disk mounts that I would like to happen on machine
start up, but I need some help in formatting the commands and knowing
where to put them.

One is an NTFS drive (the old Windows drive) (and should ALWAYS be
there). I am OK formatting the mount command for this one, just need to
know where to put it.

The other is a network connection to a Windows share on another PC and
may sometimes not be available. I have read the mount.cifs man page but
I am a bit confused about passing it parameters via mount. For example,
both have a user parameter, so how does mount know which is meant? In
this case, I think I need help formatting the mount command, not just
knowing where to put it.

Finally, is there a way of automatically triggering a mount whn an
attempt is made to access a file on the volume prior to it having been
mounted. (i.e. a deferred mount option)







--
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
|

Re: Auto mount drives

Jensen Somers
Hi,

On Sun, May 31, 2009 at 10:56, Chris Jeffries <[hidden email]> wrote:

> Request - short version.
> 1) how to have extra mount commands run at machine start up
> 2) how to format a command to mount an SMB network volume (Remote OS:
> Windows XP SP3) (is it possible by machine published machine name?
> currently I am using IP address)
> 3) how to automatically trigger a mount only when needed (deferred
> mount)
> OS: Ubunto 8.04
>
>
> Request - long version
> (to hopefully answer question that the above might prompt)
>
> I have been using Ubuntu as my main OS for about 6 months (8.04 Hardy)
> and for all practical purposes this is my only contact with Unix/Linux.
> I had been using Windows for much longer. I have been a systems analysts
> and programmer in the past, so I am happy reading manuals, just need
> someone to point me in the right direction.
>
> I have a couple of disk mounts that I would like to happen on machine
> start up, but I need some help in formatting the commands and knowing
> where to put them.
>
> One is an NTFS drive (the old Windows drive) (and should ALWAYS be
> there). I am OK formatting the mount command for this one, just need to
> know where to put it.
>
> The other is a network connection to a Windows share on another PC and
> may sometimes not be available. I have read the mount.cifs man page but
> I am a bit confused about passing it parameters via mount. For example,
> both have a user parameter, so how does mount know which is meant? In
> this case, I think I need help formatting the mount command, not just
> knowing where to put it.

All mounting related stuff goes into the /etc/fstab file. You can read
more, and find examples for NTFS and network drives, at
https://help.ubuntu.com/community/Fstab. Normally this doesn't really
change between Linux distributions and versions, so any other manual
will get you going too.

>
> Finally, is there a way of automatically triggering a mount whn an
> attempt is made to access a file on the volume prior to it having been
> mounted. (i.e. a deferred mount option)
>
>

- Jensen

--
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
|

Re: Auto mount drives

Colin Law-4
In /etc/fstab (you will need to use sudo gedit /etc/fstab or similar
to edit it, also make a backup first), in order to mount my ntfs
partition on the same machine, I have

UUID=DA103AC5103AA901 /media/windows ntfs-3g defaults,locale=en_US.UTF-8 0 0

You have to make a folder /media/windows first.  The uuid is the uuid
of the partition.  If the partition is labelled I think you can use
the label instead but you would have to look that up.

To mount a shared windows drive on another PC I have

//192.168.1.100/My\040Documents /media/mydocs cifs
rw,user=username,password=mypassword,uid=1000,gid=1000 0 0

You will only need the username and password if you need them to
access the share.  Again you must make the mount point folder
/media/mydocs first.
If the machine is not available on startup it does no harm.  In order
to mount it later I do sudo mount -a.

No guarantees this is the 'correct' or best way to do it but it works for me.

Colin

2009/5/31 Jensen Somers <[hidden email]>:

> Hi,
>
> On Sun, May 31, 2009 at 10:56, Chris Jeffries <[hidden email]> wrote:
>> Request - short version.
>> 1) how to have extra mount commands run at machine start up
>> 2) how to format a command to mount an SMB network volume (Remote OS:
>> Windows XP SP3) (is it possible by machine published machine name?
>> currently I am using IP address)
>> 3) how to automatically trigger a mount only when needed (deferred
>> mount)
>> OS: Ubunto 8.04
>>
>>
>> Request - long version
>> (to hopefully answer question that the above might prompt)
>>
>> I have been using Ubuntu as my main OS for about 6 months (8.04 Hardy)
>> and for all practical purposes this is my only contact with Unix/Linux.
>> I had been using Windows for much longer. I have been a systems analysts
>> and programmer in the past, so I am happy reading manuals, just need
>> someone to point me in the right direction.
>>
>> I have a couple of disk mounts that I would like to happen on machine
>> start up, but I need some help in formatting the commands and knowing
>> where to put them.
>>
>> One is an NTFS drive (the old Windows drive) (and should ALWAYS be
>> there). I am OK formatting the mount command for this one, just need to
>> know where to put it.
>>
>> The other is a network connection to a Windows share on another PC and
>> may sometimes not be available. I have read the mount.cifs man page but
>> I am a bit confused about passing it parameters via mount. For example,
>> both have a user parameter, so how does mount know which is meant? In
>> this case, I think I need help formatting the mount command, not just
>> knowing where to put it.
>
> All mounting related stuff goes into the /etc/fstab file. You can read
> more, and find examples for NTFS and network drives, at
> https://help.ubuntu.com/community/Fstab. Normally this doesn't really
> change between Linux distributions and versions, so any other manual
> will get you going too.
>
>>
>> Finally, is there a way of automatically triggering a mount whn an
>> attempt is made to access a file on the volume prior to it having been
>> mounted. (i.e. a deferred mount option)
>>
>>
>
> - Jensen
>
> --
> ubuntu-users mailing list
> [hidden email]
> Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
>

--
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
|

Re: Auto mount drives

surruk51
In reply to this post by surruk51
       

>         Request - short version.
>         1) how to have extra mount commands run at machine start up
>         2) how to format a command to mount an SMB network volume
>         (Remote OS:
>         Windows XP SP3) (is it possible by machine published machine
>         name?
>         currently I am using IP address)
>         3) how to automatically trigger a mount only when needed
>         (deferred
>         mount)
>         OS: Ubunto 8.04
>        
>        
Thanks guys - that worked fine for items 1 and 2. The SMB volume mount
point looked empty. So I ran 'mount -a' which confusingly said 'nothing
was mounted', but when I checked the mount point again, the volume ha
been loaded. I presume a timing issue of some sort. Not a significant
problem for me though.

Still interested to know if there is an answer to item 3 (deferred
mount).


--
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
|

Re: Auto mount drives

Derek Broughton
In reply to this post by surruk51
Chris Jeffries wrote:

> 2) how to format a command to mount an SMB network volume (Remote OS:
> Windows XP SP3) (is it possible by machine published machine name?
> currently I am using IP address)

Colin said:
 //192.168.1.100/My\040Documents /media/mydocs cifs \
 rw,user=username,password=mypassword,uid=1000,gid=1000 0 0

I suggest that rather than his options you use:
 rw,user,credentials=/home/chris/.cifs/somecreds

Create a ~/.cifs directory for credentials, and put username and password in
the "somecreds" file (see man:smbmount - if you don't have that man page,
you also need to install the smbfs package).

> 3) how to automatically trigger a mount only when needed (deferred
> mount)

Check out the autofs package (I keep meaning to configure this for
myself...)
--
derek



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