当前位置: 移动技术网 > 科技>操作系统>Linux > [RHEL 6]GPT分区--parted

[RHEL 6]GPT分区--parted

2018年05月03日  | 移动技术网科技  | 我要评论

汤唯新浪微博,女护士杀8名长者,英语学习格言

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

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

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

帮助选项:

-h, --help

显示此求助信息

-l, --list

列出所有设别的分区信息

-i, --interactive

在必要时,提示用户

-s, --script

从不提示用户

-v, --version

显示版本

To start the parted command, type:

# parted

clip_image002

To list all the disks and partitions, type:

(parted) print all

clip_image004

选择/dev/sdd

(parted) select /dev/sdd

clip_image006

在硬盘上创建GPT分区

(parted) mktable gpt

clip_image008

注意:输入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.

clip_image010

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

(parted) align-check optimal 1

clip_image012

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

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

(parted) print

clip_image014

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

clip_image016

刷新内存分区表

partx -a /dev/sdd

查看分区

lsblk

clip_image018

参考

https://www.certdepot.net/rhel7-create-delete-partitions/

如对本文有疑问,请在下面进行留言讨论,广大热心网友会与你互动!! 点击进行留言回复

相关文章:

验证码:
移动技术网