KayJayDK
Posts: 2
Joined: Mon Feb 09, 2015 9:26 pm

Cannot mount NAS

Mon Feb 09, 2015 9:45 pm

I have been running a Raspberry Pi B and a B+ for some months now. My network has 2 NAS units and both Pis have a similar setup and have booth been mounted with the same shares on both NAS'es.
However, some days ago the B+ had a corrupted SD card and I decided to download the latest Raspbian image (2015-01-31). The previous images I used date back around 6-7 months.

I set the image up the same way as before, setting a static IP address and then the fstab

Code: Select all

//192.168.1.26/MyLibrary/NAS1 /mnt/NAS1 cifs username=<username>,password=<pword>,rw,file_mode=0777,dir_mode=0777,uid=pi,gid=pi,forceuid,forcegid 0       0
//192.168.1.22/Volume_1/NAS2 /mnt/NAS2 cifs username=<username>,password=<pword>,rw,file_mode=0777,dir_mode=0777,uid=pi,gid=pi,forceuid,forcegid       0       0
I have previously created both mount directories and chmodded them to 777

The fstab is, as it was in the earlier setup, identical on both systems but for some reason I now get
mount error(13): Permission denied
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)
on one of the NAS'es. The other still works fine with both.

My first thought was that something had changed since the previous version, although I have updated them regularly but then why one NAS and not the other?

I hope someone can get me started to find a solution to this. Google gives a lot of hits on permission denied errors but none of the solutions have worked for me.

cpc464
Posts: 209
Joined: Tue Jul 08, 2014 5:10 pm
Contact: Website

Re: Cannot mount NAS

Mon Feb 09, 2015 10:38 pm

I don't think Raspbian comes with all the Samba bits by default. Maybe you are missing a package ?

Compare the outputs of

dpkg --get-selections | grep -i samba
dpkg --get-selections | grep -i cifs

on both Pis. I think you need samba-common, samba-common-bin and cifs-utils
Unix engineer since 1989

ripat
Posts: 191
Joined: Tue Jul 31, 2012 11:51 am
Location: Belgium

Re: Cannot mount NAS

Tue Feb 10, 2015 8:51 am

Another possibility is that the default authentication mechanism changed in the new kernel.

Try different sec option values in the fstab mount line.

sec=ntlmv2 or force the old default sec=ntlm
Using Linux command line usually boils down to these three things:
#1) Respect the privacy of others.
#2) Think before you type.
#3) With great power comes great responsibility.

messypotamia
Posts: 70
Joined: Tue Jan 27, 2015 12:12 am

Re: Cannot mount NAS

Tue Feb 10, 2015 12:23 pm

On this Pi:
Linux raspberrypi 3.12.35+ #730 PREEMPT Fri Dec 19 18:31:24 GMT 2014 armv6l GNU/Linux
mount -t cifs //router1/USB_Storage /mnt/bkup -o guest
works like a charm.
On this Pi:
Linux raspberrypi2 3.18.6+ #753 PREEMPT Sun Feb 8 14:47:22 GMT 2015 armv6l GNU/Linux
the same command fails for authentication.
I compared the samba and cifs, and both outputs were the same.
I tried the "sec=ntlm" option on Pi#2 and the command didn't like it.
I think the latest couple kernels has broken some stuff.
Hoping for someone smarter than me to figure out what the problem is.
Thanks -- mp.

User avatar
meltwater
Posts: 1014
Joined: Tue Oct 18, 2011 11:38 am

Re: Cannot mount NAS

Tue Feb 10, 2015 1:09 pm

I can confirm I have the same issue moving from NOOBS 1.3.11 to 1.3.12.

I've yet to check if `smbclient` and `cifs-utils` are installed in the latest Raspbian using:
dpkg -s <package>
- I will do when I have Pi access again.

Although I would expect a different error if this was the case, but will check in any case.

No issue with Raspbian in NOOBS 1.3.11 so it appears to be just the latest which has the problem.
Setup is the same since it is generated through Pi-Kitchen, just different NOOBS selected.
______________
http://www.themagpi.com/
A Magazine for Raspberry Pi Users
Read Online or Download for Free.

My new book: goo.gl/dmVtsc

Meltwater's Pi Hardware - pihardware.com

Like the MagPi? @TheMagP1 @TheMagPiTeam

messypotamia
Posts: 70
Joined: Tue Jan 27, 2015 12:12 am

Re: Cannot mount NAS

Tue Feb 10, 2015 2:04 pm

