Auto mount drives

Colin Law clanlaw at googlemail.com
Sun May 31 09:45:54 UTC 2009


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 <jensen.somers at gmail.com>:
> Hi,
>
> On Sun, May 31, 2009 at 10:56, Chris Jeffries <chris at candm.org.uk> 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
> ubuntu-users at lists.ubuntu.com
> Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
>




More information about the ubuntu-users mailing list