Does umount command hides all the data in a partition ?
Hi,
pls help me as i have a conceptual problem regarding the umount command. Suppose i have a partition /dev/sda5 which has been mounted to /home. Now /dev/sda5 is the physical partition and /home is the logical partition.So the data that we see in /home actually resides on /dev/sda5.Now if i give a ommand like #umount /dev/sda5 that would imply that /home would be empty. But in my machine even aftr isuing this command i cab still see some contents in /home. How ? Secondly if /usr is formatted will the machine run all the applications after rstarting ? |
There is no such thing physical partition and logical partition. Only a disk partition, which could be primary or extended. (well, trehre is but in another context - LVM - which is not the case)
/dev/sda5 is a partition and /home is a mount point for /dev/sda5. You can mount /dev/sda5 over any directory on the filesystem. The contents in that directory becomes "invisible" and you can only see the data that comes from the mounted partition. As soon you umount it, the original data in that directory is visible again. The data you have in the mount point /home is result of some mistake you may have done before, like creating files, or starting a window manager without mounting /dev/sda5 first. It will be there forever until you remove it. If you do, make sure this time, the /dev/sda5 is not mounted otherwise you will remove the data from /dev/sda5 not from the underlying /home directory ! Quote:
cheers, |
Quote:
Quote:
Quote:
|
Hi,
Thanks for your reply.i have almost got it. But still i have one more point to clear. Suppose i have unmounted /dev/sda5 . In that case the contents of /dev/sda5 would now be no longer visible in /home.If now at this juncture i create some files in /home where would be the files be saved ? Not in /dev/sda5 for sure ..... So is it going to be saved in / ? Pls Help |
No, it's saved in the directory '/home' which is a subdirectory of '/'
|
This may help:
1. All files and directories are stored in partitions--ie somewhere on a physical disk. 2. Partitions are mounted to the master directory tree. Instead of "mounted", read "attached"--may make it easier to follow. In the simplest possible system, there is ONE partition mounted at /. This partition contains all of the sub-directories to /. If it were possible to unmount it without stopping the system, you would see **nothing** in the directory tree. (The reason, of course, that the system would crash is that IT would see nothing...) 3. When you mount a partition, you overlay its structure on top of whatever was associated with the mount point---thus all the files that you saw there now **appear** to be replaced by the newly mounted partition's structure. The old files and subdirectories are still there--they are just hidden. They are safe because you cannot access them to erase or modify. They could, however, also be safe from you ever finding them......;) 4. Based on the above, mounting a partition to anything but an empty directory can cause more confusion than most of us can deal with. Save yourself the grief and don't do it.....;) |
Hi,
Thanks all for your help |
All times are GMT -5. The time now is 05:59 AM. |