Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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.

share|improve this question

2 Answers 2

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
share|improve this answer
    
The mount command shows it as being mounted. –  khoran512 Jan 8 '10 at 23:05

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

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.