Bug 11222 - Can mount two filesystems as /
Can mount two filesystems as /
Status: CLOSED NOTABUG
Product: Red Hat Linux
Classification: Retired
Component: kernel (Show other bugs)
6.2
i386 Linux
medium Severity low
: ---
: ---
Assigned To: Michael K. Johnson
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2000-05-04 12:49 EDT by Richard A Frewin
Modified: 2008-05-01 11:37 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2000-05-04 12:49:32 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 Richard A Frewin 2000-05-04 12:49:32 EDT
First noticed this when trying to mount an NFS filesystem to a directory
called '/a' - and fat-fingered the command missing off the 'a'.

Further testing shows that this is not an NFS problem and can be reproduced
with local filesystems

   starman# mount /dev/hda6 /
   starman# cat /proc/mounts
   /dev/root / ext2 rw 0 0
   /proc /proc proc rw 0 0
   none /dev/pts devpts rw 0 0
   /dev/hda6 / ext2 rw 0 0
   starman#

A reboot then hangs trying to unmount / twice.

Also lots of things break because -

   starman# ls -la /
   total 136
   drwxr-xr-x    5 root     root         4096 Apr 27 11:03 .
   drwxr-xr-x    5 root     root         4096 Apr 27 11:03 ..
   -rw-------    1 root     root          322 May  4 16:49 .bash_history
   lrwxrwxrwx    1 root     root           13 Apr 15 17:24 SOffice ->
/misc/SOffice
   drwxr-xr-x    2 root     root         4096 Apr 15 17:11 a
   drwxr-xr-x    2 root     root         4096 Apr 15 16:38 bin
   drwxr-xr-x    2 root     root         4096 May  4 16:58 boot
[...]

but -

   starman# ls -la /..
   total 36
   drwxr-xr-x    5 root     root         4096 Apr 27 11:03 .
   drwxr-xr-x    5 root     root         4096 Apr 27 11:03 ..
   drwxr-xr-x    2 root     root        16384 Apr 14 20:29 lost+found
   drwxr-xr-x    3 XXXXX    XXXXX        8192 May  3 11:44 rpn
   drwxr-xr-x    3 YYYYY    YYYYY        4096 May  3 14:35 star

the contents of /dev/hda6 (which is also returned by things like 'ls -al
/bin/..').

Upgraded to kernel-2.2.14-12 but still the same.

Only tested on i386 Zoot.
Comment 1 Alan Cox 2000-08-22 12:05:59 EDT
You are allowed to mount over /. It isnt neccessarily a good idea but root can
and is intentionally 
able to do daft things.

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