龙空技术网

磁盘管理-4-gpt

我是老菜鸟 255

前言:

而今你们对“centos查看gpt分区”大致比较关怀,小伙伴们都想要了解一些“centos查看gpt分区”的相关文章。那么小编在网络上汇集了一些对于“centos查看gpt分区””的相关内容,希望小伙伴们能喜欢,咱们快快来学习一下吧!

linux磁盘管理-逻辑卷一、GPT磁盘管理

GPT分区工具:fdisk gdisk

gdisk分区

GPT  128个主分区[root@localhost ~]# gdisk -l /dev/sdc[root@localhost ~]# gdisk -l /dev/sdc   查看sdc信息GPT fdisk (gdisk) version 1.0.3Partition table scan:  MBR: MBR only  BSD: not present  APM: not present  GPT: not present          ###GPT分区无法使用***************************************************************Found invalid GPT and valid MBR; converting MBR to GPT formatin memory. ***************************************************************Disk /dev/sdc: 41943040 sectors, 20.0 GiBModel: VMware Virtual SSector size (logical/physical): 512/512 bytesDisk identifier (GUID): B228357D-34EC-4E47-BB81-A7312F3BCF8DPartition table holds up to 128 entriesMain partition table begins at sector 2 and ends at sector 33First usable sector is 34, last usable sector is 41943006Partitions will be aligned on 2048-sector boundariesTotal free space is 37748669 sectors (18.0 GiB)Number  Start (sector)    End (sector)  Size       Code  Name   1            2048         2099199   1024.0 MiB  8300  Linux filesystem   2         2099200         4196351   1024.0 MiB  8300  Linux filesystem将MBR转换成GPT分区[root@localhost ~]# gdisk /dev/sdcGPT fdisk (gdisk) version 1.0.3Partition table scan:  MBR: MBR only  BSD: not present  APM: not present  GPT: not present***************************************************************Found invalid GPT and valid MBR; converting MBR to GPT formatin memory. THIS OPERATION IS POTENTIALLY DESTRUCTIVE! Exit bytyping 'q' if you don't want to convert your MBR partitionsto GPT format!***************************************************************Command (? for help): oThis option deletes all partitions and creates a new protective MBR.Proceed? (Y/N): yCommand (? for help): wFinal checks complete. About to write GPT data. THIS WILL OVERWRITE EXISTINGPARTITIONS!!Do you want to proceed? (Y/N): yOK; writing new GUID partition table (GPT) to /dev/sdc.The operation has completed successfully.[root@localhost ~]# gdisk -l /dev/sdcGPT fdisk (gdisk) version 1.0.3Partition table scan:  MBR: protective  BSD: not present  APM: not present  GPT: present          ###GPT可用了Found valid GPT with protective MBR; using GPT.Disk /dev/sdc: 41943040 sectors, 20.0 GiBModel: VMware Virtual SSector size (logical/physical): 512/512 bytesDisk identifier (GUID): 7CA4232A-4A9E-467D-AADD-BB84DB2126E3Partition table holds up to 128 entriesMain partition table begins at sector 2 and ends at sector 33First usable sector is 34, last usable sector is 41943006Partitions will be aligned on 2048-sector boundariesTotal free space is 41942973 sectors (20.0 GiB)Number  Start (sector)    End (sector)  Size       Code  Name#再次分区[root@localhost ~]# gdisk /dev/sdcGPT fdisk (gdisk) version 1.0.3Partition table scan:  MBR: protective  BSD: not present  APM: not present  GPT: presentFound valid GPT with protective MBR; using GPT.Command (? for help): nPartition number (1-128, default 1): 1First sector (34-41943006, default = 2048) or {+-}size{KMGTP}: Last sector (2048-41943006, default = 41943006) or {+-}size{KMGTP}: +2GCurrent type is 'Linux filesystem'Hex code or GUID (L to show codes, Enter = 8300): Changed type of partition to 'Linux filesystem'Command (? for help): pDisk /dev/sdc: 41943040 sectors, 20.0 GiBModel: VMware Virtual SSector size (logical/physical): 512/512 bytesDisk identifier (GUID): 7CA4232A-4A9E-467D-AADD-BB84DB2126E3Partition table holds up to 128 entriesMain partition table begins at sector 2 and ends at sector 33First usable sector is 34, last usable sector is 41943006Partitions will be aligned on 2048-sector boundariesTotal free space is 37748669 sectors (18.0 GiB)Number  Start (sector)    End (sector)  Size       Code  Name   1            2048         4196351   2.0 GiB     8300  Linux filesystemCommand (? for help): wFinal checks complete. About to write GPT data. THIS WILL OVERWRITE EXISTINGPARTITIONS!!Do you want to proceed? (Y/N): yOK; writing new GUID partition table (GPT) to /dev/sdc.The operation has completed successfully.[root@localhost ~]# partprobe /dev/sdc2.创建文件系统(格式化)CentOS8默认使用xfs[root@localhost ~]# mkfs.xfs -f /dev/sdc13.挂载[root@localhost ~]# mkdir /disk1[root@localhost ~]# mount -t xfs -o ro /dev/sdc1 /disk1     //手动挂载[root@localhost ~]# umount /disk1       ##卸载

小结

哪些工具可以管理GPT磁盘

fdisk gdisk

如何使用gdisk管理gpt磁盘

o--w--partprobe

GPT磁盘的挂载使用

mkfs.*--mkdir--mount

重点: 使用gdisk工具管理磁盘并挂载使用

难点: 将磁盘在MBR和GPT之间进行转换

标签: #centos查看gpt分区