Sunday, March 22, 2015

The Situation 

 So 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 Solution 

 The 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 computer

 Because 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 computer 

 All I had to install was nfs-kernel-server from the apt repository
  sudo apt-get install nfs-kernel-server

 Step 4: Edit /etc/exports 

 You 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
/media/justin/Monster_Drive/roms/psx *(rw,sync,no_root_squash,no_subtree_check)

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 Pi 

Whether 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...
sudo su

 Celebrate that you are root! Good job!

 Install nfs-common
apt-get install nfs-common

 Edit fstab
nano /etc/fstab

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 out 

 VICTORY!

Notes

  • 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.

Reactions:

5 comments:

  1. Good post. I need something similar but in windows...

    ReplyDelete
    Replies
    1. You know, I was thinking of something to do tonight. Stay tuned.

      Delete
    2. http://blog.hackersare.us/2016/01/3tb-storage-on-raspberry-pi-2-doze.html BOOM!

      Delete
    3. Thank you very much. I will test this night.
      Thank you again.

      Delete
  2. Another thing to consider when looking at pcs is the memory. This also has an impact on speed as well as a direct impact on the data storage. In some cases, you might find it cheaper to purchase a computer that does not have a lot of memory as long as it has the capacity to add more, which most do. Self Storage

    ReplyDelete

Subscribe to RSS Feed Follow me on Twitter!