Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

mounting a filesystem multiple times - what sense?

Status
Not open for further replies.

w5000

Technical User
Nov 24, 2010
223
PL

is it a bug? for me it is insecure if the same fs can be mounted many times in such "hidden" mode

Code:
root@clnod1:~# mount /dev/drbd1 /mnt
root@clnod1:~# mount /dev/drbd1 /opt
root@clnod1:~# mount /dev/drbd1 /mnt2
root@clnod1:~# df|grep drbd
/dev/drbd1                  2535100 115712   2277680   5% /mnt
root@clnod1:~# umount /mnt
root@clnod1:~# df|grep drbd
/dev/drbd1                  2535100 115712   2277680   5% /opt
root@clnod1:~# umount /opt
root@clnod1:~# df|grep drbd
/dev/drbd1                  2535100 115712   2277680   5% /mnt2
 
insecure how exactly?

As 'root' you can mount a file system as many times as you want or need to under whatever alias/name/folder/reference/path you choose to call it, either temporarily using 'mount' or permanently in /etc/fstab.

And this may done be for expediency, convenience, historical applications you cannot change, ease of use, etc. etc.

Chris.

Indifference will be the downfall of mankind, but who cares?
Time flies like an arrow, however, fruit flies like a banana.
Webmaster Forum
 
Hi

Chris, I assume w5000's concern is related to [tt]df[/tt] output : the device is mounted 3 times, but [tt]df[/tt] lists it only once.

w5000, I would say no, it would be insecure if [tt]mount[/tt] would list it only once. I know about no reference on this, but [tt]df[/tt]'s behavior meets my personal expectation so I would say, is by design.


Feherke.
feherke.ga
 
if mount would list it only once. I know about no reference on this, but df's behavior meets my personal expectation so I would say, is by design

I would concur.

'df' provides information of [physical] disc/partition space so would [and should] only provide a single instance of a partition.

'mount' provides information of all mounted file systems, including ones that are 'hidden' from the end-user.

Chris.

Indifference will be the downfall of mankind, but who cares?
Time flies like an arrow, however, fruit flies like a banana.
Webmaster Forum
 

I asked because on AIX it is not possible "mount" again into different dir:

# mount /dev/lpar2rrd_lv /mnt
mount: 0506-324 Cannot mount /dev/lpar2rrd_lv on /mnt: The requested resource is busy.

(although there is another issue on AIX that user can mount an NFS to / (root) making system unusable).
 
AIX is not Linux, it may have the same distant ancestor, in UNIX but they separated eons ago.

Chris.

Indifference will be the downfall of mankind, but who cares?
Time flies like an arrow, however, fruit flies like a banana.
Webmaster Forum
 

I was just afraid about linux standard which allows mounting filesystem multiple times (what I see have completely no sense as only one mount is active and others are hidden/unvisible until their "antecessors" are unmounted) - please imagine you have such unnecessary mount command run on running cluster with drbd - will resource moving be successfull if after unmounting "real" mount drbd resource is still used/locked by now unhidden mount?
 
But "what you see" is not indicative of what anyone else necessarily 'sees' as being useful.

as only one mount is active
That is not what happens, assuming by 'mounts' you are referring to the 'virtual path alias' rather than the physical device, all 'mounts' are 'active' but only one physical device exists. and you can dismount any of the 'virtual paths' without affecting the other(s). It is directly analogous to using symbolic links to 'connect' one path to a different location.

Personally I use multiple mount points on a daily basis as Linux is my OS of choice and the only windows I have are the kind that let me see the outside world (raining currently).

I have some drives mounted on multiple paths so I can access my music and audio books drive from ~/audio/ or /home/audio/ rather than having to type out /media/[username]/[drive-label]/. Typing thunar ~/audio to open the file manager is a much quicker way to spawn a GUI window.

Sure, if you only view it from a server admin point of view when only using terminal or SSH, it appears somewhat less than useful, but if you use Linux with a Desktop Environment along with terminal sessions, the advantages do become apparent.

Chris.

Indifference will be the downfall of mankind, but who cares?
Time flies like an arrow, however, fruit flies like a banana.
Webmaster Forum
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top