Mounting a "NAS" drive located on another RPi

Raspberry Pi related support

Mounting a "NAS" drive located on another RPi

Postby LeVolatile » 13 Sep 2015, 01:57

Hi Everyone,

I have 2 Raspberry Pi at home: One model 2 in my living room and one model B+ in my bedroom. Both are running Rune Audio 0.3 and are connected via Wi-fi. I had to dev update the B to be able to get Wi-fi working but everything works fine now!

Now I have issue with a unusual way to mount a NAS: Since I don't have a real NAS, I decided to share my external hard drive that is connected to the Pi 2 USB port. I want to mount this same drive also as a "NAS" for the Pi B+ too. I have tried different things like adding a "/" after the IP address and then the full path to the drive or the path relative to MPD server. Nothing works! I also tried a more "conventional" way by entering IP address alone in its field but adding the path before directory name in the Remote directory field. No luck.

I used to have succeeded in this setup about 9 months ago but I don't remember how. I don't even remember if I succeeded with Volumio or RuneAudio but I'm quite sure I succeed at least one time.

I spent a whole day trying without success. That's why I request help now from a knowledgeable user that can provide me with a step by step procedure that will work the first time if possible.

Thanks in advance.
Last edited by LeVolatile on 14 Sep 2015, 20:55, edited 1 time in total.
LeVolatile
 
Posts: 17
Joined: 16 Mar 2015, 18:50

Re: Mounting a "NAS" drice located on another RPi

Postby hondagx35 » 13 Sep 2015, 11:05

Hi LeVolatile,

for this to work you need a nfs-server running on your PI2.

- Get access to the console::
There are two ways to get access to the console:
    1.) plug in a monitor and a keyboard
    2.) use SSH from your PC
      If you are not familiar with SSH read this for Windows or this for Linux/MacOS
      The default login for RuneAudio is "root" with the password "rune" (without quotes).

Check the status:
Code: Select all
systemctl status nfs-server


If it is not running:
Code: Select all
systemctl enable nfs-server
systemctl restart nfs-server
systemctl status nfs-server


The next thing you need is the correct entry in /etc/exports
Code: Select all
nano /etc/exports


should look like this:
Code: Select all
# /etc/exports - exports(5) - directories exported to NFS clients
#
# Example for NFSv2 and NFSv3:
#  /srv/home        hostname1(rw,sync) hostname2(ro,sync)
# Example for NFSv4:
#  /srv/nfs4        hostname1(rw,sync,fsid=0)
#  /srv/nfs4/home   hostname1(rw,sync,nohide)
# Using Kerberos and integrity checking:
#  /srv/nfs4        *(rw,sync,sec=krb5i,fsid=0)
#  /srv/nfs4/home   *(rw,sync,sec=krb5i,nohide)
#
# Use `exportfs -arv` to reload.
/mnt/MPD/USB/ 192.168.0.0/24(rw,crossmnt)
Change the ip address to your needs.

Now re-export your changes:
Code: Select all
exportfs -arv


On your second PI you now should be able to mount the USB drive:
    - Source name = e.g. Music_on_PI2
    - Fileshare protocol = NFS
    - IP address = RP2-ip (e.g. 192.168.0.173)
    - Remote directory = mnt/MPD/USB
    - mount options = standard should be OK

Frank
User avatar
hondagx35
 
Posts: 3042
Joined: 11 Sep 2014, 22:06
Location: Germany

Re: Mounting a "NAS" drice located on another RPi

Postby LeVolatile » 16 Sep 2015, 20:17

hondagx35 wrote:Hi LeVolatile,

for this to work you need a nfs-server running on your PI2.

OK! I understand that if I have successfully mounted a drive this way in the past, it wasn't with RueAudio. 8-) But despite to be a little less user friendly I prefer it to Volumio. Both systems sound the same to my ears on my good over average but not top end gear. Both runs fast but Rune boot MUCH faster, display cover and I like colours better. Like everyone, I am in hurray to try 0.4 version!
Code: Select all
nano /etc/exports

should look like this:
Code: Select all
/mnt/MPD/USB/ 192.168.0.0/24(rw,crossmnt)

Change the ip address to your needs. Now re-export your changes:
exportfs -arv[/code]

And if I want to remount it read only I use
Code: Select all
/mnt/MPD/USB/ 192.168.0.0/24(ro,crossmnt)
and I re-export. Is it the right syntax?
On your second PI you now should be able to mount the USB drive:
    - Source name = e.g. Music_on_PI2
    - Fileshare protocol = NFS
    - IP address = RP2-ip (e.g. 192.168.0.173)
    - Remote directory = mnt/MPD/USB
    - mount options = standard should be OK

YES It's working now!

But I would like I need to click 4 time to reach my music directory that is not on the root of the drive. Mounting my music sub-directory doesn't work. Is there a bug fix or a workaround about this? I would like to reach it by one click (or 2 at most) from the Library page.

Thank you so much Frank for your fast and accurate answer. This is a point, shout and Bang! solution as I like. I coun't say the same about MCPs. 8-)

LeVolatile
LeVolatile
 
Posts: 17
Joined: 16 Mar 2015, 18:50

support RuneAudio Donate with PayPal


Return to Raspberry Pi

Who is online

Users browsing this forum: No registered users and 15 guests