How to Mount Windows Shares in Ubuntu
Mounting Windows shares permanently is relatively straightforward. This is how I did it:
- Create new mount point.
- Create new entry in /etc/fstab.
- Change the unmount order.
Create new mount point
martin@lagothrix:~$ sudo mkdir /srv/cifs/media
Create new entry in /etc/fstab
martin@lagothrix:~$ sudo nano /etc/fstab
Include the following line. Replace userid with the proper value:
//saimiri/media /srv/cifs/media smbfs credentials=/home/userid/.smbpasswd,uid=userid,gid=userid 0 0
Now create an password file in your home directory. Replace userid and password with the proper values:
martin@lagothrix:~$ martin@lagothrix:~$ echo username=userid > .smbpasswd martin@lagothrix:~$ echo password=password >> .smbpasswd martin@lagothrix:~$ chmod 600 .smbpasswd
Finally, mount the new filesystem:
martin@lagothrix:~$ sudo mount -a
Change the unmount order
This prevents CIFS (SMBFS) from hanging at shutdown.
martin@lagothrix:~$ sudo update-rc.d -f umountnfs.sh remove martin@lagothrix:~$ sudo update-rc.d umountnfs.sh stop 15 0 6 .
Advertisement
Leave a Comment