Raspbian + NFS

Install:

[cc lang=”bash”]
apt-get install nfs-kernel-server
[/cc]

Exports:

[cc lang=”bash”]
nano /etc/exports
[/cc]

Once there, let’s add:

[cc lang=”bash”]
/mnt/flash *(rw,sync)
[/cc]

Dont’ forget to run exportfs!

Add New Services:

Here’s the deal: rpcbind must run before nfs-server. But due to a bug… that’s not the case. What happens if the sequence is not that?… simple! NFS is inaccessible.

In order to fix this, let’s do the following:

[cc lang=”bash”]
cat >/etc/systemd/system/nfs-common.service <<\EOF [Unit] Description=NFS Common daemons Wants=remote-fs-pre.target DefaultDependencies=no [Service] Type=oneshot RemainAfterExit=yes ExecStart=/etc/init.d/nfs-common start ExecStop=/etc/init.d/nfs-common stop [Install] WantedBy=sysinit.target EOF [/cc] [cc lang="bash"] cat >/etc/systemd/system/rpcbind.service <<\EOF [Unit] Description=RPC bind portmap service After=systemd-tmpfiles-setup.service Wants=remote-fs-pre.target Before=remote-fs-pre.target DefaultDependencies=no [Service] ExecStart=/sbin/rpcbind -f -w KillMode=process Restart=on-failure [Install] WantedBy=sysinit.target Alias=portmap EOF [/cc] Source Here!

Raspbian + Flash Drive + fstab

First off, you need to figure out the path of your flash drive:

[cc lang=”bash”]
fdisk -l
[/cc]

Then… edit /etc/fstab as follows:

[cc lang=”bash”]
/dev/sda1 /mnt/flash vfat rw,user,umask=0002,uid=1001,gid=121 0 0
[/cc]

Note that umask is… the “inverted” regular file mask. This represents 665 (because we’re evil). As per uid + gid, you can figure it out by means of this command:

[cc lang=”bash”]
id username
[/cc]

Update:

The best filesystem to use, if you need to maintain compatibility between the Flash Drive you’ll use with your Raspberry, and macOS, is probably ExFat. Now, problem is: Linux doesn’t really support ExFat by default.

So, we’ll need to install it, as follows:

[cc lang=”bash”]
sudo apt-get install exfat-fuse
[/cc]

In such case, your /etc/fstab file should look like this:

[cc lang=”bash”]
/dev/sda1 /mnt/flash exfat. rw,user,umask=0002,uid=1001,gid=121 0 0
[/cc]

Raspberry + Samba

Installing Samba:
[cc lang=”bash”]
apt-get install samba samba-common-bin
[/cc]

Once there, edit /etc/samba/smb.conf as follows:

[cc lang=”bash”]
workgroup = [your_workgroup_name]

[SHARE-NAME]
comment=Samba Share
path=/PATH/TO/YOUR/SHARE
browseable=Yes
writeable=Yes
only guest=no
create mask=0777
directory mask=0777
public=no
[/cc]

At last, setup the Samba password:

[cc lang=”bash”]
smbpasswd -a YOUR_USERNAME
[/cc]