linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* unmounting multiply-mounted directories
@ 2003-03-04  0:53 David Madore
  0 siblings, 0 replies; only message in thread
From: David Madore @ 2003-03-04  0:53 UTC (permalink / raw)
  To: linux-kernel

Hi all.

I use devfs on my installation, even though my distribution
(RedHat-7.3) does not endorse it.  Most of the time it works fine.
However, when I want to upgrade certain packages (for example, that
which contains the entries in the non-devfs /dev directory) I need to
make the original /dev directory visible to the package management
(viz. rpm) program.

Seeing that I cannot unmount the devfs /dev directory since many
processes use it, I figured the best way to do that would be to
temporarily mount the original /dev directory in its place and over
it, and then unmount it.  So I did something like this

mount /dev/sda2 /mnt/bareroot
mount --bind /mnt/bareroot/dev /dev
rpm -U whichever-package-needs-to-access-dev.whatever.rpm

This worked fine.  Unfortunately, I then discovered that I couldn't
unmount the /dev directory!  I get this:

vega root ~ # umount /dev
umount: /dev: device is busy
umount: /dev: device is busy

Hum, why am I getting the error message twice?  Is it because I have
two different mounts on the same /dev mountpoint?

Anyway, I would like to trace that "device is busy" error back to its
causes, that is, determine which processes are preventing me from
unmounting the topmost /dev mount.  How do I do that?  I tried using
fuser but it is useless: it does not have an option to distinguish
open files from the bottommost /dev mount and from the topmost.  So
how should I distinguish the two?

Actually, all sorts of weird things are happening now.  For example,
the /dev/pts directory is all empty (that doesn't seem to bother xterm
overmuch, though, even if I open new xterms).  Well, I guess I'm in
for an emergency reboot.

But, what would be The Right Way to make the old /dev accessible to a
program that needs to access it?  I can think of running the program
chrooted with a specially mounted / but it doesn't seem perfect
either.  Any other ideas?

Oh, and by the way: is there some documentation to mount --bind
somewhere?  Like, something which explains the detailed semantics of
that operation?

Thank you for your help -

-- 
     David A. Madore
    (david.madore@ens.fr,
     http://www.eleves.ens.fr:8080/home/madore/ )

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2003-03-04  0:42 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-03-04  0:53 unmounting multiply-mounted directories David Madore

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).