Let's say I run the df
command to show something about the file system(s)
in my CentOS.
# df
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/mapper/vg_centos64-lv_root 47114616 3524484 41196840 8% /
tmpfs 1954400 232 1954168 1% /dev/shm
/dev/sda1 495844 39901 430343 9% /boot
/dev/sr0 4363088 4363088 0 100% /media/CentOS_6.5_Final
#
[Transcribed from this screenshot image.]
I can see a LVM /dev/mapper/vg_centos64-lv_root
mounted to /
,
a partition /dev/sda1
mounted to /boot
,
and a CDROM device /dev/sr0
mounted to /media/CentOS_6.5_Final
.
And I can see them (filesystems) in Nautilus. They look like either a file or a directory. Please see below:
From my point of view, it is really confusing 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
is doing looks like pointing a "file" to another "directory".
So it really looks like that the same thing has two addresses to be accessed.
Why is the Linux file system designed like this?
Please correct me if there is something wrong with what I thought.
I also want to know whether I should access from the file system or the mount point if I want, because both are pointing to the same thing.
mount /dev/cdrom /media/cdrom
. the previous device/dev/cdrom
just looks exactly the same with the mount point/media/cdrom
. They are both adirectory
orfile
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 01: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 'SO- stop being evil' Jun 30 '16 at 05:32