BinsonBuzz / unraid_rclone_mount

scripts to create rclone mounts on gdrive
288 stars 71 forks source link

The mount is making unraid unable to stop array #28

Open rqi14 opened 3 years ago

rqi14 commented 3 years ago

I am using unraid 6.8.3

When clicking stop array, the status is stuck at Array Stopping Retry unmounting user share(s)...

there are two issues.

  1. /mnt/user cannot be unmounted by the system. I have to manually do fusermount -uz /mnt/user
  2. The script left an empty folder in /mnt/user0/mount_rclone. The system cannot delete it automatically and thus failed to umount /mnt/user0 as it is not empty.

Please see the log below Feb 13 19:50:21 unraidServer emhttpd: shcmd (545): exit status: 32 Feb 13 19:50:21 unraidServer emhttpd: shcmd (546): rmdir /mnt/user Feb 13 19:50:21 unraidServer root: rmdir: failed to remove '/mnt/user': Device or resource busy Feb 13 19:50:21 unraidServer emhttpd: shcmd (546): exit status: 1 Feb 13 19:50:22 unraidServer emhttpd: shcmd (548): /usr/local/sbin/update_cron Feb 13 19:50:22 unraidServer emhttpd: Retry unmounting user share(s)... Feb 13 19:50:27 unraidServer emhttpd: shcmd (549): umount /mnt/user0 Feb 13 19:50:27 unraidServer root: umount: /mnt/user0: not mounted. Feb 13 19:50:27 unraidServer emhttpd: shcmd (549): exit status: 32 Feb 13 19:50:27 unraidServer emhttpd: shcmd (550): rmdir /mnt/user0 Feb 13 19:50:27 unraidServer root: rmdir: failed to remove '/mnt/user0': Directory not empty Feb 13 19:50:27 unraidServer emhttpd: shcmd (550): exit status: 1 Feb 13 19:50:27 unraidServer emhttpd: shcmd (551): umount /mnt/user Feb 13 19:50:27 unraidServer root: umount: /mnt/user: target is busy. Feb 13 19:50:27 unraidServer emhttpd: shcmd (551): exit status: 32 Feb 13 19:50:27 unraidServer emhttpd: shcmd (552): rmdir /mnt/user Feb 13 19:50:27 unraidServer root: rmdir: failed to remove '/mnt/user': Device or resource busy Feb 13 19:50:27 unraidServer emhttpd: shcmd (552): exit status: 1 Feb 13 19:50:27 unraidServer emhttpd: shcmd (554): /usr/local/sbin/update_cron Feb 13 19:50:27 unraidServer emhttpd: Retry unmounting user share(s)... Feb 13 19:50:32 unraidServer emhttpd: shcmd (555): umount /mnt/user0 Feb 13 19:50:32 unraidServer root: umount: /mnt/user0: not mounted. Feb 13 19:50:32 unraidServer emhttpd: shcmd (555): exit status: 32 Feb 13 19:50:32 unraidServer emhttpd: shcmd (556): rmdir /mnt/user0 Feb 13 19:50:32 unraidServer root: rmdir: failed to remove '/mnt/user0': Directory not empty Feb 13 19:50:32 unraidServer emhttpd: shcmd (556): exit status: 1 Feb 13 19:50:32 unraidServer emhttpd: shcmd (557): umount /mnt/user Feb 13 19:50:32 unraidServer root: umount: /mnt/user: target is busy. Feb 13 19:50:32 unraidServer emhttpd: shcmd (557): exit status: 32 Feb 13 19:50:32 unraidServer emhttpd: shcmd (558): rmdir /mnt/user Feb 13 19:50:32 unraidServer root: rmdir: failed to remove '/mnt/user': Device or resource busy Feb 13 19:50:32 unraidServer emhttpd: shcmd (558): exit status: 1 Feb 13 19:50:32 unraidServer emhttpd: shcmd (560): /usr/local/sbin/update_cron Feb 13 19:50:32 unraidServer emhttpd: Retry unmounting user share(s)... Feb 13 19:50:37 unraidServer emhttpd: shcmd (561): umount /mnt/user0 Feb 13 19:50:37 unraidServer root: umount: /mnt/user0: not mounted. Feb 13 19:50:37 unraidServer emhttpd: shcmd (561): exit status: 32 Feb 13 19:50:37 unraidServer emhttpd: shcmd (562): rmdir /mnt/user0 Feb 13 19:50:37 unraidServer root: rmdir: failed to remove '/mnt/user0': Directory not empty Feb 13 19:50:37 unraidServer emhttpd: shcmd (562): exit status: 1 Feb 13 19:50:37 unraidServer emhttpd: shcmd (563): umount /mnt/user Feb 13 19:50:37 unraidServer root: umount: /mnt/user: target is busy. Feb 13 19:50:37 unraidServer emhttpd: shcmd (563): exit status: 32 Feb 13 19:50:37 unraidServer emhttpd: shcmd (564): rmdir /mnt/user Feb 13 19:50:37 unraidServer root: rmdir: failed to remove '/mnt/user': Device or resource busy Feb 13 19:50:37 unraidServer emhttpd: shcmd (564): exit status: 1 Feb 13 19:50:37 unraidServer emhttpd: shcmd (566): /usr/local/sbin/update_cron Feb 13 19:50:37 unraidServer emhttpd: Retry unmounting user share(s)... Feb 13 19:50:42 unraidServer emhttpd: shcmd (567): umount /mnt/user0 Feb 13 19:50:42 unraidServer root: umount: /mnt/user0: not mounted. Feb 13 19:50:42 unraidServer emhttpd: shcmd (567): exit status: 32 Feb 13 19:50:42 unraidServer emhttpd: shcmd (568): rmdir /mnt/user0 Feb 13 19:50:42 unraidServer root: rmdir: failed to remove '/mnt/user0': Directory not empty Feb 13 19:50:42 unraidServer emhttpd: shcmd (568): exit status: 1 Feb 13 19:50:42 unraidServer emhttpd: shcmd (569): umount /mnt/user Feb 13 19:50:42 unraidServer root: umount: /mnt/user: target is busy. Feb 13 19:50:42 unraidServer emhttpd: shcmd (569): exit status: 32 Feb 13 19:50:42 unraidServer emhttpd: shcmd (570): rmdir /mnt/user Feb 13 19:50:42 unraidServer root: rmdir: failed to remove '/mnt/user': Device or resource busy Feb 13 19:50:42 unraidServer emhttpd: shcmd (570): exit status: 1 Feb 13 19:50:42 unraidServer emhttpd: shcmd (572): /usr/local/sbin/update_cron Feb 13 19:50:42 unraidServer emhttpd: Retry unmounting user share(s)...

