LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 09-16-2008, 08:56 PM   #1
silverbird
LQ Newbie
 
Registered: Jun 2008
Location: Philippines
Distribution: Slackware
Posts: 24

Rep: Reputation: 0
How does mount work?


I have created a data partition which I wish to share with other users. To achieve this I create a 'dummy' directory and then mount the partition directories to the newly created directory.

For example I have /home/shared/serverA directory and I then mount directories in another partition into that directory.

What happens to the directory I created? Suppose before I mount the new partition there are files in the serverA directory. These files are not overwritten, so are they just hidden somehow? Does mounting change a pointer in the linux file system to point to the new partition?

I am curious. It seems that you almost need to be able to create virtual directories that can then be used as mount points for other resources.
 
Old 09-16-2008, 09:10 PM   #2
BrianK
Senior Member
 
Registered: Mar 2002
Location: Los Angeles, CA
Distribution: Debian, Ubuntu
Posts: 1,334

Rep: Reputation: 51
To be honest, I don't know the exact details on how mount works, but the files that you speak of - the ones that are present in a directory before you mount... they still exist, their parent directory just points somewhere new now, so there's no way to get to them. As soon as you unmount, their parent directory no longer points elsewhere, therefore, you can get to them again. Remember, directories are just special files, so mounting to a directory is kinda like modifying a file so that it does *something else* when you ask for its data.

anecdote: At one company for which I did some work, I had a RAID array that mounted to /job. If the array didn't mount, /job just pointed to the system disk, so I put some files on the system disk in /job that contained instructions on how to remount the array. /job was an nfs export, so if someone went looking for raid data via /job & the raid wasn't mounted, they would have instructions on how to get the RAID back. Once the RAID was remounted, the instructions would magically disappear.
 
  


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
mount cdrom does not work kookie Slackware 7 11-17-2006 07:58 AM
mount from smbfstab does not work Henric Linux - Networking 0 12-27-2004 10:02 AM
Auto mount doesn't work!! alirezan1 Linux - Newbie 3 12-19-2004 08:59 PM
my mount won't work brian183 Debian 11 10-06-2004 04:52 PM
SAMBA: one mount won't work where others will insectile Linux - Networking 1 05-14-2004 04:44 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 01:44 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