How to Map a NAS (Ethernet Network drive) from Raspibian


31 posts   Page 1 of 2   1, 2
by ScottBouch » Sun Oct 28, 2012 10:41 pm
This has probably been asked before, but my forum searches have been fruitless..

I have a Network Drive with all of my media, connected via Ethernet to my Router. I can access it fine from my W7 machine, and have been able to map it using XBMC on my Pi over Ethernet..

However, I want to be able to map it from my Raspibian Squeeze install (freshly downloaded just yesterday) on my Pi.

I want to be able to read stuff from and save to my NAS drive using my Pi using file manager in Raspibian.

How do you do it?

Cheers, Scott.
http://www.scottbouch.posterous.com - - - - - - - - - Personal Blog
http://www.flightgear.posterous.com - - - - - - - - - - Aircrew Equipment blog
http://www.youtube.com/user/sbscottmonkey - - - YouTube Channel
User avatar
Posts: 146
Joined: Wed Jun 06, 2012 12:32 pm
Location: Midlands, UK
by SN » Sun Oct 28, 2012 11:24 pm
Your NAS is probably showing up as a CIFS share to Windows
So something like this will shwo you how to resolve it
Steve N – binatone mk4->intellivision->zx81->spectrum->cbm64->cpc6128->520stfm->pc->raspi ?
User avatar
Posts: 1008
Joined: Mon Feb 13, 2012 8:06 pm
Location: Romiley, UK
by LetHopeItsSnowing » Mon Oct 29, 2012 6:26 am
Its pretty easy to do, you need to modify the /etc/fstab file to include your nas drive, see this blog post for instructions http://www.stuffaboutcode.com/2012/05/raspberry-pi-connect-nas-windows-share.html
"am I getting slower, or is stuff more complicated; either way I now have to write it down - stuffaboutcode.com"
User avatar
Posts: 211
Joined: Sat May 26, 2012 6:40 am
Location: UK
by ScottBouch » Mon Oct 29, 2012 11:10 am
Thank you both very much, I'll have a go tonight / tomorrow.

This forum has been very helpful of late!

Thanks again, Scott
http://www.scottbouch.posterous.com - - - - - - - - - Personal Blog
http://www.flightgear.posterous.com - - - - - - - - - - Aircrew Equipment blog
http://www.youtube.com/user/sbscottmonkey - - - YouTube Channel
User avatar
Posts: 146
Joined: Wed Jun 06, 2012 12:32 pm
Location: Midlands, UK
by ScottBouch » Sun Nov 04, 2012 1:00 pm
I've been having a go at this... using the StuffAboutCode website (http://www.stuffaboutcode.com/2012/05/raspberry-pi-connect-nas-windows-share.html)

I got up to adding the below to fatab:
Code: Select all
//myNAS/myShare /home/pi/myNAS/myShare cifs username=your_username,password=your_password,workgroup=your_workgroup,users,auto,user_xattr 0 0


How do I find out what my 'your_workgroup' is?

I just used 'pi' and 'raspberry' as 'your_username' and 'your_password' - is this right?

Shouldn't I be putting the NAS's IP address in somewhere?

I tried following the instructions anyway, and not surprisingly, got this failure:
Code: Select all
pi@raspberrypi ~/myNAS $ sudo mount -a
mount error(115): Operation now in progress
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)


I've had a look through 'man mount.cifs' but can't really figure it out...

Thanks again, Scott (Linux beginner)
http://www.scottbouch.posterous.com - - - - - - - - - Personal Blog
http://www.flightgear.posterous.com - - - - - - - - - - Aircrew Equipment blog
http://www.youtube.com/user/sbscottmonkey - - - YouTube Channel
User avatar
Posts: 146
Joined: Wed Jun 06, 2012 12:32 pm
Location: Midlands, UK
by ScottBouch » Sun Nov 04, 2012 1:11 pm
I've also read this slightly different guide: http://www.cyberciti.biz/faq/linux-moun ... ows-share/

