Bug 41831

Summary: "mount -a" double mounts mounted partitions
Product: [Retired] Red Hat Linux Reporter: greg hosler <greg>
Component: mountAssignee: Elliot Lee <sopwith>
Status: CLOSED CURRENTRELEASE QA Contact: David Lawrence <dkl>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.1CC: bugs.michael, mharris
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2003-08-01 14:34:18 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description greg hosler 2001-05-22 15:08:28 UTC
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 14:09:42 UTC
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-09 00:53:12 UTC
[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 14:34:18 UTC
I would wager this issue doesn't occur anymore.