Recently picked up a Raspberry Pi 3 as an upgrade to my old Model B and decided to install RetroPie as well as Kodi to handle the media server side of things. After the initial RetroPie installation, I started saving my various video game roms to the default /home/pi/RetroPie/roms folder but soon felt that this wasn’t a great idea in terms of redundancy. Ideally I wanted a more persistent solution in case the Pi blew up or the micro SD card became corrupt for whatever reason. And so, I found that the best solution is to keep your roms in a safe location, preferably somewhere on your network, and map your PI to that location using an NFS (Network File System) share. And so, another how-to is born:
How to mount NFS shares on RetroPie
Note 1: I’m using a Synology NAS to broadcast my shared folders.
Note 2: For the purpose of this exercise we’ll use the following IP parameters:
RetroPie = 192.168.1.100
Synology NAS = 192.168.1.110
Note 3: Make sure that you’ve configured your RetroPie with a static IP address.
1. Prepare a network share on your NAS.
a) In your Synology Control Panel, click on Shared Folder and create a shared folder called EMU (or to whatever name you want).
b) Now right-click your newly created shared folder named EMU and select ‘edit’.
c) Click NFS Permissions and click ‘Create’ to add a rule with your RetroPie IP address (192.168.1.100) and give it ‘read/write’ privilege. Check off ‘Enable Asynchronous‘ and click ‘OK’.
2. Copy roms folders from RetroPie to Synology
We want to maintain the same directory structure on the network location as on the RetroPie.
a) From your RetroPie’s command line type the following to copy the rom directory structure over to your newly created shared folder.
sudo scp -pr /home/pi/RetroPie/roms/ email@example.com:/volume1/EMU/
b) On Synology, go into File Station and confirm that all of the roms folders are there.
3. Mount the Network Share
a) As root, edit your fstab and add the following line:
192.168.0.110:/volume1/EMU/roms /home/pi/RetroPie/roms nfs rw,nolock 0 0
b) Save your changes, exit the file and mount the filesystem:
sudo mount -a
c) Run the following to see if the NFS share is mounted:
You should something like the following. One giveaway that it works is noted by the huge amount of available space that we now see. Since we are now mapped to the filesystem on the NAS, we see 1.9T available. Awesome:
Filesystem Size Used Avail Use% Mounted on
192.168.0.110:/volume1/EMU/roms 2.7T 854G 1.9T 32% /home/pi/RetroPie/roms
Once this is done, you can test it by dropping some roms into the EMU/roms folder directly on the NAS and restart Emulation Station. If everything is working as planned, you should now see your recently added roms in RetroPie which are also now safely stored on your NAS.