05.Linux File System

Original link: http://www.cnblogs.com/zkw-2014/p/4417747.html

 ◊ basic framework:

a) What is a file system

b) File Type

c)         Mount 与 umount

d) soft and hard-wired connection

 

1.  What is the file system

       File system: disk method to organize your files, such as NTFS under windows, FAT

                                                system V under LINUX, ext2, ext3

       After the buy back of the hard drive to partition and format to use, hard disk partition information stored in the hard disk 0 track 0 sector, another hard disk usage information and management information is also stored on the hard disk.      

   Linux system is a file system for each partition.

       Linux system in a partition following the path does not necessarily belong to the partition, a partition because this path can mount other partitions (file system).

   ♦ Linux system directory structure:

              / Etc: Configuration Files

              / Sbin: System Manager

              / Dev: device file

              / Bin: common commands

              / Boot: the use of startup files

              / Lib: shared dynamic link library

              / Root: the user's home directory

              / Home: each user's home directory

              / Usr: storage applications, / usr / lib (library) / usr / include (header file)

2,  File Type:

  1) Ordinary file: (-) into text and binary files

  2) catalog file: (d)

  3) Device file: generally stored in the / dev directory

                         / Dev / tty1 (c) character device file

                        / Dev / sda1 (b) block device file

  4) Soft connection file: start with l, back to "->" pointing to the attached file

3、  mount umount  

   If you want to use a file system, you must first mount the file system

   1) Mount + name + path device:

              The device name can be viewed with the fdisk -l

              Path is typically mounted to / mnt /

   2) Umount + device name / path mount point: Uninstall

   3) zoning status of the Linux operating system:

                 • boot partition

        • The root partition

           • The system's temporary swap file system (tmpfs), for the use of memory, the equivalent of virtual memory

                               Features: When the system is turned off, there is the area of ​​the file will disappear, but its access speed is faster

   Fdisk -l to view the current status of partition

   Df -h to see mount point of each partition

4,  soft connection with hard-wired

     Every file on the hard disk should have a inode to record the management information file, a partition there are many files (stored in the file data area), there are many indexing node (stored in the inode area), each index node there is a inode number ( also called do i node number ), the inode number is stored in an array ( inode number array ).

     By file name, you can find the inode number to find the inode, and finally found the appropriate files.

1 ) hard-wired : the directory itself is a file, directory to store many files on the file name and inode number, file name and index of each node is known as a hard link

    Ln: Creating a connection

    Inode number Ls -i (inode) to view the file / directory

2) flexible connection (also called symbolic link)

          Soft connection can be established across partitions, but not hard-wired.

          Ln -s to create a soft link

         Opens a file with the soft link ls indirect way open, but is hard-wired directly to open the file corresponding to the i-node number.

3) soft and hard-wired connection differences :

         Open indirectly characteristics: efficiency is lower than directly open some, but it can be across partitions created.

 

Reproduced in: https: //www.cnblogs.com/zkw-2014/p/4417747.html

Guess you like

Origin blog.csdn.net/weixin_30698297/article/details/94797223