0

I'm creating a kubernetes cluster with 1 desktop pc and 3 raspberry pi4.

The desktop PC is set as master node and NFS server.

Each RPi4 has two USB keys:

  • Ubuntu 21.04 Server on 32GB key
  • Storage on 256 GB key

I want to mount a NFS directory on boot on the 256GB

My /etc/fstab file looks like this

LABEL=writable                                  /               ext4    discard,errors=remount-ro   0    1
LABEL=system-boot                               /boot/firmware  vfat    defaults                    0    1
UUID=2867ec74-ba7c-490c-87ed-096e029f2147       /storage        ext4    defaults                    0    2
192.168.1.10:/mnt/storage/node1                 /storage        nfs     defaults                    0    0

Each node has its own directory node1, node2, node3.

The problem here is the mounting of NFS works if I set local path to /mnt but doesn't work on start when I set it to /storage

This command works sudo mount 192.168.1.10:/mnt/storage/node1 /storage but the directory is not mounted on boot.

My theory is on startup, it doesn't have time to mount NFS because the USB storage is not mounted when command is executed.

Can someone confirm ? If so, does someone have a solution ?

I tried to mount it using cron but it doesn't work.

4
  • You appear to be attempting to mount 2 devices at the same mount point - which is impossible.
    – Milliways
    Commented May 21, 2021 at 22:59
  • It works when I do it manually sudo mount 192.168.1.10:/mnt/storage/node1 /storage
    – T00rk
    Commented May 21, 2021 at 23:07
  • Another question. Let's say my NFS directory is 500GB, what happens if I mount it on a 32GB USB Key ?
    – T00rk
    Commented May 21, 2021 at 23:09
  • nothing unusual happens ... you still can't mount two devices to the same mount point - which device do you expect to see in your setup - hint: it'll be the first one Commented May 21, 2021 at 23:55

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.