I 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 but you should be able to modify this procedure for your own setup. The principles are teh same.
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 ROM folders from RetroPie to Synology
Assuming that you have already have a ROM folder on your pi or something similar like: /home/pi/RetroPie/roms/
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/ admin@192.168.0.110:/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 or superuser, edit your /etc/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) Now run this command to check the available disk space to see if the NFS share is mounted:
df -h
You should have something like the following. One giveaway that it works and that the NFS share is mounted is by noting the huge amount of available space. 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 share 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. Enjoy!
2 thoughts on “RetroPie: Using NFS Shares for ROMS”