It's the kernel. On my new B+ which had the 2015 kernel and refused to mount -t cifs //server/share /mnt/bkup -o guest, I loaded an image on a new sd card (9/8/14 3.12.28+) and it works perfectly.
I hope the kernel team is paying attn to this, I'd appreciate being able to use the latest kernels and updates.

Best wishes.

User avatar
meltwater
Posts: 1014
Joined: Tue Oct 18, 2011 11:38 am

Re: Cannot mount NAS

Tue Feb 10, 2015 6:11 pm

Just got mine working...at least for now.

Command in the form of:
mount -t cifs -o guest,sec=ntlm //router1/USB_Storage /mnt/bkup

Although I used IP address for mine.

I'll see if it works on a clean install, but I didn't need to install any extra packages.
______________
http://www.themagpi.com/
A Magazine for Raspberry Pi Users
Read Online or Download for Free.

My new book: goo.gl/dmVtsc

Meltwater's Pi Hardware - pihardware.com

Like the MagPi? @TheMagP1 @TheMagPiTeam

messypotamia
Posts: 70
Joined: Tue Jan 27, 2015 12:12 am

Re: Cannot mount NAS

Tue Feb 10, 2015 9:00 pm

[quote="meltwater"]Just got mine working...at least for now.

Command in the form of:
mount -t cifs -o guest,sec=ntlm //router1/USB_Storage /mnt/bkup

<<snip>>
Meltwater, what is your exact kernel please? My aforementioned Pi, after an additional round of update/upgrade/rpi-update, is now
Linux raspberrypi-2 3.18.6+ #754 PREEMPT Sun Feb 8 20:22:45 GMT 2015 armv6l GNU/Linux
and it's broke for cifs again.
mp
EDIT: I put the commands in the order you did, and it is now working. Yahoo. I'm going to melt some ice with something in it and relax. Thanks!
mp

User avatar
meltwater
Posts: 1014
Joined: Tue Oct 18, 2011 11:38 am

Re: Cannot mount NAS

Tue Feb 10, 2015 11:23 pm

Glad it worked!
Now to find out why password hashing (apparently what that option does) would have an effect on guest mounts... ...another day.

EDIT: Ok not too hard to find!
http://ubuntuforums.org/showthread.php?t=2230952
______________
http://www.themagpi.com/
A Magazine for Raspberry Pi Users
Read Online or Download for Free.

My new book: goo.gl/dmVtsc

Meltwater's Pi Hardware - pihardware.com

Like the MagPi? @TheMagP1 @TheMagPiTeam

sp0d
Posts: 2
Joined: Wed Feb 11, 2015 4:38 pm

Re: Cannot mount NAS

Wed Feb 11, 2015 4:46 pm

I too am having issues mounting my shared drives after the kernel update. the difference is, I normally let fstab mount the drives for me. I am confused on where I should add the sec=ntlm on the drives line.

Right now the lines are like below:

Code: Select all

//192.168.1.101/public/Documents /root/nyNAS/myShare cifs username=user, password=password, 0 0
Can anyone tell me where I need to add the sec command to the line above?
My few efforts all lead to a "line X in /ect/fstab is bad" error.

Any help or comments would be greatly appreciated! :D

:EDIT: UPDATE!
I was able to mount the drive via fstab by using the following format:

Code: Select all

//192.168.1.101/public/Documents /root/nyNAS/myShare cifs username=user,password=password,sec=ntlm, 0 0
Note: Putting the sec option on one of the mounts caused the 2nd drive to mount as well. :?:

Hopefully this can help someone else in the same situation!

messypotamia
Posts: 70
Joined: Tue Jan 27, 2015 12:12 am

Re: Cannot mount NAS

Thu Feb 12, 2015 3:24 am

The thing that made a difference for me was the order in which I listed the "options" (o), i.e. they have to come before the resource & the mount point, to wit:
sudo mount -t cifs -o guest,sec=ntlm //192.168.2.1/USB_Storage /mnt/cifs
Before I was putting the option switches at the end and it failed *after* update to latest kernel. So try putting your credentials, and the rest of the options, before the resource specification.
/hth/
MP

KayJayDK
Posts: 2
Joined: Mon Feb 09, 2015 9:26 pm

Re: Cannot mount NAS

Sat Feb 21, 2015 8:43 pm

Since I wrote the original post, my B+ fried and I didn't get around to trying until I just got my Pi2. Setting up as per usual, I ran into the exact same problem and it turned out that adding ",sec=ntlm" at the end og my fstab (before the 0 0) did the trick. Thank you very much :D
Now to check how much of a speed improvement the Pi2 will give me.

Return to “Troubleshooting”