[Solved] Backup in another pc in the same network

I just tried to go ahead and try to back up the system while I wait to understand better the UFW.

I found and mounted the external drive on the NFS server configured on the ubuntu-desktop.

Once I try to change the backup location it shows me this:

DietPi-Backup ├───────────────────────────────────────────────────┐
                            │  - Command: mkdir -p /mnt/nfs_dietpibkp/dietpi-backup                                     │ 
                            │  - Exit code: 1                                                                                                      │ 
                            │  - DietPi version: v8.0.2 (MichaIng/master) | HW_MODEL: 1 | HW_ARCH: 1 | DISTRO: 6                                   │ 
                            │  - Image creator: DietPi Core Team                                                                                   │ 
                            │  - Pre-image: from scratch                                                                                           │ 
                            │  - Error log:                                                                                                        │ 
                            │ mkdir: cannot create directory ‘/mnt/nfs_dietpibkp/dietpi-backup’: Read-only file system                             │ 
                            │                                                                                                                      │ 
                            │                         Retry          : Re-run the last command that failed                                         │ 
                            │                         DietPi-Config  : Edit network, APT/NTP mirror settings etc                                   │ 
                            │                         Open subshell  : Open a subshell to investigate or solve the issue                           │ 
                            │                         Send report    : Uploads bugreport containing system info to DietPi                          │ 
                            │                                        ●─ Devs only ──────────────────────────────────────●                          │ 
                            │                         Change command : Adjust and rerun the command                                                │ 
                            │                                                                                                                      │ 
                            │                                                                                                                      │ 
                            │                                  <Ok>                                      <Exit>

As always what I’m doing wrong?

can you share following

showmount -e <ip_of_your_ubuntu>
cat /etc/fstab

Did you set the NFS export on Ubuntu to r/w?

this the output:

showmount -e <192.168.1.96> cat /etc/fstab
-bash: 192.168.1.96: No such file or directory
root@DietPi:~#

About the NFS export on ubuntu I followed the steps suggested here https://phoenixnap.com/kb/ubuntu-nfs-server, in the Export Shared Directory chapter… is this correct?

pls copy my commands one by one and not together in a single line. As well, pls remove place holder.

showmount -e 192.168.1.96 
cat /etc/fstab

ops sorry :roll_eyes: here it is:

root@DietPi:~# showmount -e 192.168.1.96
Export list for 192.168.1.96:
/mnt/dietpibkp 192.168.1.15
root@DietPi:~# cat /etc/fstab
# You can use "dietpi-drive_manager" to setup mounts.
# NB: It overwrites and re-creates physical drive mount entries on use.
#----------------------------------------------------------------
# NETWORK
#----------------------------------------------------------------
192.168.1.96:/ /mnt/nfs_client nfs nofail,noauto,x-systemd.automount

#----------------------------------------------------------------
# TMPFS
#----------------------------------------------------------------
tmpfs /tmp tmpfs size=1024M,noatime,lazytime,nodev,nosuid,mode=1777
tmpfs /var/log tmpfs size=50M,noatime,lazytime,nodev,nosuid,mode=1777

#----------------------------------------------------------------
# MISC: ecryptfs, vboxsf (VirtualBox shared folder), gluster, bind mounts
#----------------------------------------------------------------


#----------------------------------------------------------------
# SWAP SPACE
#----------------------------------------------------------------
/var/swap none swap sw

#----------------------------------------------------------------
# PHYSICAL DRIVES
#----------------------------------------------------------------
PARTUUID=0e2887fb-02 / ext4 noatime,lazytime,rw 0 1
PARTUUID=0e2887fb-01 /boot vfat noatime,lazytime,rw 0 2
UUID=614fbf4d-1260-405f-9f30-07d9c13067ce /mnt/ownclouddrive ext4 noatime,lazytime,rw,nofail,noauto,x-systemd.automount
UUID=2966eeaa-38a0-4cef-9469-fcd591d85249 /mnt/backup ext4 noatime,lazytime,rw,nofail,noauto,x-systemd.automount
root@DietPi:~#

You created the NFS export to be reachable for IP 192.168.1.15 only. This is correct?

ok pls do following

  1. open file /etc/fstab
nano /etc/fstab
  1. replace following line
192.168.1.96:/ /mnt/nfs_client nfs nofail,noauto,x-systemd.automount

with

192.168.1.96:/mnt/dietpibkp /mnt/nfs_client nfs nofail,noauto,x-systemd.automount
  1. save the file
  2. reboot your system
  3. check if the new mount is working
cd /mnt/nfs_client
df -h
touch demo.file
ls -la

done

