Is this still acceptable to you? The closest location we can manage is

如果磁盘之前已经有分区表,但是分区表没有对齐,你没有执行 mklabel gpt 就执行 mkpart 就可能会提示磁盘分区从0开始对齐需要接近扇区,这个警告需要通过使用 -a optimal 参数来修正:

Warning: You requested a partition from 0.00GB to 3840GB (sectors 0..7500000000).
The closest location we can manage is 0.00GB to 0.00GB (sectors 34..2047).
Is this still acceptable to you?
Yes/No?

对于原先有分区的磁盘,覆盖原先的分区表,默认是会提示WARNING的,对于脚本执行命令,需要关闭提示,则使用参数 -s 表示 --script 就不会有提示了。举例:

parted -s -a optimal /dev/vdb mklabel gpt
parted -s -a optimal /dev/vdb mkpart primary 0% 100%
parted -s -a optimal /dev/vdb name 1 gluster_brick1
mkfs.xfs -f -i size=512 /dev/vdb1
posted @ 2022-03-26 02:51  十支穿云箭  阅读(463)  评论(0编辑  收藏  举报