...and changed my username and password to shareuser and sharepassword... still not much luck.

Does the NAS's IP address relate to the workgroup?

Cheers, Scott
http://www.scottbouch.posterous.com - - - - - - - - - Personal Blog
http://www.flightgear.posterous.com - - - - - - - - - - Aircrew Equipment blog
http://www.youtube.com/user/sbscottmonkey - - - YouTube Channel
User avatar
Posts: 146
Joined: Wed Jun 06, 2012 12:32 pm
Location: Midlands, UK
by fbutler » Sun Nov 04, 2012 1:14 pm
ScottBouch wrote:I've been having a go at this... using the StuffAboutCode website (http://www.stuffaboutcode.com/2012/05/raspberry-pi-connect-nas-windows-share.html)

I got up to adding the below to fatab:
Code: Select all
//myNAS/myShare /home/pi/myNAS/myShare cifs username=your_username,password=your_password,workgroup=your_workgroup,users,auto,user_xattr 0 0


How do I find out what my 'your_workgroup' is?

The workgroup is the workgroup name from windows if you have one set up. Have a look under System within Control Panel in Windows.
ScottBouch wrote:I just used 'pi' and 'raspberry' as 'your_username' and 'your_password' - is this right?

No, it should be the administrator username and password of your NAS
ScottBouch wrote:Shouldn't I be putting the NAS's IP address in somewhere?

Replace "myNAS" at the start of your fstab entry with the IP address of your NAS. That worked for me.
User avatar
Posts: 299
Joined: Thu Mar 15, 2012 4:09 pm
Location: Surrey, England
by sjfaustino » Sun Nov 04, 2012 1:20 pm
If your NAS doesn't need a user and password to access the share, you can just add the line below to /etc/fstab
Code: Select all
//192.168.1.1/A /mnt/zondriveA cifs auto,password= 0  0

where you should replace 192.168.1.1 with the IP address of the NAS and "A" with the name of the share.
Also don't forget to create the mount point, in the case above, a directory on /mnt/zondriveA
Posts: 87
Joined: Tue Jun 12, 2012 5:21 pm
by ScottBouch » Sun Nov 04, 2012 1:52 pm
Also don't forget to create the mount point, in the case above, a directory on /mnt/zondriveA


OK, i've done everything but this.. how do I create the mount point? I've used "NAS" instead of "zonedriveA" in fstab.
http://www.scottbouch.posterous.com - - - - - - - - - Personal Blog
http://www.flightgear.posterous.com - - - - - - - - - - Aircrew Equipment blog
http://www.youtube.com/user/sbscottmonkey - - - YouTube Channel
User avatar
Posts: 146
Joined: Wed Jun 06, 2012 12:32 pm
Location: Midlands, UK
by fbutler » Sun Nov 04, 2012 1:56 pm
ScottBouch wrote:OK, i've done everything but this.. how do I create the mount point? I've used "NAS" instead of "zonedriveA" in fstab.

sudo mkdir /mnt/NAS
User avatar
Posts: 299
Joined: Thu Mar 15, 2012 4:09 pm
Location: Surrey, England
by ScottBouch » Sun Nov 04, 2012 2:14 pm
Thanks.. does it require a reboot to work?

Code: Select all
pi@raspberrypi ~ $ sudo mkdir /mnt/NAS
pi@raspberrypi ~ $ sudo mount -a
Couldn't chdir to mnt/NAS: No such file or directory


Cheers, Scott
http://www.scottbouch.posterous.com - - - - - - - - - Personal Blog
http://www.flightgear.posterous.com - - - - - - - - - - Aircrew Equipment blog
http://www.youtube.com/user/sbscottmonkey - - - YouTube Channel
User avatar
Posts: 146
Joined: Wed Jun 06, 2012 12:32 pm
Location: Midlands, UK
by ScottBouch » Sun Nov 04, 2012 2:19 pm
Hmm.... had some success... not quite sure what to do now though...

