linux 6 gpt分区,[RHEL 6]GPT分区--parted

对于2T以上的硬盘,划分分区表需要GPT分区,RHEL 6中使用parted进行分区

用法:parted [选项]... [设备 [命令 [参数]...]...]

将带有“参数”的命令应用于“设备”。如果没有给出“命令”,则以交互模式运行.

帮助选项:

-h, --help

显示此求助信息

-l, --list

列出所有设别的分区信息

-i, --interactive

在必要时,提示用户

-s, --script

从不提示用户

-v, --version

显示版本

To start the parted command, type:

# parted

fb8be42569e661c8e3ab56cba97cebae.gif

To list all the disks and partitions, type:

(parted) print all

117efb2e0cb089e899b4d4403bcc734b.gif

选择/dev/sdd

(parted) select /dev/sdd

f673e7a2f7372d80755102bf328e778c.gif

在硬盘上创建GPT分区

(parted) mktable gpt

140e18a180e1e0e721bd5d9773e3299f.gif

注意:输入mktable msdos创建MBR分区表

label-type可以是"bsd", "dvh", "gpt", "loop", "mac", "msdos","pc98", or "sun"

一般的pc机都是msdos格式,如果分区大于2T则需要选用gpt格式的分区表。

To create a primary partition with the ext4 type

(here starting at 1MB and finishing at 400GB), type:

(parted) mkpart primary ext4 1MB 400GB

Note1: Specifying ext4 doesn’t format the partition in ext4, it only tags it as ext4 partition.

Note2: The partition doesn’t start at 0 but 1MB to avoid disk alignment problems.

Note3: To specify all the remaining space, use -1 as end position.

Note4: With parted, 1GB=1000MB.

0a4c444c3e3b72cbf01259509813e87a.gif

确定分区的起始扇区是否与磁盘对齐。

(parted) align-check optimal 1

98efd73b7570d33f1de60ccc4a195fc9.gif

如果分区错了,可以使用rm命令删除分区,比如我们要删除上面的分区,然后打印删除后的结果

(parted)rm 1 #rm后面使用分区的号码

(parted) print

e2910a23c0d93c47eccdd05a7af351b0.gif

6、按照上面的方法把整个硬盘都分好区,下面是一个分完后的样例

359d4d3fa8d7ac9e9492fa720c334d8f.gif

刷新内存分区表

partx -a /dev/sdd

查看分区

lsblk

f20fd84af6aed46d8585f990cff61949.gif

参考

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值