The SituationSo I recently got my hands on a Raspberry Pi 2 Model B. And like any red-blooded American with a game controller, I felt compelled to install Emulation Station and RetroPie on it for some classic gaming awesomeness.
Since I only had an 8GB microSD card to donate to the effort, I soon ran into issues with space. My wife and I enjoy playing classic PS One games which range in size between 200MB to around 700MB. Multi-disc sets like Final Fantasy quickly make the storage requirements ridiculous.
The SolutionThe Raspberry Pi is just like any Debain based computer. That being said, NFS will work rather well. I have about 3TB of space to spare, so why not?!
Step 1: Create Folder on the computerBecause I'm lazy, I copied the “roms” directory tree to the future home of the roms file server.
Step 2: Empty the heavy use folders from the Pi
You can do this through the Samba share or through ssh. Your choice. I'm lazy, so I went the Doze share route.
Step 3: Acquire software on the computerAll I had to install was nfs-kernel-server from the apt repository
sudo apt-get install nfs-kernel-server
Step 4: Edit /etc/exportsYou have to do this as super user. Once again, since I'm lazy and don't want to mess around with vi...
sudo nano /etc/exports
Your /etc/exports file should look something like this.
Depending on how you want to do this, you could either have one line going directly to the roms directory or have individual lines to turn individual systems on and off in Emulation Station. I opted for the latter route.
The only line in the above screenshot that I added for example purposes was
Add more lines changing the directory only as needed. Some might cringe with the rw rights given, but that's necessary for game save data. When you're done, save your /etc/exports file and give the nfs service a restart.
sudo service nfs-kernel-server restart
Step 5: Acquire software on the Raspberry PiWhether you have a keyboard hooked-up or you ssh into it because you can't be bothered to get out of your chair (like my lazy ass), these instructions should work just the same. Everything you will be doing on the Pi side of things will be super user. In order to drop into super user mode...
Celebrate that you are root! Good job!
apt-get install nfs-common
Note: This is why I had the clearing-out of the roms directories early on. If the directories aren't empty, you can't mount a network resource to the folder and this won't work!
Your fstab file should look something like this
The only thing I've added so far for demonstration purposes is the line:
192.168.0.4:/media/justin/Monster_Drive/roms/psx /home/pi/RetroPie/roms/psx nfs auto 0 0
Substitute the IP address with whatever IP your nfs server is and the directory following the colon to be your roms directory. The second set of directory structures should be the same. The only thing you might need to edit is the “psx” at the end. If you're doing this for Nintendo 64 roms, substitute “n64” in there.
Save your fstab file and restart your Pi.
Step 6: Test it outVICTORY!
- Static IPs are a good idea to avoid having to re-configure the fstab file every time your computer gets a new IP address.
- Gigabit network is a must. When you're loading large files like this over the network, loading will lag even with the fastest of LANs. Be patient.
- With the roms located elsewhere, you can potentially run EmulationStation/Retropie with the bare minimum of SD card.
Coming soon: How to do this on Windows.