Detailed operation of Linux fdisk command

>>> Linux tutorial directory <<<

File system management-3.1fdisk command partition process

Write in the front: If you finish the inspection by yourself, there may be some mistakes. If you find something wrong, you can leave a message or private message me below.

1. Add a new hard drive

2. View the new hard drive

  • fdisk -l

3. Use the fdisk command to partition

  • fdisk / dev / sdb (not partitioned yet, all without number numbers)
  • w Save and exit

4. Re-read the partition table information

  • partprobe

5. Format the partition

  • mkfs -t ext4 /dev/sdb/

6. Establish mount point and mount

  • mkdir /disk1
  • mount /dev/sdb1 /disk1

Note: Manually use the command to mount and restart it will be invalid, the next section will talk about how to achieve automatic mounting

7. Description of fdisk interactive commands (stars are commonly used)

command Explanation
a Set bootable label
b Edit bsd disk label
c Set DOS operating system compatibility flag
⭐d Delete a partition
⭐l Displays the known file system type, 82 is Linxu swap partition, 83 is Linux partition
⭐m Show help menu
⭐n New partition
O Create a blank DOS partition table
⭐p Show partition list
⭐q Exit without saving
s New blank SUN disk label
⭐t Change the system ID of a partition
in Change the display record unit
v Verify partition table
⭐w Save and exit
x Additional features (experts only)

Write in the back: I hope these explanations will be helpful to you, I hope everyone will like and pay attention to it. Your support is my biggest motivation (๑> ؂ <๑)

Published 366 original articles · praised 68 · 50,000+ views

Guess you like

Origin blog.csdn.net/qq_43479432/article/details/105655618