Hard drive unmounts on reboot and randomly Topic is solved

Having issues with your DietPi installation or found a bug? Post it here.
Post Reply
Poulou759
Posts: 4
Joined: Tue Apr 27, 2021 8:23 pm

Hard drive unmounts on reboot and randomly

Post by Poulou759 »

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
User avatar
Joulinar
Posts: 4502
Joined: Sat Nov 16, 2019 12:49 am

Re: Hard drive unmounts on reboot and randomly

Post by Joulinar »

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>/
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
User avatar
MichaIng
Site Admin
Posts: 2917
Joined: Sat Nov 18, 2017 6:21 pm

Re: Hard drive unmounts on reboot and randomly

Post by MichaIng »

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

Code: Select all

dmesg -l emerg,alert,crit,err
dmesg | tail -10
Poulou759
Posts: 4
Joined: Tue Apr 27, 2021 8:23 pm

Re: Hard drive unmounts on reboot and randomly

Post by Poulou759 »

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.

Code: Select all

[   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
User avatar
Joulinar
Posts: 4502
Joined: Sat Nov 16, 2019 12:49 am

Re: Hard drive unmounts on reboot and randomly

Post by Joulinar »

cat you share cat /etc/fstab
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
Poulou759
Posts: 4
Joined: Tue Apr 27, 2021 8:23 pm

Re: Hard drive unmounts on reboot and randomly

Post by Poulou759 »

My /etc/fstab - physical drives

Code: Select all

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
User avatar
MichaIng
Site Admin
Posts: 2917
Joined: Sat Nov 18, 2017 6:21 pm

Re: Hard drive unmounts on reboot and randomly

Post by MichaIng »

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?
Poulou759
Posts: 4
Joined: Tue Apr 27, 2021 8:23 pm

Re: Hard drive unmounts on reboot and randomly

Post by Poulou759 »

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

Code: Select all

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
User avatar
MichaIng
Site Admin
Posts: 2917
Joined: Sat Nov 18, 2017 6:21 pm

Re: Hard drive unmounts on reboot and randomly

Post by MichaIng »

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.
User avatar
Joulinar
Posts: 4502
Joined: Sat Nov 16, 2019 12:49 am

Re: Hard drive unmounts on reboot and randomly

Post by Joulinar »

yap looks better. /etc/fstab is showing /mnt/barracuda now.
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
Post Reply