LampshadeTricky
Posts: 6
Joined: Sat Apr 13, 2013 12:16 am

Remote Mounting from Pi to Pi

Sat Apr 13, 2013 12:24 am

I'm new to Linux and trying to set up a series of Raspberry Pis to work as a media center.

1) NAS: one pi connected to several USB HDs
2) Sickbeard/SABnzbd: because this combination of software takes up lots of processing power, I thought I would have them on their own Pi.
3) RaspBMC: I wanted to have one connected to each TV in order to stream from the NAS.

I'm using the raspbian wheezy OS for 1 & 2 and will use the RaspBMC OS for 3).

I've got the NAS setup and can connect to remote drives via Windows with out a problem but don't know how to mount the drive on Pi 2 so I can access the files on Pi 1. I will eventually need to be able to access 1 from 3 in order to stream to the TV.

I've tried mounting the drive:
sudo mount -t auto - o username=USERNAME,password=PASSWORD //SERVER /mnt/MOUNT_FOLDER

but I get the following error:
mount: special device //SERVER does not exist

I've been trying to get this working off and on for about a week and a half and have not really made any progress.

Can someone give me a hand?
-Lampshade

User avatar
bob_binz
Posts: 441
Joined: Thu Feb 02, 2012 7:58 pm
Location: Stockport, UK

Re: Remote Mounting from Pi to Pi

Sat Apr 13, 2013 12:12 pm

Try specifying cifs as the type, i.e.

Code: Select all

sudo mount -t cifs -o username=USERNAME,password=PASSWORD //SERVER /mnt/MOUNT_FOLDER

LampshadeTricky
Posts: 6
Joined: Sat Apr 13, 2013 12:16 am

Re: Remote Mounting from Pi to Pi

Sat Apr 13, 2013 1:52 pm

I was using auto because that is how it is mounted on Pi 1. I've remounted it as cifs and then tried again but get a different error:

Code: Select all

mount error(115): Operation now in progress
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)
-Lampshade

DirkS
Posts: 9838
Joined: Tue Jun 19, 2012 9:46 pm
Location: Essex, UK

Re: Remote Mounting from Pi to Pi

Sat Apr 13, 2013 5:33 pm

Can you mount a 'whole' server? I thought that would need to be a share-point on a server:

Code: Select all

sudo mount -t cifs -o username=USERNAME,password=PASSWORD //SERVER/share mnt/MOUNT_FOLDER
BTW: if the shares are browsable you should be able to navigate to them using 'ad source' in raspbmc. You don't necessarily have to mount shares manually, raspbmc will take care of that.

Gr.
Dirk

LampshadeTricky
Posts: 6
Joined: Sat Apr 13, 2013 12:16 am

Re: Remote Mounting from Pi to Pi

Sat Apr 13, 2013 6:17 pm

I've tried mounting the specific folder and still get the same error.

I may be able to browse to it via raspbmc but I'll still need to save files downloaded with SABnzbd to it. How can this be done?

Also, if I mount the drive as cifs, it no longer is viewable in Windows. I changed it back to auto and everything was fine.
-Lampshade

DirkS
Posts: 9838
Joined: Tue Jun 19, 2012 9:46 pm
Location: Essex, UK

Re: Remote Mounting from Pi to Pi

Sat Apr 13, 2013 6:37 pm

Also, if I mount the drive as cifs, it no longer is viewable in Windows. I changed it back to auto and everything was fine.
I'm sorry but I completely fail to see how this can be the case. What construction are you using?
As I understand it you created a share on a NAS (pi with samba). You're trying to mount this share on another linux machine (raspbian or raspbmc). This should not affect the visibility of that same share under another (windows or whatever) machine... I certainly don't have problems like that on my network.

*are* you actually using Samba on your Nas-Pi?

Gr.
Dirk.

LampshadeTricky
Posts: 6
Joined: Sat Apr 13, 2013 12:16 am

Re: Remote Mounting from Pi to Pi

Sat Apr 13, 2013 7:33 pm

Sorry, maybe I'm just not communicating clearly. I'm still new to Linux and still trying to understand the steps I've been following on sites and forums. I'm working with the latest Raspbian build.

