Chapter 12: Linux disk partitioning and mounting

12.1: Linux partition

  

Check the mounting status of all devices:

​Command: lsblk or lsblk -f

How to add a hard drive:

        ​ 1: Add a hard disk to the virtual machine

        2: Partition

         3: Format

4: Mount

Uninstall: umount [directory] or [file]

5: Settings can be automatically mounted

12.2: Disk status query

Space occupied query

Basic syntax: df -h

Query the disk usage of a specified directory

​Basic syntax: du -h /directory

​ Query the disk usage of the specified directory. The default is the current directory.

        ​ -s: Summary of the space occupied by the specified directory

        ​ -h: with measurement unit

        ​ -a: Include files

        ​ --max-depth=1 subdirectory depth

        -c adds summary values ​​while listing details

12.3: Disk Situation - Using Work Orders

12.4: Partition naming
named character specific meaning
/dev Directory where all device files are stored
hd && sd They are the first two letters of the partition, representing the type of device where the partition is located, where hd represents IDE hard disk and sd represents SCSI hard disk.
a It is the third letter of the partition name, indicating which device the partition is on; /dev/sda represents the first IDE hard disk.
2 This number represents the partition. The first four partitions (primary partition or extended partition) under Linux are represented by numbers 1 to 4, and the logical partitions start from 5, and so on; /dev/sdb6 represents the second logical partition of the second SCSI hard disk. Partition
... ......

Guess you like

Origin blog.csdn.net/weixin_63925896/article/details/132158784
Recommended