Superkris
Posts: 10
Joined: Mon Feb 15, 2016 8:48 pm

Problems mounting NAS to Jessie

Mon Feb 15, 2016 9:08 pm

I'm very sorry for this horrible noob question. I'm new to linux, raspberry, and programming.

I'm stuck trying to mount my NAS to my RPI2. I want to do this to share my media files with the Plex Server i installed on the Pi. I did a fresh Jessie install with NOOBS. I'm using the Pi headless but i can easely hook up a screen and keyboard.

If i understand right, i need to create a folder on my Pi to mount the NAS to. In can temporarily mount the nas with the mount command, but need to edit /etc/fstab to make it connect at boot.

The IP of my NAS is 192.168.11.29 and in Windows the path is \\MYBOOKLIVE\ (i do not see a IP in windows). The NAS is a WD Livebook 2. According the manual it supports CIFS/SMB, NFS, and AFP. I want to mount the folder /Public which does not seem to need a login.

I tried many guides but i'm not able to mount the drive with SSH terminal. If i try to find the drive in the file browser of GUI i can acces it without any problems, so the connection should be fine.

I tries so may guides i dont know there to start now. Can anyone please help?

rubikwizard
Posts: 95
Joined: Tue Jan 10, 2012 10:37 pm
Location: West Yorkshire
Contact: Website

Re: Problems mounting NAS to Jessie

Tue Feb 16, 2016 10:45 am

Try adding this to your fstab (make sure you press return at the end of the line), replacing /home/pi/yourfolder with the location of where you want to mount your NAS.

Code: Select all

//192.168.11.29 /home/pi/yourfolder cifs guest,uid=1000,gid=1000,iocharset=utf8 0 0
Then go to the Raspberry config program (sudo raspi-config) and select the option 'Wait for network at boot'.
This method works for me everytime, and I also have WD device similar to yours.

Superkris
Posts: 10
Joined: Mon Feb 15, 2016 8:48 pm

Re: Problems mounting NAS to Jessie

Tue Feb 16, 2016 9:50 pm

If i mount it manually i can acces it. When it prompts for a password, i just hit enter.

Code: Select all

pi@HouseBitch:~ $ sudo mount //192.168.11.29/Public /home/pi/NetworkShares/WDlive
Password for root@//192.168.11.29/Public:
pi@HouseBitch:~ $ ^C
pi@HouseBitch:~ $ cd NetworkShares/WDlive
pi@HouseBitch:~/NetworkShares/WDlive $ dir
algarve\ 2015  brugge                  ISO's\ en\ software  Shared\ Music     Shared\ Videos  Video
backup         Feestje\ en\ vakanties  Muziek               Shared\ Pictures  Software
When i edit fstab with what i found in guides, i looks like:

Code: Select all

proc            /proc           proc    defaults          0       0
/dev/mmcblk0p6  /boot           vfat    defaults          0       2
/dev/mmcblk0p7  /               ext4    defaults,noatime  0       1
# a swapfile is not a swap partition, no line here
#   use  dphys-swapfile swap[on|off]  for that
//192.168.11.29/Public /home/pi/NetworkShares/WDlive nfs default 0 0
If i understand right i can now test is the mount works with sudo mount -a

Code: Select all

pi@HouseBitch:~/NetworkShares/WDlive $ sudo cp /etc/fstab /etc/fstab.backup
pi@HouseBitch:~ $ sudo nano /etc/fstab
pi@HouseBitch:~ $ sudo mount -a
mount.nfs: remote share not in 'host:dir' format
I found online that i might had to add add ":" behind the IP of my nas. If i do that my fstab look like:

Code: Select all

proc            /proc           proc    defaults          0       0
/dev/mmcblk0p6  /boot           vfat    defaults          0       2
/dev/mmcblk0p7  /               ext4    defaults,noatime  0       1
# a swapfile is not a swap partition, no line here
#   use  dphys-swapfile swap[on|off]  for that
//192.168.11.29:/Public /home/pi/NetworkShares/WDlive nfs default 0 0
This results in:

Code: Select all

pi@HouseBitch:~ $ sudo mount -a
mount.nfs: Failed to resolve server //192.168.11.29: Name or service not known
When i try rubikwizard solution the fstab looks like this:

Code: Select all

proc            /proc           proc    defaults          0       0
/dev/mmcblk0p6  /boot           vfat    defaults          0       2
/dev/mmcblk0p7  /               ext4    defaults,noatime  0       1
# a swapfile is not a swap partition, no line here
#   use  dphys-swapfile swap[on|off]  for that
//192.168.11.29 /home/pi/NetworkShares/WDlive cifs guest,uid=1000,gid=1000,iocharset=utf8 0 0
When i try to mount, i get the following result:

Code: Select all

pi@HouseBitch:~ $ sudo mount -a
mount error(22): Invalid argument
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)
So that doesnt work neither. I'm sure the fault is in the fstab file, but i cant get it to work! Manualy mounting it all the time is not really a solution for me.

Does anyone have any other code that i can try?

JimmyN
Posts: 1109
Joined: Wed Mar 18, 2015 7:05 pm
Location: Virginia, USA

Re: Problems mounting NAS to Jessie

Tue Feb 16, 2016 10:50 pm

Do you want to use NFS or CIFS? It looks like you've been close, and tried both, but I think you're missing a little bit on each.

If you want to use CIFS try this line. @rubikwizard left out the "Public", I think that's why it failed, no source share name

Code: Select all

//192.168.11.29/Public /home/pi/NetworkShares/WDlive cifs guest,uid=1000,gid=1000 0 0
I don't use NFS, but this should work if you want to go that route. I think it failed because you had two leading "/" which I don't think are used with a NFS mount.

Code: Select all

192.168.11.29:/Public /home/pi/NetworkShares/WDlive nfs defaults 0 0
If it mounts with "mount -a", but fails to mount using fstab it's likely because the network is not up yet. Let systemd mount it when appropriate by adding an automount to the end like:

Code: Select all

//192.168.11.29/Public /home/pi/NetworkShares/WDlive cifs guest,uid=1000,gid=1000,x-systemd.automount 0 0

rubikwizard
Posts: 95
Joined: Tue Jan 10, 2012 10:37 pm
Location: West Yorkshire
Contact: Website

Re: Problems mounting NAS to Jessie

Tue Feb 16, 2016 11:07 pm

JimmyN wrote:@rubikwizard left out the "Public", I think that's why it failed, no source share name
Yes I forgot to put the name of the share as stated by JimmyN. It should work if you add that. Also you can wait for the network to be ready during boot by selecting the appropriate setting in raspi-config.

Superkris
Posts: 10
Joined: Mon Feb 15, 2016 8:48 pm

Re: Problems mounting NAS to Jessie

Wed Feb 17, 2016 8:21 am

Thanks, i will try this tonight!

What is the real diffrence between NFS and CIFS? I will mainly by my blackberry for Domoticz, Plex server, and print server. I need the NAS acces mostly for plex.

Return to “Raspbian”