Ultimately, I'd like to make sure that the NAS-Pi is readable from both Windows and other Pis. I would like to have the second Pi using SABnzbd to be able to save files to the NAS-Pi so that other RasBMC machines can stream video to the TVs. The hard drives I have are already windows formatted with data.

Yes, I have samba on my NAS-Pi and it was fully accessible from my windows machines. I've been playing around and I think I may have changed some settings and now it doesn't work. I mounted as cifs earlier to test your command and then changed it back to auto in the fstab, when I saw that it wasn't working. I was using auto because I'm still not sure about the all the filesystems I can mount.

I can now see the folder and its contents from windows but cannot read or write.

My folder is set up in smb.conf file:
[code]
[sandisk32]
path = /mnt/sandisk32
browsable = yes
writeable = Yes
read only = No
only guest = Yes
create mask = 0755
directory mask = 0755
[/code]

This looks correct from what I have been reading so I'm not sure what else could be the problem.
-Lampshade

TheQuestor
Posts: 80
Joined: Wed Nov 28, 2012 9:15 am

Re: Remote Mounting from Pi to Pi

Sat Apr 13, 2013 8:02 pm

you DID install cifs-utils right?

sudo apt-get install cifs-utils samba

on the Linux box you want to share FROM add a similar line to your /etc/samba/smb.conf

[RPI]
comment = Raspi Share
read only = no
path = /
guest ok = yes
create mask = 0755
browseable = yes
directory mask = 0755

I have these in my /etc/fstab which auto mounts on reboot

#Windows share below
//stark/k /media/stark cifs username=myusername,password=mypassword 0 2
#Linux share below
//bailar/root/devel /media/bailar cifs username=myusername,password=mypassword 0 3

df
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/sda1 119725284 32086392 81557204 29% /
udev 1024700 4 1024696 1% /dev
tmpfs 412992 2108 410884 1% /run
none 5120 0 5120 0% /run/lock
none 1032476 232 1032244 1% /run/shm
none 102400 16 102384 1% /run/user
//stark/k 45259772 23613448 21646324 53% /media/stark
//bailar/root/devel 15251960 1806932 12806928 13% /media/bailar

LampshadeTricky
Posts: 6
Joined: Sat Apr 13, 2013 12:16 am

Re: Remote Mounting from Pi to Pi

Sun Apr 14, 2013 3:02 am

I have cifs-utils installed and the settings in the last post only let me copy stuff from the server but not to it.

Below is from my fstab:

Code: Select all

/dev/sda1               /mnt/sandisk32  auto    defaults                0       2
//hyrule/sandisk32      /mnt/sandisk32  auto    defaults                0       3
When I run "sudo mount -a" I get the following:

Code: Select all

mount: special device //hyrule/sandisk32 does not exist
This is from my smb.conf file:

Code: Select all

[sandisk32]
 path = /mnt/sandisk32
 browsable = yes
 writeable = yes
 read only = no
 guest ok = yes
 create mask = 0755
 directory mask = 0755
-Lampshade

TheQuestor
Posts: 80
Joined: Wed Nov 28, 2012 9:15 am

Re: Remote Mounting from Pi to Pi

Sun Apr 14, 2013 3:58 am

LampshadeTricky wrote:I have cifs-utils installed and the settings in the last post only let me copy stuff from the server but not to it.

Below is from my fstab:

Code: Select all

/dev/sda1               /mnt/sandisk32  auto    defaults                0       2
//hyrule/sandisk32      /mnt/sandisk32  auto    defaults                0       3
When I run "sudo mount -a" I get the following:

Code: Select all

mount: special device //hyrule/sandisk32 does not exist
This is from my smb.conf file:

Code: Select all

[sandisk32]
 path = /mnt/sandisk32
 browsable = yes
 writeable = yes
 read only = no
 guest ok = yes
 create mask = 0755
 directory mask = 0755
You need to set a username and password to read/write the share

mine in fstab is
//bailar/root/devel /media/bailar cifs username=myusername,password=mypassword 0 3
yours is
//hyrule/sandisk32 /mnt/sandisk32 auto defaults 0 3

1st off you're not using cifs and it's probably only mounting it readonly as per defaults

umount it

sudo chmod -R 777 /mnt/sandisk32

