0

I have a small server with a samba share that sometimes I use to share removable disks connected in the hot swap bays. After mounting a disk and accessing it, I try to unmount it, but umount refuses (even using -f) to do it because the disk is busy: umount: /share/external: target is busy..

lsof reports:

smbd      62850                                root  cwd       DIR               8,65       4096          1 /share/external
smbd      62850                                root   46r      DIR               8,65       4096          1 /share/external
smbd      62851                          alessandro  cwd       DIR               8,65       4096          1 /share/external

smbstatus shows the mountpoint is locked (I already closed the file manager):

Locked files:
Pid          User(ID)   DenyMode   Access      R/W        Oplock           SharePath   Name   Time
--------------------------------------------------------------------------------------------------
62850        1000       DENY_NONE  0x81        RDONLY     NONE             /share/external   .   Mon Mar 14 17:09:58 2022

So, to unmount the drive I have to restart smbd first and then I can run umount successfully, but I want to avoid restarting the service, or killing processes manually (as I saw searching online). I also tried to disable possible locks in smb.conf with

        locking = No
        oplocks = No

but without success.

Does someone know how to stop this behavior and allow unmounting without restarting?

Useful information:
  • Ubuntu 20.04.4 LTS (GNU/Linux 5.4.0-104-generic x86_64)
  • Samba version 4.13.17-Ubuntu

0 Answers0