Drives not mounting properly in Drive_Manager Topic is solved

Having issues with your DietPi installation or found a bug? Post it here.
aw512
Posts: 7
Joined: Fri Jan 15, 2021 5:53 am

Drives not mounting properly in Drive_Manager

Post by aw512 »

I am using a Rock64 as a file server with the system on a sd card and a HDD connected through USB used for storage.
The system worked when setup about a year ago. It was not used for months but was left powered on.
I tried logging in via SSH but the connection refused. I connected the board to HDMI and saw errors about the USB 3.0 port which prevented the system from booting. I switched to a different port and was able to login. After this I was able to connect drives to the USB 3.0 port and boot.

I had the userdata folder on the external HDD, which was mounted when first set up but now refuses to mount properly. I tried mounting the drive through drive_manager. The drive shows that it's mounted in drive manager and /etc/fstab. noauto,x-systemd.automoun is set in the fstab. However, I am unable to access the share via FTP. Which I was able to previously do. When the system is rebooted the HDD is not mounted and displays the UUID instead of the mount name I assigned it in drive_manager. In fstab the mount is commented out after reboot. I mount the HDD through drive_manager and it automatically mounts to the name I assigned it. But the same errors persist and I am unable to access it through FTP. I am also unable to login to sonarr and radarr through the web interface.

Things I tried are,
1. Switching from Samba to FTP
2. Deleting the fstab entry, unmounting through drive_manager, deleting the residual mount folder in /mnt.
3. 3 other drives.
4. Different USB ports.
5. Moving the userdata location from the system drive to the external drive and vice versa.

The logs are here
User avatar
MichaIng
Site Admin
Posts: 3106
Joined: Sat Nov 18, 2017 6:21 pm

Re: Drives not mounting properly in Drive_Manager

Post by MichaIng »

Many thanks for your report.

Let's please start with using the external drive from scratch.
1. If your dietpi_userdata are currently located at that drive, move it back to the internal drive.
2. If the drive is currently mounted, use dietpi-drive_manager to unmount it.
3. Verify that df and /etc/fstab do not contain it anymore (commented entries have no effect, not sure why we add them at all :?).
4. Unplug the drive and reboot the system so that all info about it is gone.

Then re-add the drive and debug each step:
1. Attach the drive, check fdisk -l and lsblk whether it was detected correctly, in case partprobe /dev/sdX to make the kernel aware of its partition table.
2. Mount it manually to a new mount point, mkdir /mnt/test && mount /dev/sdX1 /mnt/test, check whether you can access all data fine, dmesg doesn't show any I/O errors etc.
3. Then remount manually with the mount options we use in dietpi-drive_manager and retest, to rule out any issues with those. That depends on the file system type. Which one is it? I saw an NTFS in your logs?
aw512
Posts: 7
Joined: Fri Jan 15, 2021 5:53 am

Re: Drives not mounting properly in Drive_Manager

Post by aw512 »

Thanks for the troubleshooting suggestions. When initially set up I was using a NTFS drive but decided to switch to a different ext4 drive now.
During steps 1-3 I noticed df still shows the mount point, it is /mnt/StoreJet

Filesystem 1K-blocks Used Available Use% Mounted on
udev 427180 0 427180 0% /dev
tmpfs 100204 4120 96084 5% /run
/dev/mmcblk0p1 7595336 4294172 3202672 58% /
tmpfs 501016 20 500996 1% /dev/shm
tmpfs 5120 0 5120 0% /run/lock
tmpfs 501016 0 501016 0% /sys/fs/cgroup
tmpfs 51200 8 51192 1% /var/log
tmpfs 1048576 4 1048572 1% /tmp
/dev/sda1 1921811248 940153124 883966068 52% /mnt/StoreJet

After unplugging the drive and rebooting df shows the mount point removed.
Manual mounting worked. I followed steps 1-4 to remount using dietpi-drive_manager and this also worked.
Perhaps unplugging the drive and rebooting is the critical step that I needed to resolve the issue. It is the only step I did not do in my solo troubleshooting.

There is one issue that remains, the /mnt/dietpi_userdata folder is empty. I believe it is because initially I had the dietpi_userdata on the external drive. The only folders that contained system data were the sonarr and radarr folders, which still remain on the external drive.

The issue with this is that I am unable to move the user data folder in any direction, in between the system sd card and the external HDD. Moving the user data folder to the external drive using drive manager shows as successful but soon after the userdata location defaults to the system sd card. I manually moved the sonarr and radarr folders to /mnt/dietpi_userdata but am still not able to access the services through the web interface, despite them showing as active in dietpi-services.

How can I restore radarr and sonarr?

The drive mounting logs are here
User avatar
Joulinar
Posts: 5148
Joined: Sat Nov 16, 2019 12:49 am

Re: Drives not mounting properly in Drive_Manager

Post by Joulinar »

can you share the error logs pls

Code: Select all

cat /var/log/radarr/radarr.txt
cat /var/log/sonarr/sonarr.txt
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
aw512
Posts: 7
Joined: Fri Jan 15, 2021 5:53 am

Re: Drives not mounting properly in Drive_Manager

Post by aw512 »

The logs are created but have no data written to them. They are 0 bytes. I opened with nano and dietpi-explorer to confirm.

Code: Select all

root@DietPi:/var/log/radarr# ls -sh
total 0
0 logs.db  0 radarr.0.txt  0 radarr.txt

