6

How to mount a samba share permanently in Ubuntu 10.10? Also, I don't want to display the share icon on my desktop. How to achieve this task?

4 Answers 4

4

If you ask about permanent mount, you should use configuraion via fstab.

Edit file //etc/fstab with root priviledges (for example sudo leafpad //etc/fstab)

and add a line which could look like this:

//<IPaddress>/<ShareName>   /<mountPoint>   cifs    user=<userName>,pass=<passwd> 0 0

You should use network drive username and password. Disadvantage is password written in a file. MountPoint should exist, (for example /mnt/NetworkDrive), create the folder before you reboot.

Save fstab and reboot. Done.

To ommit disadvantages, create .smbcredentials file

sudo leafpad /home/.smbcredentials

with following structure:

username=msusername
password=mspassword

and set

sudo chmod 600 /home/.smbcredentials

fstab line should be then as follows:

//<IPaddress>/<ShareName>   /<mountPoint>   cifs    rw,credentials=/home/.smbcredentials,iocharset=utf8,nounix, file_mode=0777,dir_mode=0777 0 0
3

Here is a very detailed set of instructions on how to do this permanently from an Ubuntu point of view.

https://help.ubuntu.com/community/MountWindowsSharesPermanently

1
  • 2
    I don't think the question involves windows.
    – OpenCoderX
    Jul 2, 2013 at 18:06
2

You should add it to /etc/fstab. I don't have a SMB server available at the moment but I think the fstab entry should look something like:

//server/share /mountpoint smbfs

man fstab and man mount are your friends here.

0

better choice than

mount -t smbfs //servername/sharename /mountdirectory -o username=mywindowsusername,password=mywindowspassword

sould be

sudo mount -t smbfs //servername/sharename /mountdirectory -o credentials=/root/.credMywindowsAccount

and in /root/.credMyWindowsAccount

username=mywindowsusername
password=mywindowspassword
1
  • 3
    it is not a permanent mount, after reboot mount is lost...
    – Dee
    May 13, 2014 at 11:43

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .