2

Let's say we run df command to show something about file system in my CentOS.

enter image description here

I can see a LVM /dev/mapper/vg_centos64-lv_root mount to /. or a partition /dev/sda1 mount to /boot, and a device CDROM /dev/sr0 mount to media/CentOS_6.5_Final.

And I can see them(filesystem) in the Nautilus. They either looks like a file or directory. Please looks below.

enter image description here enter image description here

For my point of view. It is really confused that blending all the things(I mean the thing like partition sda1 and the things like device sr0) into the filesystem. And what the Mount doing looks like pointing a "file" to another "directory". So It really looks like that the same thing has 2 addresses to be accessed. Why does the Linux file system design like this? And Please correct me if there is something wrong with what I thought. Thanks.

I Also want to know Whether I should access from the file system or Mount point if I want? Because both are pointing to the same things.

  • See also unix.stackexchange.com/questions/3192/… – Gilles Jun 29 '16 at 22:27
  • @Gilles Yes, I have not too much problem to understand the answer you shared with me, except one thing. for the command mount /dev/cdrom /media/cdrom. the previous device /dev/cdrom just looks exactly the same with the mount point /media/cdrom. They are both a directory or file in the linux. as I can found them in the file explorer. So how can I recognize from each other ? Let's say there is a directory or file like /dev/xxxx . Is that a device or mount point ? Any document say about this convention? Thanks. – Joe.wang Jun 30 '16 at 1:22
  • /dev/xxx is a device. It is a special file that represents some hardware (or more generally something managed by the kernel). A mount point is a directory. Using the same name for the directory and for the device is a simple way to make it clear what device is accessed through the directory. – Gilles Jun 30 '16 at 5:32
1

In Unix everything is a file.

These files are organized in a tree structure, beginning at the root /.

Your filesystem or filesystems will then be mounted at the appropriate places in your / according your /etc/fstab file. This file contains information about your filesystems, which device they belong to and to which point they will get mounted to - the mountpoint.

Thats the "mount concept".

It is not limited to disks and other blockdevices, here are some examples involving mount:

- Mount a representation of your running kernel under /proc
- Mount a special log partition (other device, "logfriendly" filesystem) under /var/log
- Install different systems and mount just one home directory
- Mount remote directories for example via NFS to your system
- Mount a image of a cd to a specific directory

More about this topic you can find at the following url: - http://ultra.pr.erau.edu/~jaffem/tutorial/file_system_basics.htm

  • I think to mount an address to another address looks weird. How can I recognize which one is a block device, which one is a mount point? – Joe.wang Jun 29 '16 at 9:39
  • Is there convention about to recognize which is something different from mount point? – Joe.wang Jun 29 '16 at 10:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.