Is umount -l dangerous?


 
Thread Tools Search this Thread
Operating Systems Linux Is umount -l dangerous?
# 1  
Old 09-14-2009
Is umount -l dangerous?

I had a umount busy issue, that the usual fuser -mk did not solve, I did a umount -l and was able to unmount the device, I then got in trouble by the storage team staff:

Here was a snippet of their response:

Using "umount -l" is a potentially dangerous act.
The command combination for a lazy unmount "umount -l" has been outlawed in the past by the storage team.
It has caused outages on filers (they had to reboot)


I have never had the issue myself in the past with the command, and was wondering if anyone had any personal experience on this issue?

Thks.
# 2  
Old 09-14-2009
Well, if you can't track down what's keeping it open with fuser, how will a lazy unmount help? It doesn't force anything, just waits. It doesn't stop anything from opening either, so it could well wait forever. If the filesystem is having actual problems, the system could be stuck forever waiting for operations to complete that will simply never complete with no way to cancel the unmount short of rebooting and hoping the filesystem isn't left in an unusable state.
# 3  
Old 09-14-2009
It doesn't wait, it pretty much says "OK, Lets just drop the connection" and allows the FS to sort it out later.
# 4  
Old 09-14-2009
From the manual:

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

So the filesystem is not "really" completely unmounted, it is in a state waiting for the processes using the filesystem to end so the filesystem can be cleaned up.

I would not recommend this. It is better to find the processes using the filesystem (with lsof, for example) and them manually kill the processes and then unmount. I would not want my server and filesystem to be in such a wait state of uncertainty.

---------- Post updated at 19:11 ---------- Previous update was at 19:00 ----------

Quote:
Originally Posted by mark54g
It doesn't wait, it pretty much says "OK, Lets just drop the connection" and allows the FS to sort it out later.
Not really..... it does not drop the busy connections, it waits, and then cleans up, after the busy processes terminate.

---------- Post updated at 19:20 ---------- Previous update was at 19:11 ----------

FYI, FWIW from lsof manual:

Quote:
+|-f [cfgGn]

