oicfar
Posts: 25
Joined: Tue Sep 17, 2019 7:39 am

External drive won't mount automatically after reboot

Thu Sep 19, 2019 8:37 pm

Hi,

I mounted an external HD on one Raspi i my cluster.

Code: Select all

sudo mkdir /clusterfs
sudo chown nobody.nogroup -R /clusterfs
sudo chmod 777 -R /clusterfs
In /etc/fstab I added

Code: Select all

UUID=65077e7a-4bd6-47ea-8014-01e06655cc31 /clusterfs ext4 defaults 0 2
And
sudo mount -a
works.

Than I installed

Code: Select all

sudo apt install nfs-kernel-server -y
and in /etc/exports I added

Code: Select all

/clusterfs 192.168.178.0/24(rw,sync,no_root_squash,no_subtree_check)
And at least

Code: Select all

sudo exportfs -a
On all the other nodes in the cluster I did

Code: Select all

sudo apt install nfs-common -y

sudo mkdir /clusterfs
sudo chmod -R 777 /clusterfs
In /etc/fstab I added this

Code: Select all

<master node ip>:/clusterfs    /clusterfs    nfs    defaults   0 0
And

Code: Select all

sudo mount -a
is working.

But after reboot or restart is the external drive not mounted. I don't see anny errors in dmsg. And when I call

Code: Select all

sudo mount -a
it works.

Why not automatically?

ejolson
Posts: 4904
Joined: Tue Mar 18, 2014 11:47 am

Re: External drive won't mount automatically after reboot

Fri Sep 20, 2019 4:26 am

oicfar wrote:
Thu Sep 19, 2019 8:37 pm
Why not automatically?
It may be a problem with how systemd runs the init services. Someone else may understand things enough to fix them properly, but not me. I would place something like

Code: Select all

(
    sleep 5
    echo Mounting everything in fstab...
    mount -a
    echo ...done
) &
in /etc/rc.local and then focus on more interesting problems. It is possible the NFS server will need restarting after you mount the filesystem, but I'm not sure.

oicfar
Posts: 25
Joined: Tue Sep 17, 2019 7:39 am

Re: External drive won't mount automatically after reboot

Fri Sep 20, 2019 7:36 pm

ejolson wrote:
Fri Sep 20, 2019 4:26 am
oicfar wrote:
Thu Sep 19, 2019 8:37 pm
Why not automatically?
It may be a problem with how systemd runs the init services. Someone else may understand things enough to fix them properly, but not me. I would place something like

Code: Select all

(
    sleep 5
    echo Mounting everything in fstab...
    mount -a
    echo ...done
) &
in /etc/rc.local and then focus on more interesting problems. It is possible the NFS server will need restarting after you mount the filesystem, but I'm not sure.
Thx. I will check the process. Cause is should work with the entry in the /etc/fstab.

oicfar
Posts: 25
Joined: Tue Sep 17, 2019 7:39 am

Re: External drive won't mount automatically after reboot

Sat Sep 21, 2019 9:52 am

ejolson wrote:
Fri Sep 20, 2019 4:26 am
oicfar wrote:
Thu Sep 19, 2019 8:37 pm
Why not automatically?
It may be a problem with how systemd runs the init services. Someone else may understand things enough to fix them properly, but not me. I would place something like

Code: Select all

(
    sleep 5
    echo Mounting everything in fstab...
    mount -a
    echo ...done
) &
in /etc/rc.local and then focus on more interesting problems. It is possible the NFS server will need restarting after you mount the filesystem, but I'm not sure.
I found this
Sep 20 01:19:44 pi-4-node-1 systemd[1]: clusterfs.mount: Mount process exited, code=exited, status=32/n/a
Sep 20 01:19:44 pi-4-node-1 systemd[1]: clusterfs.mount: Failed with result 'exit-code'.
Sep 20 01:19:44 pi-4-node-1 systemd[1]: Failed to mount /clusterfs.
Sep 20 01:19:44 pi-4-node-1 systemd[1]: Dependency failed for Remote File Systems.
Sep 20 01:19:44 pi-4-node-1 systemd[1]: remote-fs.target: Job remote-fs.target/start failed with result 'dependency'.
in syslog.

ejolson
Posts: 4904
Joined: Tue Mar 18, 2014 11:47 am

Re: External drive won't mount automatically after reboot

Sat Sep 21, 2019 3:42 pm

oicfar wrote:
Sat Sep 21, 2019 9:52 am
ejolson wrote:
Fri Sep 20, 2019 4:26 am
oicfar wrote:
Thu Sep 19, 2019 8:37 pm
Why not automatically?
It may be a problem with how systemd runs the init services. Someone else may understand things enough to fix them properly, but not me. I would place something like

Code: Select all

(
    sleep 5
    echo Mounting everything in fstab...
    mount -a
    echo ...done
) &
in /etc/rc.local and then focus on more interesting problems. It is possible the NFS server will need restarting after you mount the filesystem, but I'm not sure.
I found this
Sep 20 01:19:44 pi-4-node-1 systemd[1]: clusterfs.mount: Mount process exited, code=exited, status=32/n/a
Sep 20 01:19:44 pi-4-node-1 systemd[1]: clusterfs.mount: Failed with result 'exit-code'.
Sep 20 01:19:44 pi-4-node-1 systemd[1]: Failed to mount /clusterfs.
Sep 20 01:19:44 pi-4-node-1 systemd[1]: Dependency failed for Remote File Systems.
Sep 20 01:19:44 pi-4-node-1 systemd[1]: remote-fs.target: Job remote-fs.target/start failed with result 'dependency'.
in syslog.
That sure looks like systemd trouble to me. I find systemd so confusing that I switched to the Artix and the antiX distributions on my Intel compatible machines. While I haven't found a similarly suitable operating system for the Raspberry Pi, I'm enjoying 64-bit Gentoo Linux on one of my Pi computers.

Sorry I'm not more help. Maybe it would work better to include noauto as an option for /clusterfs in fstab and then change rc.local to read

Code: Select all

(
    sleep 5
    echo Mounting /clusterfs from fstab...
    mount /clusterfs
    echo ...done
) &

Return to “Troubleshooting”