Centos 如何判断分区是mbr还是gpt格式

1 介绍

MBR

  • 自20世纪80年代初以来的标准分区表格式
  • 每个驱动器最多支持四个主分区
  • 最多可以划分2TB的磁盘

GPT

  • GPT是MBR分区表格式的后续
  • 每个驱动器最多支持128个分区
  • 可以将一个磁盘分区到最大到18艾字节
  • 对小于2TB的磁盘使用MBR
  • 对大于2TB的磁盘使用GTP

2 查询方式

2.1 fdisk方式

2.2 parted方式

3 如何修改分区格式

用parted命令更改磁盘分区格式:

复制代码
[root@m8-9p51-duanzhengnan ~]# parted /dev/sdb
(parted)mktable
New disk label type? msdos
Warning: The existing disk label on /dev/sdb will be destroyed and all data on
this disk will be lost. Do you want to continue?
Yes/No?Yes

使用免交互加上 -s:

复制代码
$ parted /dev/sdb mklabel msdos -s  #转换成mbr格式
$ parted /dev/sdb mklabel gpt -s    #转化成gpt格式

MBR格式一般在linux下称作dos,如果在New disk label type后输入dos或者mbr会提示无效命令,这时候要用help mktable查看帮助信息,可以看到parted命令中MBR分区被称作msdos,其它分区如下:aix, amiga, bsd, dvh, gpt, mac, msdos, pc98, sun, loop。

相关推荐
orion5716 小时前
Missing Semester Class1:course overview and introduction of shell
linux
用户120487221611 天前
Linux驱动编译与加载
linux·嵌入式
饼干哥哥1 天前
我把GPT-image-2生成PSD的能力打包成了Skill,免费开源
gpt·开源·ai编程
用户805533698031 天前
Input 子系统架构:Core、Handler、Driver 三层是怎么协作的
linux·嵌入式
用户805533698031 天前
RK-Forge外设系列开篇 - 把板子从「能启动」变成「能用」:Ethernet/SPI/MMC 三个纯接线外设
linux·github·嵌入式
七歌杜金房2 天前
我终于又有了自己的 Linux 电脑
linux·debian·mac
tntxia3 天前
linux curl命令详解_curl详解
linux
扛枪的书生3 天前
Linux 网络管理器用法速查
linux
顺风尿一寸3 天前
Java Socket 内核之旅:从 SocketChannel.read() 到 tcp_recvmsg 与 epoll 的完整调用链路
linux
XIAOHEZIcode3 天前
Ubuntu 终端美化全栈指南:Bash 到 Kitty 踩坑实录
linux·ubuntu·命令行