Code: Select all
[b]pi@raspberrypi ~ $ sudo mount -volume_1[/b]
Usage: mount -V                 : print version
       mount -h                 : print this help
       mount                    : list mounted filesystems
       mount -l                 : idem, including volume labels
So far the informational part. Next the mounting.
The command is `mount [-t fstype] something somewhere'.
Details found in /etc/fstab may be omitted.
       mount -a [-t|-O] ...     : mount all stuff from /etc/fstab
       mount device             : mount device at the known place
       mount directory          : mount known device here
       mount -t type dev dir    : ordinary mount command
Note that one does not really mount a device, one mounts
a filesystem (of the given type) found on the device.
One can also mount an already visible directory tree elsewhere:
       mount --bind olddir newdir
or move a subtree:
       mount --move olddir newdir
One can change the type of mount containing the directory dir:
       mount --make-shared dir
       mount --make-slave dir
       mount --make-private dir
       mount --make-unbindable dir
One can change the type of all the mounts in a mount subtree
containing the directory dir:
       mount --make-rshared dir
       mount --make-rslave dir
       mount --make-rprivate dir
       mount --make-runbindable dir
A device can be given by name, say /dev/hda1 or /dev/cdrom,
or by label, using  -L label  or by uuid, using  -U uuid .
Other options: [-nfFrsvw] [-o options] [-p passwdfd].
For many more details, say  man 8 mount .
[b]pi@raspberrypi ~ $ cd volume_1[/b]
bash: cd: volume_1: No such file or directory
[b]pi@raspberrypi ~ $ sudo cd volume_1[/b]
sudo: cd: command not found


Volume_1 is the name of my shared NAS directory
http://www.scottbouch.posterous.com - - - - - - - - - Personal Blog
http://www.flightgear.posterous.com - - - - - - - - - - Aircrew Equipment blog
http://www.youtube.com/user/sbscottmonkey - - - YouTube Channel
User avatar
Posts: 146
Joined: Wed Jun 06, 2012 12:32 pm
Location: Midlands, UK
by fbutler » Sun Nov 04, 2012 2:48 pm
ScottBouch wrote:Thanks.. does it require a reboot to work?

Code: Select all
pi@raspberrypi ~ $ sudo mkdir /mnt/NAS
pi@raspberrypi ~ $ sudo mount -a
Couldn't chdir to mnt/NAS: No such file or directory


Cheers, Scott

It's trying chdir to mnt/NAS rather than /mnt/NAS. Check your /etc/fstab entry.
User avatar
Posts: 299
Joined: Thu Mar 15, 2012 4:09 pm
Location: Surrey, England
by ScottBouch » Sun Nov 04, 2012 4:30 pm
I'd made some typos in fstab, which I now believe to be corrected...

Code: Select all
//192.168.1.75/Volume_1 /mnt/NAS cifs auto.password= 0 0


I don't know what to put in when prompted for as a password, but tried 0 (zero) as this appears in the fstab code after the auto.password=....

Code: Select all
pi@raspberrypi ~ $ sudo mount -a
Password: [i][u]# I typed a "0" here #[/u][/i]
pi@raspberrypi ~ $ mount
/dev/root on / type ext4 (rw,noatime,user_xattr,barrier=1,data=ordered)
devtmpfs on /dev type devtmpfs (rw,relatime,size=94488k,nr_inodes=23622,mode=755)
tmpfs on /run type tmpfs (rw,nosuid,noexec,relatime,size=18912k,mode=755)
tmpfs on /run/lock type tmpfs (rw,nosuid,nodev,noexec,relatime,size=5120k)
proc on /proc type proc (rw,nosuid,nodev,noexec,relatime)
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)
tmpfs on /run/shm type tmpfs (rw,nosuid,nodev,noexec,relatime,size=37820k)
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620)
/dev/mmcblk0p1 on /boot type vfat (rw,relatime,fmask=0022,dmask=0022,codepage=cp437,iocharset=ascii,shortname=mixed,errors=remount-ro)
//192.168.1.75/Volume_1 on /mnt/NAS type cifs (rw,relatime,sec=ntlm,unc=\\192.168.1.75\Volume_1,username=root,uid=0,noforceuid,gid=0,noforcegid,addr=192.168.1.75,unix,posixpaths,serverino,acl,rsize=1048576,wsize=65536,actimeo=1)
pi@raspberrypi ~ $ cd volume_1
bash: cd: volume_1: No such file or directory


I think I'm a bit closer...but not quite there just yet...

Thanks again, Scott
http://www.scottbouch.posterous.com - - - - - - - - - Personal Blog
http://www.flightgear.posterous.com - - - - - - - - - - Aircrew Equipment blog
http://www.youtube.com/user/sbscottmonkey - - - YouTube Channel
User avatar
Posts: 146
Joined: Wed Jun 06, 2012 12:32 pm
Location: Midlands, UK
by fbutler » Sun Nov 04, 2012 4:37 pm
ScottBouch wrote:I'd made some typos in fstab, which I now believe to be corrected...

Code: Select all
pi@raspberrypi ~ $ cd volume_1
bash: cd: volume_1: No such file or directory

I think I'm a bit closer...but not quite there just yet...

Thanks again, Scott

It looks like you typed cd volume_1 rather than cd Volume_1. If you type ls /mnt/NAS you should see the Volume_1 share in there.
User avatar
Posts: 299
Joined: Thu Mar 15, 2012 4:09 pm
Location: Surrey, England
by ScottBouch » Sun Nov 04, 2012 5:04 pm
fbutler wrote:It looks like you typed cd volume_1 rather than cd Volume_1. If you type ls /mnt/NAS you should see the Volume_1 share in there.


OOHH HHHAHAAAAA!!! nice one!!!!! :D :D :D

Code: Select all
pi@raspberrypi ~ $ ls /mnt/NAS
Ajaxpf  Home admin  Media  Our Media  Software  To be SORTED  transfer


I can see the folders in the root directory (they appear in green highlights), But, I don't know how to navigate around and transfer files etc.. see my attempt below:

Code: Select all
pi@raspberrypi ~ $ cd /mnt/NAS
pi@raspberrypi /mnt/NAS $ cd Volume_1
bash: cd: Volume_1: No such file or directory
pi@raspberrypi /mnt/NAS $ dir
Ajaxpf   Home\ admin  Media  Our\ Media   Software  To\ be\ SORTED  transfer
pi@raspberrypi /mnt/NAS $


Can I browse to these folders using the visual File Manager?

Thanks for your help so far!
http://www.scottbouch.posterous.com - - - - - - - - - Personal Blog
http://www.flightgear.posterous.com - - - - - - - - - - Aircrew Equipment blog
http://www.youtube.com/user/sbscottmonkey - - - YouTube Channel
User avatar
Posts: 146
Joined: Wed Jun 06, 2012 12:32 pm
Location: Midlands, UK
by ScottBouch » Sun Nov 04, 2012 5:26 pm
OOHHH OOOHH OOH!!! It works!!! :D

Browsing very happily!!! :lol:

Thank you fbutler!!!!
http://www.scottbouch.posterous.com - - - - - - - - - Personal Blog
http://www.flightgear.posterous.com - - - - - - - - - - Aircrew Equipment blog
http://www.youtube.com/user/sbscottmonkey - - - YouTube Channel
User avatar
Posts: 146
Joined: Wed Jun 06, 2012 12:32 pm
Location: Midlands, UK
by fbutler » Sun Nov 04, 2012 6:06 pm
ScottBouch wrote:OOHHH OOOHH OOH!!! It works!!! :D

Browsing very happily!!! :lol:

Thank you fbutler!!!!

No worries, I configured a new NAS to work with one of my Pis on Friday, so it was fresh in my mind.

I'm glad you got it working :)
User avatar
Posts: 299
Joined: Thu Mar 15, 2012 4:09 pm
Location: Surrey, England
by ScottBouch » Sun Nov 04, 2012 7:04 pm
fbutler wrote:I'm glad you got it working :)


No no, I'm glad YOU got it working!

Thanks again for patiently guiding a novice through...

Cheers, Scott
http://www.scottbouch.posterous.com - - - - - - - - - Personal Blog
http://www.flightgear.posterous.com - - - - - - - - - - Aircrew Equipment blog
http://www.youtube.com/user/sbscottmonkey - - - YouTube Channel
User avatar
Posts: 146
Joined: Wed Jun 06, 2012 12:32 pm
Location: Midlands, UK
by gondman » Sun Dec 30, 2012 10:25 am
Hi,

I also wants to mount my nas to my pi. It works, but not completly. I mounted it manually with ...
Code: Select all
mount -t cifs //192.168.1.50/share /mnt/share -o username=[my_username],password=[my_password]



I see the folders from the nas, but i couldn't browse into them. I get the message ...
Code: Select all
object is remote


Are there any ideas? :roll:
Posts: 8
Joined: Sun Dec 30, 2012 10:05 am
by gondman » Tue Jan 01, 2013 6:48 pm
Hi,

I have test mounting a nas with a Ubuntu 12.10 appliance. It works great. I see the folders from the nas and can browse into it.
If i mount the nas on my pi, i only see the folders but i can't browse into it. :?
Posts: 8
Joined: Sun Dec 30, 2012 10:05 am
by azeam » Tue Jan 01, 2013 7:20 pm
gondman wrote:Hi,

I have test mounting a nas with a Ubuntu 12.10 appliance. It works great. I see the folders from the nas and can browse into it.
If i mount the nas on my pi, i only see the folders but i can't browse into it. :?


Is the share by any chance a DFS share? If so, try to install the package keyutils if it isn't already.
Code: Select all
sudo apt-get install keyutils
User avatar
Posts: 192
Joined: Fri Oct 26, 2012 11:13 pm
by gondman » Tue Jan 01, 2013 10:05 pm
Is the share by any chance a DFS share? If so, try to install the package keyutils if it isn't already.
Code: Select all
sudo apt-get install keyutils

Hi azeam,
I have intall keyutils but the same result as before :?
Code: Select all
-bash: cd: Media: object is remote

"Media" is the folder on my nas. My NAS is a QNAP TS-219P. Is there any package which i had to install?
Posts: 8
Joined: Sun Dec 30, 2012 10:05 am
by azeam » Tue Jan 01, 2013 10:45 pm
gondman wrote:"Media" is the folder on my nas. My NAS is a QNAP TS-219P. Is there any package which i had to install?


See if you can connect to it using smbclient (instead of mount). Also make sure that the system is up to date
Code: Select all
sudo apt-get update && sudo apt-get upgrade


And check your logs for any error messages after trying to mount/connect.
User avatar
Posts: 192
Joined: Fri Oct 26, 2012 11:13 pm
by gondman » Tue Jan 01, 2013 11:13 pm
See if you can connect to it using smbclient (instead of mount). Also make sure that the system is up to date
Code: Select all
sudo apt-get update && sudo apt-get upgrade


And check your logs for any error messages after trying to mount/connect.


I can connect to the NAS with smbclient and see all the folders which i have seen with mount.
System is also up to date.
This is the error log from syslog when i try to browse into the mounted folders:

Code: Select all
Jan  1 23:52:29 raspberrypi kernel: [ 1979.729158] CIFS VFS: Autodisabling the use of server inode numbers on \\xxx.xxx.xxx.xxx\share. This server doesn't seem to support them properly. Hardlinks will not be recognized on this mount. Consider mounting with the "noserverino" option to silence this message.

Its very confused because the same action on an Ubuntu 12.10 machine works great :?
Posts: 8
Joined: Sun Dec 30, 2012 10:05 am