Code: Select all

root@DietPi:/var/log/sonarr# ls -sh
total 0
0 logs.db  0 logs.db-shm  0 logs.db-wal  0 sonarr.txt
There are no sonarr and radarr folders in /mnt/dietpi_userdata but they are on the external drive

Code: Select all

root@DietPi:/mnt/StoreJet/dietpi_userdata/radarr# ls -sh
total 296K
4.0K Backups        0 logs.db      4.0K MediaCover    4.0K radarr.pid
4.0K config.xml     0 logs.db-shm  4.0K nzbdrone.pid
   0 logs           0 logs.db-wal  276K radarr.db

Code: Select all

root@DietPi:/mnt/StoreJet/dietpi_userdata/sonarr# ls -sh
total 1.1M
4.0K Backups        0 logs.db-shm   32K nzbdrone.db-shm
4.0K config.xml     0 logs.db-wal  152K nzbdrone.db-wal
   0 logs        4.0K MediaCover   4.0K nzbdrone.pid
   0 logs.db     892K nzbdrone.db
User avatar
Joulinar
Posts: 5148
Joined: Sat Nov 16, 2019 12:49 am

Re: Drives not mounting properly in Drive_Manager

Post by Joulinar »

Did you tried to copy back the folder? They are needed to operate.
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
aw512
Posts: 7
Joined: Fri Jan 15, 2021 5:53 am

Re: Drives not mounting properly in Drive_Manager

Post by aw512 »

Copied now. Here are the logs

Code: Select all

root@DietPi:~# cat /var/log/radarr/radarr.txt
2021-1-16 10:18:45.1|Info|Bootstrap|Starting Radarr - /opt/radarr/Radarr.dll - Version 3.0.1.4259
2021-1-16 10:18:50.1|Info|AppFolderInfo|Data directory is being overridden to [/mnt/dietpi_userdata/radarr]
2021-1-16 10:18:50.3|Fatal|ConsoleApp|EPIC FAIL!

[v3.0.1.4259] NzbDrone.Common.Exceptions.RadarrStartupException: Radarr failed to start: AppFolder /mnt/dietpi_userdata/radarr is not writable
   at NzbDrone.Common.EnvironmentInfo.AppFolderFactory.Register() in D:\a\1\s\src\NzbDrone.Common\EnvironmentInfo\AppFolderFactory.cs:line 58
   at Radarr.Host.Bootstrap.Start(StartupContext startupContext, IUserAlert userAlert, Action`1 startCallback) in D:\a\1\s\src\NzbDrone.Host\Bootstrap.cs:line 33
   at NzbDrone.Console.ConsoleApp.Main(String[] args) in D:\a\1\s\src\NzbDrone.Console\ConsoleApp.cs:line 4

Code: Select all

root@DietPi:~# cat /var/log/sonarr/sonarr.txt
21-1-16 10:18:40.5|Info|Bootstrap|Starting Sonarr - /opt/NzbDrone/NzbDrone.exe - Version 2.0.0.5344
21-1-16 10:18:44.5|Info|AppFolderInfo|Data directory is being overridden to [/mnt/dietpi_userdata/sonarr]
21-1-16 10:18:44.6|Fatal|ConsoleApp|EPIC FAIL!

[v2.0.0.5344] NzbDrone.Common.Exceptions.SonarrStartupException: Sonarr failed to start: AppFolder /mnt/dietpi_userdata/sonarr is not writable
  at NzbDrone.Common.EnvironmentInfo.AppFolderFactory.Register () [0x0007b] in <faeb8209b6ff4c15aabf93dc8df43c9f>:0 
  at NzbDrone.Host.Bootstrap.Start (NzbDrone.Common.EnvironmentInfo.StartupContext startupContext, NzbDrone.Host.IUserAlert userAlert, System.Action`1[T] startCallback) [0x0005a] in <f9c7c3abe88b4bee9b1509c9a2ed54aa>:0 
  at NzbDrone.Console.ConsoleApp.Main (System.String[] args) [0x0002f] in <342de43622c54cdfafa06db962320038>:0
User avatar
Joulinar
Posts: 5148
Joined: Sat Nov 16, 2019 12:49 am

Re: Drives not mounting properly in Drive_Manager

Post by Joulinar »

Now you have permission issues. How did you copied the folder? Did you used co -p to keep permission? Can you show content of user data folder ls -la /mnt/dietpi_userdata/
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
aw512
Posts: 7
Joined: Fri Jan 15, 2021 5:53 am

Re: Drives not mounting properly in Drive_Manager

Post by aw512 »

I used dietpi-explorer

Code: Select all

root@DietPi:~# ls -la /mnt/dietpi_userdata/
total 16
drwxr-xr-x 4 root   root   4096 Jan 16 10:16 .
drwxr-xr-x 7 root   root   4096 Jan 15 16:36 ..
drwxr-xr-x 6 dietpi dietpi 4096 Jan 14 21:19 radarr
drwxr-xr-x 6 dietpi dietpi 4096 Jan 14 21:19 sonarr
User avatar
Joulinar
Posts: 5148
Joined: Sat Nov 16, 2019 12:49 am

Re: Drives not mounting properly in Drive_Manager

Post by Joulinar »

Well it's incorrect folder permission for both. Try

Code: Select all

chown -R radarr /mnt/dietpi_userdata/radarr
chown -R sonarr /mnt/dietpi_userdata/sonarr
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
Post Reply