Learning Linux Day 8

1. System Hierarchy Standard (FHS, Filesystem Hierarchy Standard)

           1. Common directory names and corresponding contents in Linux systems

                     /boot Required files for booting-kernel, boot menu and required configuration files, etc.

                    /dev stores any devices and interfaces in the form of files

                   /etc system and various service configuration files

                   /home user home directory

                  /bin stores commands that can also be operated in single-user mode

                  /lib The function library used when booting, and the functions to be called by the commands under /bin and /sbin

                  /sbin Commands needed during boot

                  /media The directory used to mount device files

                  /opt Prevent third-party software

                  /root system administrator's home directory

                 /srv Data file directory of some network services

                 /tmp A "shared" temporary directory that anyone can use

                /proc virtual file system, such as memory, processes, external devices and network status, etc.

                /user/local User-installed software

                /user/sbin Software, commands, scripts that will not be used when the system is stuck

                /user/share Help and documentation, also prevent sharing files

                /var mainly stores frequently changing files, such as logs, databases, and websites

               /lost+found When an error occurs in the file system, some missing file fragments are stored here

              Locate the file method: absolute path and relative path

     2. The naming rules of physical equipment

              Common hardware devices and file names

              IDE device /dev/hd[ad] SCSI/SATA/U disk /dev/sd[ap] floppy drive /dev/fd[0-1] printer /dev/lp[0-15] optical drive /dev/cdrom mouse /dev /mouse tape drive /dev/st0 or /dev/ht0

            Hard disk partition number: The number of primary partition or extended partition starts from 1 and ends at 4. Logical partitions start with number 5.

                                    The third primary partition of the first hard disk recognized by the sda3 system

             The capacity of each sector is 512 bytes, the first sector is the most important, which holds the master boot record and partition table information. In the first sector, the master boot record occupies 446 bytes, the partition table is 64 bytes, and the terminator occupies 2 bytes.

           Ext3, Ext4, XFS system will automatically determine the format of the underlying file system, and then hang or read and write errors.

   3. Mount the hardware device

              The action of associating the device with the directory is called mounting, allowing users to access the contents of the device through the directory.

              Mount file system mount directory needs to enter vim /etc/fstab 

              unmount [mount point/device file]

              It needs to be automatically mounted after restarting. vim /etc/fstab is required to enter and write information in the following format, save and exit.

              Device file Mounting directory Format type Permission option Whether to backup Whether to self-check

              /dev/sdb1  /media/sdb  xfs  defaults  0  0

  4. fdisk: used to manage disk partitions, the format is "fdisk [disk name]"

              Parameters: m view all available parameters; n add a new partition; d delete a partition information; l list all available partition types; t change a partition type; p view partition information; w save and exit; q Exit without saving.

              Commonly used commands: lsblk blkid fdisk -l df -h

image.png


image.png

image.png




  

Guess you like

Origin blog.51cto.com/15047572/2595033