Practice four-disk partition management
-
- 1. Add a new SCSL hard disk to the virtual machine with a capacity of 2G
- 2. After starting the system, use the lsblk command with the -p option to view the type of the current disk and partition table to determine the partition management tool (fdisk, or gdisk)
- 3. Use the parted command to view the disk partition table type (MBR, or GPT), according to
- 4. Use the fdisk tool to add partitions to the current disk of the system. Enter the fdisk interactive working mode and complete the following operations in sequence:
- 5. Use the partprobe command to read the disk partition table
- 6. Use the lsblk and parted commands again to view the disk and partition information of the system
- 7. Continue to add two new partitions, and use the "+sector" and "+size" formats to specify the size of the new partition respectively
- 8. Use the fdisk tool to delete one of the newly created partitions and view the results
- All operations are complete, click like!
1. Add a new SCSL hard disk to the virtual machine with a capacity of 2G
(1) Open and edit the virtual machine settings in the virtual machine
(2) Click Add
(3), click Hard Disk, and keep pressing Next to edit the maximum disk size as 2GB
2. After starting the system, use the lsblk command with the -p option to view the type of the current disk and partition table to determine the partition management tool (fdisk, or gdisk)
(1) Enter the command lsblk -p to view the partition status
3. Use the parted command to view the disk partition table type (MBR, or GPT), according to
(1) Enter the command parted /dev/sdb p
(2) Here the partition table type shows unknown , because the new hard disk has not been partitioned yet, so the management tool is used casually, here we use the management tool fdisk
4. Use the fdisk tool to add partitions to the current disk of the system. Enter the fdisk interactive working mode and complete the following operations in sequence:
(1) Enter the command fdisk /dev/sdb to enter the interactive working mode, enter the command m
(2), enter the command p
(3), enter the command n , enter p, here we use the system default as the starting sector number, directly Press Enter to default to 1 , and continue to press Enter to start by default, and then enter 1400000 (any number is acceptable, as long as it does not exceed the maximum) and press Enter.
(4). Enter w and save. If you are not like the following after entering w, please enter q
5. Use the partprobe command to read the disk partition table
(1) Enter the command partprobe /dev/sdb1 , and there is no display after entering the command , indicating that the operation is successful
6. Use the lsblk and parted commands again to view the disk and partition information of the system
(1) Enter the command lsblk /dev/sdb -p and press enter; enter the command parted /dev/sdb p and press enter
7. Continue to add two new partitions, and use the "+sector" and "+size" formats to specify the size of the new partition respectively
(1) Same as above, look at the picture, + sector we also use +1400000
(2), use size to add the third partition, we specify 500MB
8. Use the fdisk tool to delete one of the newly created partitions and view the results
(1) Enter the command fdisk /dev/sdb , enter d and press Enter, we delete the first partition, so enter the number 1 , enter w (save and exit), and then enter lsblk /dev/sdb