Bug 41831 - "mount -a" double mounts mounted partitions
"mount -a" double mounts mounted partitions
Status: CLOSED CURRENTRELEASE
Product: Red Hat Linux
Classification: Retired
Component: mount (Show other bugs)
7.1
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Elliot Lee
David Lawrence
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2001-05-22 11:08 EDT by greg hosler
Modified: 2007-04-18 12:33 EDT (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2003-08-01 10:34:18 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description greg hosler 2001-05-22 11:08:28 EDT
From Bugzilla Helper:
User-Agent: Mozilla/4.76 [en] (X11; U; Linux 2.4.3-2.9.2smp i686)

Description of problem:
I think this is a bug, or at least an undesireable side effect to an
enhancement.

pick one or more mount points that are not presently inuse, and umount
them. Then, being lazy, instead of individually mounting the one(s) you
just umounted, do:

        mount -a

prior to seawolf, this would mount just the umounted partitions.

as of seawolf, this mounts the umounted partitions, and double mounts the
mounted ones as well. and since the partitions are already mounted, it will
mount the overmount "ro", which can have quite negative impact on a running
system (to say the least). Worse still, when you shutdown the system, the
double mounted partitions will not be cleanly umounted, which will force
a fsck upon the next reboot.

This sounds to me like a bug, but I know that mount was changed recently to
specifically allow overmounts. just the same, it seems to me that "mount
-a"
shouldn't double mount a mounted partition.


How reproducible:
Always

Steps to Reproduce:
1.see above
2.
3.
	

Actual Results:  mounted partitions are doubly mounted.

Expected Results:  only partitions in fstab that are not mounted should be
mounted.

Additional info:
Comment 1 Trey Waters 2001-07-24 10:09:42 EDT
Just from a layman's perspective, w/o looking at code, it would appear as 
though mount tries to mount a filesystem _before_ checking mtab.  Example:
(/dev/sdb5 is already mounted on /boot here).

# mount /boot
  I/O error: dev 08:21, sector 2
  I/O error: dev 08:21, sector 0
  I/O error: dev 08:31, sector 2
  I/O error: dev 08:31, sector 0
mount: /dev/sdb5 already mounted or /boot busy
mount: according to mtab, /dev/sdb5 is already mounted on /boot

--------------------------------------------------
Also, when doing the same with an NFS partition, no errors occur, and 'df' 
shows the NFS mount being doubly mounted.
Comment 2 Michael Schwendt 2001-08-08 20:53:12 EDT
[Problaby related, although this doesn't match the bug's subject line:]

When mounting via the loop device, it is possible to re-use existing mount
points, too:

  mount file1.img /mnt -o loop
  mount file2.img /mnt -o loop
The still mounted virtual fs file1.img gets buried beneath file2.img without any
warning or error.
When shutting down, only one of the two mounted vfs gets unmounted. If one of
the two files is located on a mounted hdd partition, that partition is still in
use and hence is not unmounted either, which forces an fsck at next boot time.
Comment 3 Elliot Lee 2003-08-01 10:34:18 EDT
I would wager this issue doesn't occur anymore.

Note You need to log in before you can comment on or make changes to this bug.