Justawebguy commented 3 years ago

Having the same issue. Did you figure out a resolution?

thegreenemachine55 commented 3 years ago

I was having the same problem, found a script that southloven posted over on the unraid forums and customized it for my use.

Run "lsof | grep /mnt/user/ " when the array is stuck unmounting disks and customize the script for your needs.

!/bin/bash

#######################

unmount Script

#######################

Version 0.0.1

#######################

echo "$(date "+%d.%m.%Y %T") INFO: Starting rclone_unmount script "

umount -l /mnt/user/RcloneRemoteName/RcloneRemoteName umount -l /mnt/user/mount_mergerfs/gdrive_vfs umount -l /mnt/user/mount_mergerfs/RcloneRemoteName umount -l /mnt/user/mount_rclone/gdrive_vfs umount -l /mnt/user/mount_rclone/RcloneRemoteName umount -l /mnt/user0/mount_rclone/cache/RcloneRemoteName umount -l /mnt/user/local/RcloneRemoteName

echo "$(date "+%d.%m.%Y %T") INFO: Ending rclone_unmount script "

exit

Torqu3Wr3nch commented 3 years ago

Same issue here. Confirmed fixed by @thegreenemachine55's suggestion.

I've updated the the unmount script to use the share location variables used in the rclone_mount script and will issue a pull request this weekend.

thekiefs commented 2 years ago

Same problem here. Can this #30 please get merged?

NineBall8 commented 2 years ago

@BinsonBuzz Works fine here, should we merge?

Sildenafil99 commented 2 years ago

I have the same problem. I used the script, and also added "umount -l /mnt/user0/" but now i stucked in rmdir: failed to remove '/mnt/user0': Directory not empty and rmdir: failed to remove '/mnt/user': Directory not empty