×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

mounting a filesystem multiple times - what sense?

mounting a filesystem multiple times - what sense?

mounting a filesystem multiple times - what sense?

(OP)

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 

RE: mounting a filesystem multiple times - what sense?

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

RE: mounting a filesystem multiple times - what sense?

Hi

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

w5000, I would say no, it would be insecure 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.

Feherke.
feherke.ga

RE: mounting a filesystem multiple times - what sense?

Quote:

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

RE: mounting a filesystem multiple times - what sense?

(OP)

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

RE: mounting a filesystem multiple times - what sense?

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

RE: mounting a filesystem multiple times - what sense?

(OP)

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?

RE: mounting a filesystem multiple times - what sense?

But "what you see" is not indicative of what anyone else necessarily 'sees' as being useful.

Quote:

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

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login


Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close