1. View all disk information on the server
fdisk -l
2. Delete the partition
fdisk /dev/sdc
d
# 输入要删除的分区id号,我这只有1个分区,所以自动删除了partition 1
w
3. Change the disk partition table type
3.1 Introduction to disk partition types
- gpt
- of the
- FAT
parted /dev/sdc
# mklabel gpt或者mktable gpt
mktable gpt
4. Convert the disk to a raw disk or a brand new disk (delete all information such as disk signature, partition table, etc.)
4.1 Raw disk introduction
Execute the command on the raw disk: fdisk /dev/sdd
, this command will automatically set the disklabel and disk identifier for the raw disk , which will write the signature information to the disk .
The disk is no longer clean and is not a raw disk. Enter p
to view the disk information, and found that there are indeed more disklabels and disk identifiers
, but this is only temporarily written, directly enter and q
exit, and use fdisk -l
View to find that /dev/sdd is still a raw disk.
But if you enter the command w
, the signature information will actually be written and it will automatically exit. If you fdisk -l
check it, you will find that /dev/sdd is not a raw disk.
There are really more disk information, disklabel and disk identifier.
4.2 Turn into a raw disk
wipefs -a -f /dev/sdd
If you fdisk -l
check it, you will find that /dev/sdd is a raw disk again.
Reference article: wipefs, dd and clearpart clear partitions