Linux-disk management summary, linux-disk Summary
This blog article mainly summarizes some Linux disk operations, including hard disk loading, partitioning (MBR and GPT partitions), partition mounting, and swap partition loading settings.
Basic commands
- Df view disk partition usage
- Du: measure the file size on the disk.
- Common commands
Considerations when reviewing disk partitions:
- The total number of primary and extended partitions cannot exceed 4.
- Up to one extended partition can be created.
- Extended partitions cannot directly access data
TIPS:
- In Linux, hardware devices are stored in the Dev directory under the root directory as files.
- Hardware devices are automatically identified by the Linux system.
- The new hard disk must be partitioned, formatted, and mounted before it can be used.
- MBR partition mode: the maximum size of a single partition is 2 TB.
- GPT partition mode: the number of Primary partitions is "almost" unlimited, and the capacity of a single partition is "almost" Unlimited. In a GPT partition, a maximum of 128 primary partitions are supported, and the size of each partition exceeds the 2 TB limit of the MBR partition. The maximum value is 18EB = 18432PB = 18874368 TB. The disadvantage is that the primary partition of GPT is not suitable for systems with X86 architecture.
What should I do when hard disk space is exhausted?
A good practice should be: Add a new hard disk to the server on the basis of retaining the original hard disk.
Add a hard disk to a VM