1

I have a samba share called A on a machined named aaron. Inside that share is a smylink called Audio-CD_WAVs which points to a machine local directory. When this share is accessed by a windows machine, samba follows the link and exports the target to windows so windows does not see the symlink.

Now, I later mounted Audio-CD_WAVs on another linux machine, dathan, on a normal directory called CD-mount. I used smbfs for this mount. I expected it to mount the target of the link, but instead the mountpoint itself, CD-mount, turned into a symlink pointing to the directory on aaron. The problem I have now is that I cannot unmount this, the unmount command follows the symlink and complains that it does not exist. So how can I unmount this (without rebooting the machine, which would interrupt a lot of people)?

Before mounting:

drwxrwxrwx CD-mount

$ mount CD-mount

after:

lrwxrwxrwx CD-mount -> /some/nonexistant/directory12

$ umount CD-mount

umount: directory12: not found

$ mount |tail -n 1

//aaron.us.grn/A/Audio-CD_WAVs on /mnt/CD-mount type cifs (ro,mand)

I think the explanation for this behaviour is that when samba sees a linux client, it enables the 'unix extensions' option which includes support for symlinks. I only found this after I had already mounted the symlink though.

2 Answers2

1

I have tried both -f and -l and neither work:

$ umount -f CD-mount

umount2: No such file or directory

umount: directory12: not found

$ umount -l CD-mount

umount: directory12: not found

0

You are correct, Samba is indeed interpreting the symlink and presenting it as a directory; smbfs is not.

The option for this in Samba is "follow symlinks = yes", and is defined in the share definition. You can turn this behavior off with "follow symlinks = no".

Somehow, I doubt that the symlink is mounted. If the filesystem is truly unmounted, just delete the symlink.


You can attempt a forced dismount with:

mount -f /mount-path

or

mount -l /mount-path
Avery Payne
  • 14,326
  • 1
  • 48
  • 87