Visit Jeremy's Blog.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 04-25-2014, 05:04 PM   #1
Registered: Aug 2012
Posts: 709

Rep: Reputation: Disabled
Understanding mount and filesystems

Just trying to better understand filesystems.

What if I had a device mounted on /someDevice. I then create a directory /someDevice/someDirectory, and put some files in it.

Then I mounted a second device on /someDevice/someDirectory, and put some files in that directory.

The original files in /someDevice are still on the machine. Are they available when the second device is mounted over it? What are the implications for doing so?
Old 04-25-2014, 05:10 PM   #2
LQ Guru
Registered: Feb 2003
Location: Blue Ridge Mountain
Distribution: Linux Mint 17, Debian 8
Posts: 7,863

Rep: Reputation: 311Reputation: 311Reputation: 311Reputation: 311
A directory cannot show both files in that directory and also be a mount point for another file system. When you use a directory as a mount point the files in that directory disappear. Then when you umount that file system the files reappear. To lessen the confusion it is best to use empty directories as mount points.

Steve Stites
Old 04-25-2014, 05:27 PM   #3
Registered: Aug 2012
Posts: 709

Original Poster
Rep: Reputation: Disabled
Thanks jailbait (I mean Steve!),

What do you mean by "disappear"? Yes, that is exactly what it appears to do, but just trying to get my head around what is happening. Does it go into limboland where it could be mounted again to another place?

On second thought, maybe "disappear" is good enough for me.
Old 04-25-2014, 05:38 PM   #4
Senior Member
Registered: Aug 2009
Distribution: CentOS
Posts: 3,514

Rep: Reputation: 1545Reputation: 1545Reputation: 1545Reputation: 1545Reputation: 1545Reputation: 1545Reputation: 1545Reputation: 1545Reputation: 1545Reputation: 1545Reputation: 1545
They are temporarily hidden under that second mounted filesystem. As soon as that filesystem is unmounted, they will reappear.

There is a way to access them even while that second filesystem is still mounted. Take a look at the manpage for the mount command and scroll down to the section, "The bind mounts." If, while both filesystems are mounted, you do
mount --bind /someDevice /mnt/tmp
you will then find that /mnt/tmp/SomeDirectory contains the contents that were there before the second mount.

Last edited by rknichols; 04-25-2014 at 05:41 PM.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Understanding Linux Filesystems onebuck Linux - General 6 07-01-2012 07:25 AM
Where to mount partitions of other filesystems SwissHeritage Linux - General 2 04-05-2009 06:24 AM
Looking for help understanding filesystems and permissions brockangelo Linux - Server 1 03-15-2009 12:36 PM
Understanding filesystems veeruk101 Linux - Newbie 2 11-30-2007 02:29 AM
Can't mount ufs filesystems ratman96 Linux - General 2 05-04-2005 12:34 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 02:23 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration