6

I bought a Raspberry PI with the intention of using it to play movies stored on my NAS, as well as browsing the web, so I will be using Raspbian

My NAS is a Western Digital MyBookLive on my home network.

It's configured to use DHCP, and does not have a username/password set up.

I've seen examples of how to connect to a NAS, such as what is outlined here: http://www.stuffaboutcode.com/2012/05/raspberry-pi-connect-nas-windows-share.html?m=1

However, I'm a little confused about a few things that I would like clarified.

First,

As per the example on that page there is a username & password specified:

Edit fstab file I needed to edit the fstab file to mount the NAS drive at startup:

sudo nano /etc/fstab

I added the following line to the bottom of the file:

//myNAS/myShare /home/pi/myNAS/myShare cifs username=your_username,password=your_password,workgroup=your_workgroup,users,auto,user_xattr 0 0

As I stated, my NAS doesn't have a username & password configured. What should I do in this case?

Second,

One of the comments on the page states:

My NAS is on 192.168.1.101, so the line added on /etc/fstab is: //192.168.1.101/PUBLIC/backup_raspberry /mnt/NAS username=USERNAME,password=PASSWORD,workgroup=WORKGROUP,users,auto,user_xattr 0 0

Does this imply that I should be using the IP address of the NAS rather than the name of the device? Is it possible to do this when the NAS's IP address is assigned dynamically, as with DHCP?

Third

While that article outlines how to mount the NAS at Start-up, I would also like to know if it's possible to add a link of sorts to the NAS to the Raspbian desktop? If so, how? This is a partial requirement because my non-technical wife will be using the device to play movies.

7

Question 1:

my NAS doesn't have a username & password configured. What should I do in this case?

Mount the NAS as a guest share, as follows:

sudo mount -t cifs -o guest //192.168.1.15/Public /home/pi/Desktop/myNas

While this works, it doesn't automatically mount the NAS at start up. To do that, I needed to modify the file /etc/fstab, adding a line to the bottom:

//192.168.1.15/Public /home/pi/Desktop/myNas cifs guest 0 0

Question 2:

should I be using the IP address of the NAS rather than the name of the device?

In this case I needed to use the IP address because I don't have a DNS or any way (that I know of) of mapping the device name to the IP address.

In order to do this, I navigated my web browser to the configuration page of the NAS and configured it to have a static IP address.

Question 3:

is it possible to add a link to the NAS to the Raspbian desktop?

Yes. Simply creating the folder myNas on the desktop, and then configuring /etc/fstab to mount the NAS at startup as outlined in Question 2, e.g.

//192.168.1.15/Public /home/pi/Desktop/myNas cifs guest 0 0

means that clicking the folder on the desktop opens to the NAS share.

  • this worked for my password protected NAS but changed the command to -o username=myawesomuser and then entered password when prompted. – Nick Feb 18 '14 at 19:33
  • could you change it to -o username=myawesomuser,password=mypassword if you didn't want to be prompted for it? (Assuming security wasn't an issue) – DaveDev Feb 19 '14 at 7:49
  • Cheers DaveDev, worked a treat with my old WHS and OSMC on my Pi :) Much appreciated. – Zhaph - Ben Duguid Feb 10 '15 at 9:14
0

Running ubuntu 13.10 and a QNAP I needed to install nfs-common first,

sudo apt-get install nfs-common

Then edited my fstab,

10.1.1.9:/Public /mnt/Public nfs rw,hard,intr 0 0

nfs-common has a useful tool called showmount for exploring your available mount points,

showmount -e 10.1.1.9

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.