Menu
# umount /mnt umount: /mnt: device is busy. とか言われてしまいます。この場合は、lsof や fuser を使えば、その理由がわかるので、リカバーは簡単です。 # lsof /mnt COMMAND PID USER FD TYPE DEVICE SIZE NODE NAME bash 12756 kunitake cwd DIR 7,0 2048 1536 /mnt # fuser -v /mnt.
alphaniner wrote:First, did you try running lsof ?
You could also run mount to make sure you didn't forget to unmount something, and check you aren't in /mnt in another tty.
When I run lsof I get 'lsof will not execute and completion _lsof exists', then zsh asks me to correct 'lsof' to '_lsof'. When I press 'y', I get '_arguments:comparguments:312: can only be called from completion function'.
I ran mount already and there's a lot of things still mounted, but I assumed it wasn't an issue since there was no mention of it in the beginner's installation guide. It's mostly things mounted on /sys, /run, /proc, and /dev. The two mounted on /mnt (after having run 'umount /mnt/{boot,home,}') are /dev/sda3 (my /home) on /mnt, and udev on /mnt/dev.
BUR wrote:![Target Target](http://www.linuxvasanth.com/wp-content/uploads/2017/10/fuser.jpg)
Didn't you create separate home and boot partitions? Didn't you mount them? Shouldn't you unmount them first?
I first ran 'umount /mnt' as per the beginner's guide on the wiki. Then I ran 'umount /mnt/{boot,home,}', and those two unmounted normally. I still get the /mnt error, though.
This is my third installation attempt. After the other two attempts, the system would hang when shutting down, on the line 'kvm: exiting hardware virtualization'. Everything worked fine other than that, but I reinstalled in the hopes of fixing it.
edit: sorry, I didn't create a specific boot partition. Just /, swap, and /home. Is that an issue?
Last edited by Synek (2013-09-16 20:08:35)
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:
- To remove the hardware
- 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?
deed02392
deed02392deed02392
6 Answers
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.BroamBroam
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.
BoraBora
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.
johnshen64johnshen64
Consider a bind mount as you might see when working with
chroot
:![Umount /boot target is busy Umount /boot target is busy](http://basiclinuxcommand.com/files/umount/umount.png)
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.goertzenatorgoertzenator
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.
user296968user296968
Say you really need to change the volume on which a software is writing a log, e.g. a web server, but it has a lot of traffic and can't be turned off for the operation nor can the logging path be changed.
With lazy unmount, you can safely unmount the volume while the software is still running, mount another volume on to that same mountpoint and command the software to reopen files.
Ideally, since you didn't need to turn off the software, no requests were lost and essentially no log entries were lost either, since they were still being written to the old mount until the files were reopened (how well the software handles reopening the files is up to the software).
Paraphrasing the manpage, it means that if the volume has open files when it is lazy unmounted, in reality it remains mounted but just not accessible through the filesystem and is only truly unmounted when the last open file is closed.
Tuomas SalomäkiTuomas Salomäki