Hard drive unmounts on reboot and randomly

Hello everyone,
I’m running dietpi on a raspberry pi 4 and recently I’ve been having problems with a hard drive.

This is an ext4 disk attached via usb and it works very well once mounted (I always mount it through dietpi disk utility which works great).
However, everytime I reboot my Pi, I have to mount this disk again and it sometimes get unmounted randomely (or maybe my rpi loses power for a millisecond and restarts which I don’t think is possible).

Is there a way to mount it so it always stays this way even on reboot?

Thank you all for helping <3

Hi,

usually external device will have an automount flag and will be mounted as soon as you access it. Means it is not there right after reboot, but will be mounted as soon as you access /mnt/<your_name>/

That it randomly unmounts doesn’t sound good. Checking for kernel errors and last kernel messages could reveal what’s going on:

dmesg -l emerg,alert,crit,err
dmesg | tail -10

After reboot I see that each time I cd into the folder I created for the mount which is /mnt/barracuda, I can’t see anything, however It’s correctly mounted into /mnt/d3c5b165-6b43-4e04-92f8-fc4e888b389e which is the disk ID.
I specifically tolf dietpi-Drive_Manager to mount on /mnt/barracuda and it does not, except when I do it manually.

Nothing in the kernel,except some error messages which have nothing to do with it, it’s about my NAS that works well anyway but still if you think it’s a problem, I’d like to know what to do.

[   11.115336] CIFS: VFS:  BAD_NETWORK_NAME: \\192.168.1.12\Vidéos
[   11.115729] CIFS: VFS: cifs_mount failed w/return code = -2
[   57.048132] CIFS: VFS: Use of the less secure dialect vers=1.0 is not recommended unless required for access to very old servers

cat you share cat /etc/fstab

My /etc/fstab - physical drives

PARTUUID=8f4dbd00-02 / ext4 noatime,lazytime,rw 0 1
PARTUUID=8f4dbd00-01 /boot vfat noatime,lazytime,rw 0 2
UUID=d3c5b165-6b43-4e04-92f8-fc4e888b389e /mnt/d3c5b165-6b43-4e04-92f8-fc4e888b389e ext4 noatime,lazytime,rw,nofail,noauto,x-systemd.automount

No /mnt/barracuda there. When you use dietpi-drive_manager, unmount and remount it, setting again /mnt/barracuda as mount point, it does not change? It should print an info that the directory does exist already, but is empty, and if you want to proceed. Confirming this should set the mount point accordingly. If not, are there any error messages on the console, after you exit the drive manager?

Well now I get it right on reboot, it goes to /mnt/barracuda. It’s weird because I just mounted it with dietpi-Drive_Manager like I’ve always done before and now it seems to work.

Thanks a lot for the help, I’ll post again if I encounter the same problem in the future.
(BTW I didn’t mention that the drive I used is a 3.5" HDD plugged in via USB and that has its own power supply, maybe it had something to do with this)

My fstab now

PARTUUID=8f4dbd00-02 / ext4 noatime,lazytime,rw 0 1
PARTUUID=8f4dbd00-01 /boot vfat noatime,lazytime,rw 0 2
UUID=d3c5b165-6b43-4e04-92f8-fc4e888b389e /mnt/barracuda ext4 noatime,lazytime,rw,nofail,noauto,x-systemd.automount

Great that it works now. No idea currently how the mount point could not have been applied before. If it happens again, we’ll have a closer look.

yap looks better. /etc/fstab is showing /mnt/barracuda now.