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.
sudo mount 192.168.1.10:/mnt/storage/node1 /storage