You are not logged in.

#1 2013-07-10 10:51:54

baldzhang
Member
Registered: 2004-04-10
Posts: 10

mount a device twice, is this safe ?

recently do a test

mount /dev/sda5 /mnt/1
mount /dev/sda5 /mnt/2

of course at the first time, the contents in each directory is same, after

touch /mnt/1/testfile

this file is appear in /mnt/2 also, then

rm /mnt/2/testfile

this file is disappear from /mnt/1

i *think* this is the same effort of

mount --bind /mnt/1 /mnt/2

but *not* sure. already googled this, but no clear answer found.

did any body know this?

Offline

#2 2013-07-10 11:25:22

falconindy
Developer
From: New York, USA
Registered: 2009-10-22
Posts: 4,111
Website

Re: mount a device twice, is this safe ?

Yes, they're the same. Yes, its a fine thing to do.

Offline

#3 2013-07-10 13:22:24

x33a
Forum Fellow
Registered: 2009-08-15
Posts: 4,587

Re: mount a device twice, is this safe ?

So bind is implied? What is the benefit of explicitly using --bind?

ps: @ baldzhang, you have a post ratio of approx. 1 post/yr !! That's like the opposite of karol tongue

Offline

#4 2013-07-10 13:41:25

WorMzy
Forum Moderator
From: Scotland
Registered: 2010-06-16
Posts: 11,011
Website

Re: mount a device twice, is this safe ?

What is the benefit of explicitly using --bind?

--bind can be used to mount a specific subdirectory elsewhere, rather than just mounting the root directory in multiple places.

--bind also seems to be necessary for FUSE filesystems. At least, NTFS refuses to be 'mount'ed in two places simultaneously, you have to --bind the mount point to another mount point.


Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD

Making lemonade from lemons since 2015.

Offline

#5 2013-07-10 14:48:08

baldzhang
Member
Registered: 2004-04-10
Posts: 10

Re: mount a device twice, is this safe ?

thank you all, i learned more big_smile

emmm... i have a *little* busy for almost 10 years..., but i love Arch and test/use it from version 0.1 cool

Offline

Board footer

Powered by FluxBB