Thursday, March 22, 2018

linux - What is the difference between Filesystem(device location) and Mounted point? both seems to be directory


What is the difference between Filesystem(device location) and Mounted point?
Both seems to be directory.


Where does actual data/files of the mounted device reside? in filesystem or mount point?


What is the use of mount point if actual data lives in Filesystem?


#df
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/xvda1 8256952 970228 7202856 12% /
tmpfs 308520 0 308520 0% /dev/shm

Answer



A (physical) file system is a disk or partition, formatted in a certain way, and containing data structures comprising directories and files.


Every physical file system has a root directory indicated as / in Linux.


Now this structure maps to a logical view. A simple logical view maps one physical file system one-on-one to your logical file system. This is called 'mounting a file system'.


You can mount a physical file system (or part of it) to a different logical node, called a 'mount point'. This means, your physical file system root / can be mounted to your logical "directory" /my/logical/mount.
If your physical file system contains a file rootfile in its physical root directory, you may access exactly that file by its logical name /my/logical/mount/rootfile.


The physical location is still on the physical file system, your access through the "mount point" is just a logical link to access that data.


Mount are useful for organizing various file systems, for combining several disks/partitions into one logical structure, and to combine various disparate devices and views into the same structure, from disks, partitions, USB sticks, floppy drives, remote network drives and even terminals, all logically residing under your logical root /.


No comments:

Post a Comment

hard drive - Leaving bad sectors in unformatted partition?

Laptop was acting really weird, and copy and seek times were really slow, so I decided to scan the hard drive surface. I have a couple hundr...