[root@xuexi ~]# gdisk /dev/sdb GPT fdisk (gdisk) version 0.8.10 Partition table scan: MBR: MBR only BSD: not present APM: not present GPT: not present *************************************************************** Found invalid GPT and valid MBR; converting MBR to GPT format in memory. THIS OPERATION IS POTENTIALLY DESTRUCTIVE! Exit by typing 'q' if you don't want to convert your MBR partitions to GPT format! *************************************************************** Command (? for help): p //显示当前磁盘的分区表 Disk /dev/sdb: 4194304 sectors, 2.0 GiB Logical sector size: 512 bytes Disk identifier (GUID): 4E50861F-8360-4B97-986E-51F4080BF678 Partition table holds up to 128 entries First usable sector is 34, last usable sector is 4194270 Partitions will be aligned on 2048-sector boundaries Total free space is 2097085 sectors (1024.0 MiB) Number Start (sector) End (sector) Size Code Name 1 2048 2099199 1024.0 MiB 8300 Linux filesystem Command (? for help): d //删除一个分区 Using 1 Command (? for help): n //新建一个分区 Partition number (1-128, default 1): First sector (34-4194270, default = 2048) or {+-}size{KMGTP}: //开始扇区 Last sector (2048-4194270, default = 4194270) or {+-}size{KMGTP}: +1G //终止扇区 Current type is 'Linux filesystem' Hex code or GUID (L to show codes, Enter = 8300): //分区类型 Changed type of partition to 'Linux filesystem' Command (? for help): w //保存并退出 Final checks complete. About to write GPT data. THIS WILL OVERWRITE EXISTING PARTITIONS!! Do you want to proceed? (Y/N): y //确认覆盖 OK; writing new GUID partition table (GPT) to /dev/sdb. Warning: The kernel is still using the old partition table. The new table will be used at the next reboot. //提示在下次重启后生效 The operation has completed successfully. |