One thing I've noticed through the years is that if a "umount" command is
failing (some error message, e.g., "target is busy" or whatever), you can
often get around this (*) by adding "-l" to the command line. "-l" is
documented as "lazy" (yes, I'm familiar with what the man page says about
it), but it seems, in practice to be more of a "do it anyway" - a
functionality that is usually coded as "-f" (meaning "force") or similar.
Note that umount *does* have a "-f" option, but in my experience that never
seems to work; "-f" is documented as having something to do with NFS and I
don't use NFS.
Here's a recent example of this in action (Note that I am describing this
in detail, but the details don't really matter; I'm not looking for tech
support on the problem, but rather an answer to the question in the Subject
line). This example is only one of many similar things I've noticed over
the years.
--- Example ---
I have one Linux machine ("Machine #1") that has an external hard disk
attached as /dev/sda1. I have /dev/sda1 mounted as /mnt/something and have
/mnt/something Samba shared on my LAN. Other Linux machines on the LAN
Samba mount this drive (e.g., "Machine #2"). Now, while trying to fix some
other problem, I decided to umount and re-mount the drive (on Machine #1).
Then I go over to Machine #2 and try to access the Samba-mounted drive and
get some weird error message. I note that this is probably because of it
having been umounted and re-mounted (on Machine #1), so I probably need
to unmount and remount the Samba connection. But whenever I try to access
/mnt/SambaDrive, I get some weird error message (Something like
"/mnt/SambaDrive is not a directory"). When I look at it with "ls -lsa",
the "mode" string in the "ls" output displays as something like
"d?????????". If I try to umount it (as root or as a user), it says "Not a
directory". But, and here's the key: If I umount with -l (as root), it
umounts as expected. I then re-mount it (as a user) and everything is fine.
--- End of Example ---
So, my question is: Why does "-l" make it magically work? And thus why
isn't it the default?
(*) Assuming, of course, that it isn't really busy. Often I get the
"target is busy" err msg in error. Such is life.
--
The randomly chosen signature file that would have appeared here is more than 4
lines long. As such, it violates one or more Usenet RFCs. In order to remain
in compliance with said RFCs, the actual sig can be found at the following URL:
http://user.xmission.com/~gazelle/Sigs/ModernXtian