Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have read that it is possible to 'umount' a disk that is otherwise busy by using the 'lazy' option. The manpage has this to say about it:

umount - unmount file systems

-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. This option allows a "busy" filesystem to be unmounted. (Requires kernel 2.4.11 or later.)

But what would be the point in that? I considered why we dismount partitions at all:

  1. To remove the hardware
  2. To perform operations on the filesystem that would be unsafe to do while mounted

In either of these cases, all a 'lazy' unmount serves IMHO is to make it more difficult to determine if the disk really is dismounted and you can actually proceed with these actions. The only application for umount -l seems to be for inexperienced users to 'feel' like they've achieved something they haven't.

Why would you use a lazy unmount?

share|improve this question
up vote 5 down vote accepted

This is actually implemented to gain more time to do follow-up tasks in administrative tasks.

If further tasks, independent of this one is waiting in the pipeline, then you can lazy-unmount and go on with others in the batch.

Example: Task 1 and Task 2 are two administrative tasks scheduled back to back.

Task 1 Daily backup

This one copies a large number of files from a project partition to a backup partition, say, /mnt/backupProj, which will be mounted on the fly and unmounted at the end of this task.. The copying takes a significant amount of time.

Task 2 Update SQL-views

Performs a series of database view updates on a dedicated server.

Task 2 is obviously completely independent of Task 1, so we can lazy-unmount /mnt/backupProj without waiting for the backup task to complete.

share|improve this answer
Can you provide an example? In what situation would it 'gain/save time'? – deed02392 Apr 13 '12 at 16:30

Because you're lazy - you want to unmount after the disk operations are done.

Here's a plausible scenario:

You're using rsync to perform your backups and walk away. You can umount -l the drive and once it's finished copying and synched, it unmounts, so that when you come back after a break (that you know will take longer than the backup) you can just unplug the drive instead of having to fiddle with the keyboard again.

share|improve this answer
If you were lazy, surely you would want to save MORE time by not having to use the argument, because once you got back you knew you could dismount it immediately now the backup has finished? Or make dismounting the drive part of the post-backup operations? – deed02392 Apr 13 '12 at 15:10
Think of it this way: the disk is no longer busy - unmount it now. It's no longer mounted so nothing else can write to it. It's "do this when you can" instead of erroring out. – Broam Apr 13 '12 at 19:07

I use lazy umount in cases where it was obviously stuck for various reasons (such as nfs server down), also when I need to see the original content of the directory that was mounted over by the mount. In both cases the mount is busy. I think there are other edge cases but these 2 are the most common reasons I used the option.

share|improve this answer

Consider a bind mount as you might see when working with chroot:

mount --rbind /proc /mnt/proc
# do stuff
umount /mnt/proc

If you have a daemon on your system that constantly interrogates /proc (I'm looking at you ksysguardd), then you will be unable umount /mnt/proc. Lazy will let you umount in this case.

share|improve this answer

USB-drives sometimes get stalled because of hardware failure. Even if you reconnect the drive physically, you get another device-name. The old device-name cannot be unmounted normally. amount -l forced the dead entry to vanish.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .