LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices


Reply
  Search this Thread
Old 04-25-2014, 05:04 PM   #1
NotionCommotion
Member
 
Registered: Aug 2012
Posts: 568

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
jailbait
LQ Guru
 
Registered: Feb 2003
Location: Blue Ridge Mountain
Distribution: Linux Mint 17, Linux Mint 18
Posts: 7,809

Rep: Reputation: 294Reputation: 294Reputation: 294
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
NotionCommotion
Member
 
Registered: Aug 2012
Posts: 568

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
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: CentOS
Posts: 3,241

Rep: Reputation: 1403Reputation: 1403Reputation: 1403Reputation: 1403Reputation: 1403Reputation: 1403Reputation: 1403Reputation: 1403Reputation: 1403Reputation: 1403
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
Code:
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.
 
  


Reply


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


All times are GMT -5. The time now is 10:17 PM.

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