Gdisk to fdisk

Time:2020-1-12

During partition test, it is found that after gdisk partition is used, fdisk cannot be used for partition, even if it is formatted. When fdisk is used to view the hard disk, it is found that the hard disk has become a GPT partition and cannot be partitioned through fdisk. Therefore, GPT partition should be deleted through parted

[[email protected] ~]# fdisk -l
Disk /dev/sdb: 999.7 GB, 999653638144 bytes
255 heads, 63 sectors/track, 121534 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000dac36

Device Boot Start End Blocks Id System

Disk /dev/sda: 999.7 GB, 999653638144 bytes
255 heads, 63 sectors/track, 121534 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00048d6c

Device Boot Start End Blocks Id System
/dev/sda1 * 1 1306 10485760 83 Linux
/dev/sda2 1306 3346 16384000 82 Linux swap / Solaris
/dev/sda3 3346 121535 949353472 83 Linux

1. Select SDC to delete GPT partition

[[email protected] ~]# parted /dev/sdc
GNU Parted 2.1
Using /dev/sdc
Welcome to GNU Parted! Type ‘help’ to view a list of commands.
(parted)

2. Create MSDOS partition through mklabel

(parted) mklabel
New disk label type? msdos
Warning: The existing disk label on /dev/sdc will be destroyed and all data on this disk will be lost. Do you want to continue?
Yes/No? Yes
Warning: /dev/sdc contains GPT signatures, indicating that it has a GPT table. However, it does not have a valid fake msdos partition table, as it should. Perhaps it was corrupted — possibly by a program that doesn’t understand
GPT partition tables. Or perhaps you deleted the GPT table, and are now using an msdos partition table. Is this a GPT partition table?
Yes/No? Yes

3. If you view SDC through fdisk again, you will not be prompted for GPT partition