f by itself clarifies how path name arguments are to be interpreted. When followed by c, f, g, G, or n in any combination it specifies that the listing of kernel file structure information is to be enabled (`+') or inhibited (`-').

Normally a path name argument is taken to be a file system name if it matches a mounted-on directory name reported by mount(8), or if it represents a block device, named in the mount output and associated with a mounted directory name.

When +f is specified, all path name arguments will be taken to be file system names, and lsof will complain if any are not. This can be useful, for example, when the file system name (mounted-on device) isn't a block device. This happens for some CD-ROM file systems.

When -f is specified, all path name arguments will be taken to be simple files. Thus, for example, the ``-f /'' arguments direct lsof to search for open files with a `/' path name, not all open files in the `/' (root) file system.

Be careful to make sure +f is properly terminated and isn't followed by a character (e.g., of the file or file system name) that might be taken as a parameter. For example, use ``--'' after +f as in this example.

$ lsof +f -- /file/system/name

The listing of information from kernel file structures, requested with the +f [cfgGn] option form, is normally inhibited, and is not available for some dialects - e.g., /proc-based Linux. When the prefix to f is a plus sign (`+'), these characters request file structure information:
  • c file structure use count
  • f file structure address
  • g file flag abbreviations
  • G file flags in hexadecimal
  • n file structure node address

When the prefix is minus (`-') the same characters disable the listing of the indicated values.

File structure addresses, use counts, flags, and node addresses may be used to detect more readily identical files inherited by child processes and identical files in use by different processes. Lsof column output can be sorted by output columns holding the values and listed to identify identical file use, or lsof field output can be parsed by an AWK or Perl post-filter script, or by a C program.
# 5  
Old 09-14-2009
Sorry, I did not mean the process connection. I meant the file system mount status to users was "offline" and the cleanup would occur later. It was not meant to be horribly accurate but give a very high level overview of "Do now, clean later"
# 6  
Old 09-15-2009
That's not accurate either. I went and tested it before spouting off, you know...

Users who have open directories are not stopped from traversing them, opening files in them, writing things in files, or perhaps even creating files. In other words, a lazy unmount doesn't do anything at all to the filesystem until it's free -- it just fakes it. That is, it denies access to a mounted filesystem until everyone closes all references to it. That's pretty much the worst of both worlds: It's mounted, so you can't do a thing to the devices, but it acts like its offline and denies everyone access. If the administration couldn't quickly find whatever reference is plugging up the unmount, they really would have to reboot the machine, it's either that or send the people who need to use that partition home for the day.

It wouldn't be so bad if there was a way to cancel a lazy unmount...

Last edited by Corona688; 09-15-2009 at 02:21 PM..
# 7  
Old 09-15-2009
Interesting. That was not at all how it was explained to me. I did not have a chance to test it at the time I responded, but I'll give it a go. I have only been using it for NFS mounts when the remote machine has gone offline and the local machine has not "let go".
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. War Stories

Dangerous rm -rf command

Hello All, I am posting a intresting story which is posted by Mark Brader but actual story is from Mario Wolczko. Original link is here Thanks, R. Singh (4 Replies)
Discussion started by: RavinderSingh13
4 Replies

2. Shell Programming and Scripting

List of dangerous shell commands

Hello, I have a Application which needs to run shell scripts in a elevated state (root) for system interrogation. So I execute each script using bash -C. This has worked really well. I now want to add another layer of security, I cant inspect each of the scripts before they get deployed to the... (4 Replies)
Discussion started by: tjones1105
4 Replies

3. UNIX for Dummies Questions & Answers

Umount CIFS

hi guys I have to umount a CIFS from a Windows machine...but it's been imposible there is one special task /sbin/umount.cifs /mondobackup that task cannot be kill...so I cannot umount the unit any idea how to kill this and umount this CIFS share? by the way I've tried umount... (5 Replies)
Discussion started by: kopper
5 Replies

4. UNIX for Dummies Questions & Answers

accidentally umount -a

Hi all, I accidentally unmounted filesystems using umount -a command. How to recover from this. Please help. Thanks in advance! when i try to use mount -a i got the following output. # mount -a mount: /dev/vg00/lvol05 already mounted or /opt busy mount: /dev/vg00/lvol07 already... (4 Replies)
Discussion started by: lramsb4u
4 Replies

5. HP-UX

how to force umount

sorry, wrong section, mod please close thread (0 Replies)
Discussion started by: robertngo
0 Replies

6. Solaris

umount is failing

I am trying to umount a NFS share. When I do the following: # umount syrupg21 umount: /oebs/syrupg21: device is busy device bussy so I like to check what is working on the system.... # fuser -muv /oebs/syrupg21/ # So no locks should be there... any clue? Regards, Johan... (3 Replies)
Discussion started by: suntac
3 Replies

7. UNIX for Dummies Questions & Answers

List of dangerous Unix command

Hi Guys, I wonder if one of you would have a list of dangerous commands on unix. Regards (8 Replies)
Discussion started by: JBB873
8 Replies

8. UNIX for Advanced & Expert Users

umount help

hi all, I inherit a Solaris7 system with /home mounted via a share from the NFS server. When I look at mnttab, there are two entries mounted under /home. Let's say they are server:/home/a and server:/home/b. I would like to maintain /home/a but not /home/b. However, I just don't know where... (4 Replies)
Discussion started by: andrec
4 Replies

9. UNIX for Dummies Questions & Answers

umount error

the program as follow: mount /dev/fd0135ds18 /mnt cd /mnt touch file1 cat /file2 >/mnt/file1 umount /dev/fd135ds18 when error tell device busy could you tell me the reason? (1 Reply)
Discussion started by: fresh
1 Replies

10. UNIX for Dummies Questions & Answers

umount

:confused: Twofold question for you unix "guru's" 1) When attempting to use the umount command I get a message stating that the partition that I want to unmount is busy. Is there another command that I need to use prior to the umount command to clear the partition of activity????? ... (2 Replies)
Discussion started by: rod23
2 Replies
Login or Register to Ask a Question