NOTE: For the sake of this tutuorial we are assuming that you log in to Ubuntu 8.10 (32bit or 64 bit) with the username doej...where you see the username doej you would substitue with your username.
Rule # 1 BACKUP BACKUP BACKUP Rule # 2 Refer to Rule # 1
What you need to know: The ip address of your NAS in my case and for this tutorial it is 192.168.0.40 yours may be different The names of your folders for sharing fir this tutorial there are two folders on my share I want to mount within my home folder of /home/doej: Documents Music
What you need to install: smbfs and if missing smbclient How to install?
Click System>Administration>Synaptic Package Manager under the Quick search type in smbfs and if not green check it under the Quick search type in smbclient and if not green check it clic apply then click apply again
Now onto the mounting of your NAS folders:
NOTE: Remember that the foldernames are CaSe sensitive so check that you use the proper case!
First step: create file in /root called .smbcredentials add: username=username to log into nas password=password to log into nas
Commands to do this: Click applications>accessories>Terminal sudo touch /root/.smbcredentials sudo nano .smbcredentials username=username to log into nas password=password to log into nas press ctrl-o to save the file press ctrl-x to exit [SIZE=2]now type in sudo chmod 600 /root/.smbcredentials[/SIZE]
Samba Configuration:
First thing we do is backup the original configuration file We start with creating a folder in your home directory called Backups to place the original files
Click Applications>Accessories>Terminal
type in:
sudo mkdir /home/doej/Backups
Next step is to create two mount points in your home folder so that you can browse Music and Downloads within your home folder to mount your shares so you can browse them in Places and on your desktop. In this example we will create two folders in /home/doej called MusicNAS and DownloadsNAS so that we know the files we see are from the NAS once again these foldernames are CaSe sensitive :
sudo mkdir /home/doej/MusicNAS sudo mkdir /home/doej/DocumentsNAS
then type in: sudo cp /etc/samba/smb.conf /home/doej/Backups/smb.conf
You have now made a backup of your smb file in /home/doej/Backups
sudo nano /etc/ samba smb.conf Under the heading #======================= Global Settings ======================= add line :
This allows older lanman autorization for the Dlink NAS-323
client lanman auth=yes
then press ctrl-o to save the file press ctrl-x to exit
To fix an unmounting issue with cifs(samba) when rebooting type: sudo ln -s /etc/init.d/umountnfs.sh /etc/rc0.d/K15umountnfs.sh sudo ln -s /etc/init.d/umountnfs.sh /etc/rc6.d/K15umountnfs.sh
Next step it to automount your shares so that they are there everytime you log in! This required editing your fstab file...our first step is to back it up before making any changes. FSTAB Configuration:
sudo cp /etc/fstab /home/doej/Backups/fstab You have now made a backup of your fstab file in /home/doej/Backups
Now to tell fstab to mount your shares
sudo nano /etc/fstab # /etc/fstab: static file system information. # # <file system> <mount point> <type> <options> <dump> <pass> proc /proc proc defaults 0 0 # /dev/sda1 UUID=ee64b879-124a-48a0-95ef-650fc9a1ceb7 / ext3 relatime,errors=remount-ro 0 1 # /dev/sda5 UUID=123792b0-ea3f-4d59-8f38-a036af9435ce none swap sw 0 0 /dev/scd0 /media/cdrom0 udf,iso9660 user,noauto,exec,utf8 0 0 //192.168.0.40/Downloads /home/doej/DownloadsNAS cifs credentials=/root/.smbcredentials,iocharset=utf8,file_mode=0777,dir_mode=0777 0 0 //192.168.0.40/Music /home/doej/MusicNAS cifs credentials=/root/.smbcredentials,iocharset=utf8,file_mode=0777,dir_mode=0777 0 0
The last two lines are the ones we add manually starting with the ipaddress of your nas then the folder you want to mount then the home folder you want to mount it to.
Once completed you then hit CRTL-O then CRTL-X to save and exit Last step: mount -a This will mount your shares.