change your fstab to

//hyrule/sandisk32 /mnt/sandisk32 cifs username=myusername,password=mypassword 0 3

and use your user account name from the machine you're trying to connect TO as the username/password or if you're adventurous you can set it to root/rootpw

LampshadeTricky
Posts: 6
Joined: Sat Apr 13, 2013 12:16 am

Re: Remote Mounting from Pi to Pi

Sun Apr 14, 2013 5:21 am

When I use cifs, the folder doesn't even open. If I use nfs, I can copy from but not to it.

Code: Select all

/dev/sda1               /mnt/sandisk32  nfs     defaults                        0       3
-Lampshade

TheQuestor
Posts: 80
Joined: Wed Nov 28, 2012 9:15 am

Re: Remote Mounting from Pi to Pi

Sun Apr 14, 2013 5:58 am

LampshadeTricky wrote:When I use cifs, the folder doesn't even open. If I use nfs, I can copy from but not to it.

Code: Select all

/dev/sda1               /mnt/sandisk32  nfs     defaults                        0       3
ok let me get this straight.

you're trying to connect one RPI to another right?

both samba and cifs-utils need to be installed on both RPIs amd samba needs to be configured on the rpi you are trying to connect TO.

One problem is you're using "defaults" and not "username=myusername,password=mypassword" where myusername is the username on the RPI you are trying to connect to, as is the password.

I connect dozens of shares on dozens of mixed environments and as long as you set them up as I said already you should not have any issues.
with cifs you can NOT use "defaults" it will not connect.

one way to test is this

sudo mount -t cifs //yourserver/yourshare -o username=root,password=mypassword /mnt/share

[email protected] /mnt $ sudo mount -t cifs //jothee/root -o username=root,password=mypassword /mnt/share
[email protected] /mnt $ df
Filesystem 1K-blocks Used Available Use% Mounted on
rootfs 15251960 1806956 12806904 13% /
/dev/root 15251960 1806956 12806904 13% /
devtmpfs 183620 0 183620 0% /dev
tmpfs 38376 644 37732 2% /run
tmpfs 5120 0 5120 0% /run/lock
tmpfs 76740 88 76652 1% /run/shm
/dev/mmcblk0p1 57288 19080 38208 34% /boot
/dev/sda1 3952048 1268292 2483004 34% /devel
//jothee/root 119725284 32086404 81557192 29% /mnt/share
[email protected] /mnt $
[email protected] /mnt $ cd share/
[email protected] /mnt/share $ ls
bin dev hold initrd.img.old media proc run srv usr vmlinuz.old
boot devel home lib mnt root sbin sys var
cdrom etc initrd.img lost+found opt rpi-images selinux tmp vmlinuz
[email protected] /mnt/share $ cd devel
[email protected] /mnt/share/devel $ ls
BuildBot BuildBot - Copy mountpi mountpi2 unmountpi unmountpi2 www xbmc
[email protected] /mnt/share/devel $ mkdir temp
[email protected] /mnt/share/devel $ ls
BuildBot BuildBot - Copy mountpi mountpi2 temp unmountpi unmountpi2 www xbmc
[email protected] /mnt/share/devel $

so in your fstab on the rpi you are connecting FROM you need
//servername/share /mnt/share cifs username=myusername,password=mypassword 0 2
NO defaults you MUST specify username=,password=

and on the rpi you are connecting TO you need

[sandisk32]
path = /mnt/sandisk32
browsable = yes
writeable = yes
read only = no
guest ok = yes
create mask = 0755
directory mask = 0755

also make sure you restart samba on the rpi you are connecting to
sudo /etc/init.d/samba restart


on a side note you can use NFS but I have never had much luck with it. Especially on a mixed network.

User avatar
raspberrydt
Posts: 57
Joined: Mon Jan 21, 2013 3:09 pm

Re: Remote Mounting from Pi to Pi

Tue Apr 16, 2013 8:12 am

In general: if I want to have access some files from one computer to another, and both are running Linux, I would not use samba. ssh/scp is the choice if you need it once or seldom, no setup needed if you got ssh running already.
If I need it regulary I use sshfs, and if the network is secure and CPU load is an issue I use NFS.

Return to “Beginners”