Recently picked up a Raspberry Pi 3 as an upgrade to my old Model B and decided to install RetroPie as well as Kodi for 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. 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 that location using an NFS (Network File System) share. And so, another how-to is born:
How to mount NFS shares on RetroPie
Note: I’m using a Synology NAS to broadcast my shared folders.
Note 2: For the purpose of this exercise we’ll use the following parameters:
RetroPie = 192.168.1.100
Synology = 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 Control Panel/Shared Folder Create a shared folder called EMU (or whatever you want)
b) On Synology (Control Panel/Shared Folder/), right-click EMU and select ‘edit’.
c) Click NFS Permissions and add your RetroPie IP address (192.168.1.100) under ‘client’ and give it ‘read/write’ permissions.
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/ firstname.lastname@example.org:/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.