-
1Build a RPi server
Get a Raspberry Pi (Zero W).
If you want to use external USB storage (USB memory stick, USB external SDD, etc): use a USB OTG cable and attach the storage device.
Get the Raspberry Pi Imager from https://www.raspberrypi.com/software/ and install on PC.
Install the 32 bit Raspberry Pi OS on de SD card. Recommended: use the advanced options in the Imager to set SSH and WiFi set up.
If you want to use part of the SD card as PRFS: install gparted on the PC (or other RPi). Shrink the Ext4 partition with the Raspberry Pi OS. Make a FA32 partition of the remaining space.
Put the SD card in the RPi, boot the RPi and log in with SSH.
Optional: install VNC for graphical remote access.
-
2Install FAT32PRFS
Download FAT32PRFS from: https://github.com/elbojvv/fat32prfs
Follow the make instructions in the README.md file.
Load the kernel modules as described.
Install the server of choice, e.g. Samba, Proftpd, etc. Use the FAT32PRFS mount point as root for the server.
-
3Install the switch
Download the software from: https://github.com/elbojvv/prfsswitch
Follow the make instructions in the README.md file.
Follow the electronics schematics: a LED, with a resistor of 330 Ohm, is connected to GPIO23 and ground. A 3 way switch, with a protective resistor of 330 Ohm, is connected to GPIO 24 and 25 and ground (see file Switch_schematics.jpg).
-
43D-print the housing
You can use the stl files on this project page to print the housing for the RPi, switch and LED holder.
The scad file is included if you want to modify the housing. You have to use Openscad from: https://openscad.org/
-
5Mount PRFS on boot
If you want to mount the disk as PRFS at boot, we have to install the kernel modules, mount as PRFS and start the prfs_switch program
First copy the .ko files into /lib/modules/$(uname -r) with
sudo cp *.ko /lib/modules/$(uname -r)/.
Edit the /etc/modules to load the kernel modules at startup, with sudo gedit /etc/modules
Edit at the end (without .ko!):
prfsmode fatprfs vfatprfs
Check after reboot whether the modules are loaded. with lsmod |grep prfs
If not, do the following:
sudo rm /sbin/depmod sudo ln -s /usr/bin/kmod /sbin/depmod sudo depmod
Check with sudo blkid the PARTUUID of the partition you want to mount as prfs. In this example it is 4b396e40-03.
Now edit /etc/fstab with sudo gedit /etc/fstab and add at the end:
PARTUUID=4b396e40-03 /mnt/prfs vfatprfs defaults,uid=1000,gid=1000,umask=0022 0 2
The space between the fields should be tabs. The PARTUUID should be without ".
One can check after a reboot with mount |grep prfs
We also have to start prfs_switch at boot. Assuming it is located in /home/pi/prfsswitch, start crontab -e
Add as last line:
@reboot /home/pi/prfsswitch/prfs_switch
After rebooting the disk should be mounted as prfs, and the LED is blinking.
-
6Installing Samba
If you want to use the server on Windows, we have to install Samba on the RPi and mount the share on windows.
On the RPi
Install Samba with sudo apt-get install samba samba-common-bin
Edit /etc/samba/smb.conf. Add to the end of this file:
[PIshare] path = /mnt/prfs writeable=Yes create mask=0777 directory mask=0777 public=no
Make a password with sudo smbpasswd -a pi
Restart samba with th new parameters: sudo systemctl restart smbd
Find your IP address with ifconfig
On Windows
Go to windows explorer. Right-click on Network.
Choose a drive letter and give as share: \\192.168.178.24\PIshare (choose your own IP address).
In the next window, fill in pi as user and your chosen samba password.
Now you are connected to the PRFS server.
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.