Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I've mounted few shared locations using the below command.

mount -t cifs /mnt/systemfolder -o username=name,password=password //10.10.1.1/My-Shared-Folder

A few incorrect locations* have been erroneously mounted while running this command. Now when I execute just the mount command, it lists all the right and wrong locations I've mounted.

    • I have mounted the same location multiple times.

How do I remove locations that show up from executing the mount command so that I can remove the incorrect ones I've mounted?

The umount command does not help me remove the mounted location. Here's a screenshot showing the results to the mount and umount commands.

enter image description here

share|improve this question

5 Answers 5

up vote 8 down vote accepted

You have several directories that are mounted over other directories (the second mount on /mnt/arcserver shadows the first one and so on, and the mounts on /mnt shadow the prior mounts on /mnt/arcserver). This is confusing both for humans and to the umount command. Unmount them from the bottom up:

umount //10.49.4.20/Released
umount //10.49.4.20/released
umount //10.49.4.20/released
umount //metro/released
umount //metro/released
umount //metro/released

If even that fails because umount is tripping on the multiple identical mounts, in desperation, unmount all cifs mounts:

umount -a -t cifs

On Linux, you can unconfuse the situation by moving mounts so that each has its unique, non-overlapping mount point.

mkdir /TMPMNT/{Released,released{1,2},arcserver{1,2,3,4}}
mount --move //10.49.4.20/Released /TMPMNT/Released
mount --move //10.49.4.20/released /TMPMNT/released1
mount --move //10.49.4.20/released /TMPMNT/released2
mount --move //metro/released /TMPMNT/arcserver1
mount --move //metro/released /TMPMNT/arcserver2
mount --move //metro/released /TMPMNT/arcserver3
mount --move //metro/released /TMPMNT/arcserver4

After this you'll have separate directories for each mounted filesystem, which you can explore and unmount at your leasure.

share|improve this answer
    
Thanks. The problem was the mount order. Thanks for the multiple suggestions too! I had to first umount /mnt and then /mnt/arcserver worked. –  Thomas Jun 28 '12 at 6:23

Instead of the mount point, try unmounting the device

 umount //metro/released 
share|improve this answer

try umount.

umount /mnt/systemfolder
share|improve this answer
    
Tried it and it didn't help. I get the message This utility only unmounts cifs filesystems. I did mount the locations using cifs. Unsure why this message then. –  Thomas Jun 27 '12 at 15:23
    
Can you elaborate on that? According to the manpage, umount will call /sbin/umount.<suffix> {dir|device} [-nlfvr] [-t type.subtype]. So it should call umount.cifs which should do the trick for you. Did you try mounting something else there? Maybe you should try calling umount.cifs directly? Or looking up its manpage directly (man umount.cifs)? –  Wojtek Rzepala Jun 27 '12 at 15:29
    
I've added some additional information to the question to make it clearer. –  Thomas Jun 27 '12 at 15:37
    
That shouldn't be the case, looks like you're picking up an unusual umount. Can you try running /bin/umount explicitly? –  Useless Jun 27 '12 at 15:46
    
Just tried that, same results. –  Thomas Jun 27 '12 at 15:53

maybe with umount -f ?

-f Force unmount (in case of an unreachable NFS system). (Requires kernel 2.1.116 or later.)

Or maybe you can do it with umount -l

-l Lazy unmount. Detach the filesystem from the filesystem hierar- chy now, and cleanup all references to the filesystem as soon as it is not busy anymore. (Requires kernel 2.4.11 or later.)

from: http://linux.die.net/man/8/mount

but looking around I found something here.

$ umount.cifs /folder

UPDATE Check the manual of umount.cifs... maybe it could give you an extra hand:

http://www.samba.org/samba/docs/man/manpages-3/umount.cifs.8.html

umount.cifs unmounts a Linux CIFS filesystem. It can be invoked indirectly by the umount(8) command when umount.cifs is in /sbin directory, unless you specify the "-i" option to umount. Specifying -i to umount avoids execution of umount helpers such as umount.cifs. The umount.cifs command only works in Linux, and the kernel must support the cifs filesystem. The CIFS protocol is the successor to the SMB protocol and is supported by most Windows servers and many other commercial servers and Network Attached Storage appliances as well as by the popular Open Source server Samba.

hope this could help you.

share|improve this answer
    
Tried all three suggestions. They all give the same repetitive messages. That last one only gives the message only once. –  Thomas Jun 27 '12 at 18:37
    
@Tomas I found something about the umount.cifs take a look at it. –  maniat1k Jun 27 '12 at 18:59

Running

$ umount -i 

fixed the problem for me.

share|improve this answer
1  
Hi Mike and welcome to U&L. Could you add a little bit more details to your answer? –  slm Nov 20 '13 at 2:49

Your Answer

 
discard

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.