Downloads GitHub

Network Shares (NFS)

The Network (NFS) device (nfs:) opens NFS exports on a Linux or BSD server or a NAS, over NFSv4.0. NFS shares are saved with the SMB shares, at the end of LAUNCHSTATION.CNF, and edited in the same place. Not yet tested on a console.

What you need
  • A console with a network adapter (or built-in Ethernet) on the same LAN as the server.
  • An export on the server that lets the PS2 in, with NFSv4.0 enabled (on Linux, cat /proc/fs/nfsd/versions lists +4 without -4.0).
  • An IP address for the PS2 (Settings > Network), and Legacy Ethernet drivers off.
  • At least one NFS share, added in Settings > Network > NFS shares (or as text, below).

How it works

Network (NFS) is listed in Files once an NFS share is saved. Nothing touches the network until you open it. The first time, Launchstation starts the network with the address in IPCONFIG.DAT, loads the NFS driver and connects every saved NFS share. nfs:/ then lists one folder per connected share, named by its NAME: nfs:/LINUX, nfs:/NAS.

The driver speaks NFSv4.0 on TCP port 2049: it needs no portmapper and no MOUNT protocol, and reaches the export from the server’s root, as mount -t nfs4 does. It connects from a port below 1024, so the export does not need the insecure option. A share that does not connect is left out of nfs:/ and the browser says why; opening the device again tries it again, at most every 30 seconds.

The PS2 sends the user and group IDs of the share (0 when not set) as AUTH_SYS credentials. With the usual root_squash, 0 is the server’s anonymous user, so files must be readable by everyone, and a folder writable by everyone to copy into it. Set the IDs of a server account instead to read and write as that account.

A connection the server closes, or that drops, is connected again on the next use, and open files and folders carry on: NFS keeps no state for them on the server.

Where shares are saved

An NFS share is a block among the SMB shares, after the # SMB shares line at the end of LAUNCHSTATION.CNF (see SMB shares). The URL’s scheme makes it an NFS share. It has two keys:

KeyValueLongest (bytes)
NAMEThe share’s folder name in nfs:/. Required, unique among all shares (in any case), no / \ : * ? " < > |31
URLnfs://<IP address>[:<port>]/<export path>[?uid=N&gid=N]; the port is 2049 when left out, and the IDs are 0255
# /srv/ps2 on a Linux box, as nfs:/LINUX, reading and writing as uid/gid 1000
NAME = LINUX
URL = nfs://192.168.1.100:2049/srv/ps2?uid=1000&gid=1000

# The games folder of a NAS export, as nfs:/NAS, as the anonymous user
NAME = NAS
URL = nfs://192.168.1.20/volume1/ps2/games

What you can do

Stack rules

Troubleshooting

  1. No Network (NFS) in Files. It is listed once an NFS share is saved: add one in Settings > Network > NFS shares.
  2. “Server did not answer on the NFS port”. Check the server’s IP address, that the NFS server runs, and that a firewall lets TCP 2049 in (firewalld: firewall-cmd --add-service=nfs).
  3. “Server does not answer NFSv4.0”. The server has NFSv4.0 turned off (some distributions now ship with 4.1 and 4.2 only); turn 4.0 on in its NFS configuration. The Windows NFS server does not offer 4.0.
  4. “No such export on the server”. The export path is not exported: check /etc/exports (exportfs -v).
  5. “The export refused this PS2”. The PS2’s address is not in the export’s client list.
  6. Files are listed but cannot be read or written. The IDs the PS2 sends do not have the rights: set the share’s User ID and Group ID to those of the files’ owner, or make the files readable (and a folder writable) by everyone.

The nfs: device uses Ronnie Sahlberg’s unfs4, a minimal NFSv4.0 client and the sibling of the usmb2 SMB client. See Credits.