mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: David Madore <david.madore@ens.fr>
To: linux-kernel@vger.kernel.org
Subject: unmounting multiply-mounted directories
Date: Tue, 4 Mar 2003 01:53:20 +0100	[thread overview]
Message-ID: <20030304015320.A13363@clipper.ens.fr> (raw)

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/ )

                 reply	other threads:[~2003-03-04  0:42 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20030304015320.A13363@clipper.ens.fr \
    --to=david.madore@ens.fr \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®