Power & Source of Big Ideas

NFS on Debian Linux

Moderators: chensy, FATechsupport

I recently purchased a NanoPi R5C and installed Debian 11 from your repository. I am unable to use NFS to share a folder from the device. I've set up the NFS share in /etc/exports and everything appears to be configured properly, but when I try to share out the folder, I get the following error:

exportfs: [the folder] does not support NFS export.

The file system is using OverlayFS on top of EXT4, which seems to be the issue. I've to add nfs_export=on

menuentry "Live system" --hotkey=l {
linux /boot/vmlinuz-*none hostname=FriendlyElec username=pi findiso=${iso_path} nfs_export=on
initrd /boot/initrd.img-*none

as shown, but it didn't help. How can I get NFS to work?
Just in case you did not find the answer and for others that'll struggle with setting a nfs server up.

The solution I used was to get rid of overlayfs as it doesn't serve _any_ useful purpose on this kind of installation (you can reinstall from a SD card in less that a minute, reboot included).

1)- make a backup !
I recommend using borgbackup, that can be installed with pip (see borgbackup.org > Installation) - DO NOT use the bullseye pkg as it is buggy, if you sshfs mount a backup, it'll clear the mounting point w/o unmounting it when mass copy from it, quite a weird behavior.
A VERY IMPORTANT thing is to also save a list of all installed packages (see man dpkg, sections : --get-selections & --set-selection), create it into /root. I also have /SSHFS to mount a backup on a machine (good practice : even if you're a seasoned admin, always use full caps when you create a directory or a script, it makes them much easier to distinguish from those of the system when they (inevitably) multiply).

2)- sudo echo "overlayfs=disable" > /.init_wipedata

3)- reboot

4)- you're now back to the state that was just after the OS image installation - check that overlayfs is gone for good with : df, you now should read : mmcblk2p8 instead of : overlayfs on the / line (on a nanopc-t6, YMMV depending of your SBC)

5)- install all pkgs that are needed to install borgbackup (or whatever backup pgm you're used to) with pip and install it

6)- apt install dselect ; dselect update (yep, absolutely needed, as dselect list of pkgs is not the same as apt)

7)- manually mount your last backup on /SSHFS and : dpkg --set-selections </SSHFS/root/LIST_OF_INSTALLED_PKGS.list

8)- apt-get dselect-update (NOTE : you might have to redo that if you have pkgs source(s) for which you need to import a repo key once keys retrieved and installed).

9)- cp -a /SSHFS/etc / ; cp -a /SSHFS/root / ; cp -a /SSHFS/home / ; cp -a /SSHFS/usr/local/bin /usr/local ; ; cp -a /SSHFS/usr/local/sbin /usr/local

You now should be good to reboot and enjoy a system freed from the useless mess that is overlayfs.

Of course I did not write everything down, you'll also have to set your keyboard, language and some other things to make it easier to recover your full system in the manual part, but as it depends of your own system only you can tell what will be needed (hint : think well and write it down until it makes sens).

It take some time for the whole procedure (at least an hour), but after that, you install nfs-kernel-server, set it up and you're done :)

Who is online

In total there are 2 users online :: 0 registered, 0 hidden and 2 guests (based on users active over the past 5 minutes)
Most users ever online was 5185 on Wed Jan 22, 2020 1:44 pm

Users browsing this forum: No registered users and 2 guests