LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 03-23-2008, 10:33 AM   #1
goosygeek
LQ Newbie
 
Registered: Dec 2007
Posts: 3

Rep: Reputation: 0
Question Doubt abt the files on mountpoint!!!


Hi Guys,

This questions may sound dump or familiar, but plz clear my doubt. This is my question!


I have a directory named /dir1 which contains some files and folders. And using the mount command if I mount a filesystem on /dir1. The contents on that folders where not displayed. But once if I umount the filesystem. The folders and files are visible again. and my questions, why these files wheren't displayed when /dir1 is used as a mountpoint. Plz clear my doubt and make me understand unix in detail.



With Hopes,
Vimal.
 
Old 03-23-2008, 11:04 AM   #2
bigrigdriver
LQ Addict
 
Registered: Jul 2002
Location: East Centra Illinois, USA
Distribution: Debian stable
Posts: 5,908

Rep: Reputation: 356Reputation: 356Reputation: 356Reputation: 356
Take two pages of paper; one written page and one blank page. Place the blank page over the written page and you can't see the words on the written page.

The same thing happens when you put files in a directory, then use that directory as the mount point for another source of files. The mounted filespace covers the directory in which you placed the files, and you won't see them again until you unmount the covering filespace.
 
Old 03-23-2008, 11:06 AM   #3
David the H.
Bash Guru
 
Registered: Jun 2004
Location: Osaka, Japan
Distribution: Arch + Xfce
Posts: 6,852

Rep: Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037
It's normal. The mounted filesystem always overrides the original contents of the directory. Unless you have some special merging system you can only access one block device at a time at a single location.
 
Old 03-24-2008, 08:20 AM   #4
goosygeek
LQ Newbie
 
Registered: Dec 2007
Posts: 3

Original Poster
Rep: Reputation: 0
Thanks a lot for all those answers. But my doubt still remains uncleared. Let me put my question this way.

The contents of a directory would be inodenumber=filename/inodenumber=directoryname. So when I mount a filesystem what happens to this info's??? ( where are they stored ). It must be stored somewhere bcz, when we unmount the other filesystem. The old contents of that directory is visible.

Thanks in Advance,

Vimal
 
Old 03-24-2008, 08:37 AM   #5
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809

Rep: Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743
This is easy--once you understand it.....

Filesystems, inodes, etc. live on partitions--sections of the physical disk. The directory tree establishes a system for sorting things into specific directories (regardless of what partitions are involved)

In the simplest system, one partition is mounted at "/" (AKA the root of the directory tree). This partition will have entries for all the nodes (eg /home, /bin, /usr, etc....). The mounting of this one partition is specified as part of the boot process.\

Think of "mounting" as connecting a partition to the directory tree. Starting with the above example using only one partition, you can mount (connect) partitions anywhere else on the tree. When you do that, the system sees the content of the newly mounted partition, and not what was there previously. The analogy provided earlier is a good one--adding a sheet of paper hides the earlier content. When the sheet is removed the other content is still there.

Note that you can have multiple partitions (sheets of paper) at one mount point--only the last one mounted (the top of the pile) is visible. You cannot however mount a partition at two different mountpoints--this would create ambiguity (something computers do not handle well)
 
  


Reply

Tags
mountpoint


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Linux Newbie: doubt regarding program files amit_chandak Linux - Newbie 5 03-04-2006 03:57 PM
Mountpoint cthomas Linux - Networking 1 02-23-2006 02:28 PM
doubt abt vi editor ss100 Linux - Software 6 12-11-2004 05:56 PM
Can Anybody tell me abt tar files in linux takola LinuxQuestions.org Member Intro 3 05-06-2004 01:59 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 12:56 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
Open Source Consulting | Domain Registration