root@DietPi:~# cd /mnt/nfs_client
root@DietPi:/mnt/nfs_client# df -h
Filesystem                   Size  Used Avail Use% Mounted on
/dev/root                    7.4G  3.4G  3.7G  49% /
devtmpfs                      87M     0   87M   0% /dev
tmpfs                        215M  2.6M  213M   2% /dev/shm
tmpfs                         86M  2.9M   84M   4% /run
tmpfs                        5.0M     0  5.0M   0% /run/lock
tmpfs                        1.0G     0  1.0G   0% /tmp
tmpfs                         50M   20K   50M   1% /var/log
/dev/mmcblk0p1               127M   52M   75M  41% /boot
/dev/sda1                    916G  3.7G  913G   1% /mnt/ownclouddrive
192.168.1.96:/mnt/dietpibkp  457G  236G  199G  55% /mnt/nfs_client
root@DietPi:/mnt/nfs_client# touch demo.file
root@DietPi:/mnt/nfs_client# ls -la
total 8
drwxrwxrwx 2 nobody nogroup 4096 Jan 21 18:36 .
drwxr-xr-x 9 root   root    4096 Jan 21 15:03 ..
-rw-r--r-- 1 nobody nogroup    0 Jan 21 18:36 demo.file
root@DietPi:/mnt/nfs_client#

Is this ok?

Yes looking good now. Try to run the backup.

thanks Joulinar
Now I found the location in the NFS server and it let me launch the backup but (there is always a but :slight_smile: )
After launch, it gives me a lot of: “failed: operation not permitted (1)”
Not only a lot, but every single file failed…

Sorry
I re-launched the backup and everything went well :wink: .
Just the last question before closing the topic: Does the backup includes everything that is installed in the dietpi?
I mean does it include also everything is saved also in my personal cloud on owncloud?

Sorry, another question:
I saw the location of the backup is this one:

Current backup and restore location:                                         │
│  - /mnt/backup/dietpi-backup

Is this the right place?
In the drive manager, I checked also the drive I thought the backup should be:

/mnt/nfs_client    : 192.168.1.96:/mnt/dietpibkp | nfs4 | Capacity: 457G |

Is this right?

you would need to change backup location to /mnt/nfs_client

usually ownCloud data are included if they are located on SD card, as we include whole /mnt/dietpi_userdata/

You should be able to have a look into the backup folder to see what data are backed up

Sorry but… when i Change the backup location and try to launch the backup, it start again to give me “failed: operation not permitted

yes looks like permission issue. Have a look to NFS server side. I checked the guide and probably section Configure Shared Directory did not fit as you changed permissions to nobody:nogroup. Try to change the folder on Ubuntu to root:root

Nothing to do… still the same problem but I notice one thing:
when I mount the drive in dietpi I used this name: mnt/nfs_client, in fact when I try to select the new directory where to save the backup it shows me this option /mnt/nfs_client : 192.168.1.96:/ | size: 457GiB | available: 197GiB.
Since on ubuntu I called the drive /mnt/dietpibkp, could it be possible it cannot recognize the right directory?

can you do following

touch /mnt/nfs_client/demo2.file
ls -la /mnt/nfs_client/
chown root:root /mnt/nfs_client/demo2.file
chmod 777 /mnt/nfs_client/demo2.file
ls -la /mnt/nfs_client/

this is the output:

root@DietPi:~# touch /mnt/nfs_client/demo2.file
touch: cannot touch '/mnt/nfs_client/demo2.file': Read-only file system
root@DietPi:~# ls -la /mnt/nfs_client/
total 12
drwxr-xr-x 20 root root 4096 Apr 21  2021 .
drwxr-xr-x  9 root root 4096 Jan 22 15:58 ..
drwxr-xr-x  3 root root 4096 Jan 18 08:50 mnt
root@DietPi:~# chown root:root /mnt/nfs_client/demo2.file
chown: cannot access '/mnt/nfs_client/demo2.file': No such file or directory
root@DietPi:~# chmod 777 /mnt/nfs_client/demo2.file
chmod: cannot access '/mnt/nfs_client/demo2.file': No such file or directory
root@DietPi:~# ls -la /mnt/nfs_client/
total 12
drwxr-xr-x 20 root root 4096 Apr 21  2021 .
drwxr-xr-x  9 root root 4096 Jan 22 15:58 ..
drwxr-xr-x  3 root root 4096 Jan 18 08:50 mnt
root@DietPi:~#

you still have permission issues to write to your NFS share.

Yes looks like… but how can I mount this drive /mnt/nfs_client : 192.168.1.96:/ | nfs4 | Capacity: 457G | Used: 237.4G if I have not permission on it? I mean: I see it, I can connect to it but I can’t write, read it?

Reading the share is not an issue. It’s writing files “only” :wink:
How does your /etc/exports looks like on server side.