Results 1 to 8 of 8
Hey there
I unmounted a partition /home from my system. Went into the /home/ and created a dir ( I supposed that it will give me some wierd error but ...
- 05-13-2009 #1
where are the file created on an umounted partition
Hey there
I unmounted a partition /home from my system. Went into the /home/ and created a dir ( I supposed that it will give me some wierd error but it didn't) xyz.
Now i can work with xyz like a normal directory but when i remount the /home this directory disappears. Again on unmounting and accessing the /home dir i see the xyz residing like making me look like a fool. I cant figure out where it went and form where it came back???Only if I could understand the man pages
Registered Linux user #492640
OS: RHEL4,5 ,RH 9,Ubuntu
- 05-13-2009 #2
When you mount any partition, its mount point ( folder ) act as access point of that partition and whenever you create any thing there, it is created in actual partition only.
When you unmount partition, its mount point (folder) act as a simple folder under filesystem only.
xyz dir has been created in folder /home but when you mount partition in the same folder, it act as access route to the partition. xyz is still there but not visible because you have connected its parent folder (/home) to another location, i.e. partition.It is amazing what you can accomplish if you do not care who gets the credit.
New Users: Read This First
- 05-13-2009 #3
Then were is xyz
Ok you cleared my concepts but where is xyz folder when /home is mounted??
Only if I could understand the man pages
Registered Linux user #492640
OS: RHEL4,5 ,RH 9,Ubuntu
- 05-14-2009 #4Linux Guru
- Join Date
- Nov 2007
- Location
- Córdoba (Spain)
- Posts
- 1,513
It's still there in whatever partition that the /home directory (mind I said "directory", not "partition") was created. Usually that's the partition that's mounted on /
But you can't reach these files unless you umount /home. Mount points are not different of any other directory, they are not special in any way. You could create a directory in your home to store games, for example:
Then you store games inside that directory. Now for some weird reason you decide to mount your usb pendrive into /home/i92guboj/games. While it's mounted you will see the contents of the pendrive under /home/i92guboj/games. As soon as you umount that directory the games will still be there, in whatever partition your home directory resides. You can use any arbitrary directory as a mount point at any given moment.Code:mkdir /home/i92guboj/games
Of course it wouldn't be good to mount your photo cam under /bin, because then everything under /bin will not be reachable until you umount /bin. But guess what, the "umount" command itself lives under /bin so you couldn't reach it either
- 05-29-2009 #5
OK got the concept
Ok mounting is like an access point , the place you mount it , form there you can access it. But if you mount on to something will already contains something , it gets over written and cant be accessed till the time you unmount it again. This also means that a partition can be mounted on as many different locations as wanted without any problem. But I'm confused as in , If I create a file in an unmounted partition for ex /home ( which has been unmounted) then where does the file gets stored and on which partition????

------------------------------------------------------------------------------------------------------------------------------------
Also I tried to find the file I created on the umounted partition but it failed when the partition was mounted( as searching when the partition was unmounted would easily get me the file location).
-------------------------------------------------------------------------------------------------------------------------------------
SO does this mean that when I mount on an access point the files present inside the access point become hidden????Only if I could understand the man pages
Registered Linux user #492640
OS: RHEL4,5 ,RH 9,Ubuntu
- 05-29-2009 #6Linux Guru
- Join Date
- Nov 2007
- Location
- Córdoba (Spain)
- Posts
- 1,513
In whatever partition contains the /home directory. That will be usually whatever is mounted in /. The file will be stored inside a directory that lives in the / partition. And it will not be accessible if you mount something at /home/
What I said above. When you store things into a directory which is not mounted, the file is stored in the partition where the directory lives. When you mount another partition into that directory the contents of the directory is not magically merged into the newly mounted partition. That would create an authentic mess.Also I tried to find the file I created on the umounted partition but it failed when the partition was mounted( as searching when the partition was unmounted would easily get me the file location).
Yes.SO does this mean that when I mount on an access point the files present inside the access point become hidden????
- 05-29-2009 #7
The info posted above is true ... but the file is still there and you can actually access it as well if you ln to it before the mount
. Example you can try ...
create a folder to put a file in
then create a text file in itCode:sudo mkdir /media/mytest
now check you can access the fileCode:sudo echo "This is a test file for mount" > /media/mytest/test-file1 sudo chown your_regular_user_name /media/mytest/test-file1 cd ln /media/mytest/test-file1 my-link1
Now mount a partition to the /media/mytest folder ... in my case hda5 (but any partition will do)Code:cat ~/my-link1
nowCode:sudo mount /dev/hda5 /media/mytest -o ro
you should get the contents of the mounted partition andCode:ls /media/mytest -l
should return no such file or directory ...Code:cat /media/mytest/test-file1
now try
and it should return the file contentsCode:cat ~/my-link1
- 05-30-2009 #8


Reply With Quote
