gpt分区 Linux lvm,CentOS的GPT分区+LVM挂载

关于4k对齐

Get the alignment parameters for your array (remember to replace sdb with the name of your device as seen by the kernel).

# cat /sys/block/sdb/queue/optimal_io_size

1048576

# cat /sys/block/sdb/queue/minimum_io_size

262144

# cat /sys/block/sdb/alignment_offset

0

# cat /sys/block/sdb/queue/physical_block_size

512

Add optimal_io_size to alignment_offset and divide the result by physical_block_size. In my case this was (1048576 + 0) / 512 = 2048.This number is the sector at which the partition should start. Your new parted command should look like

mkpart primary 2048s 100%

The trailing ‘s’ is important: it tells parted that you’re talking about sectors, not bytes or megabytes. If all went well, the partition will have been created with no warnings. You can check the alignment thusly (replacing ‘1’ with the partition number if necessary):

(parted) align-check optimal 1

1 aligned

磁盘分区4k对齐问题,开始位置设置为“0%”,结束位置设置为“100%”,可以保证使用最大空间的前提下4k对齐。

参考文章:

https://blog.csdn.net/open_data/article/details/44828741

3. 格式化新的分区

服务器数据盘一般格式化xfs,一般桌面的系统可以用ext4,xfs单个分区的容量比ext4同等条件下大。

> sudo mkfs.xfs /dev/sdb1 // xfs硬盘格式化

> sudo mkfs.ext4 /dev/sdb1 // ext4硬盘格式化

4. LVM划分加载硬盘

创建物理卷

# pvcreate /dev/sdb1

将物理设备加入卷组

# vgcreate vg_data /dev/sdb1

说明:可以将多个分区和到一起,如下

# vgcreate vg_data /dev/sdb1 /dev/sdc1

使用整个卷组空间创建逻辑卷

# lvcreate -l 100%FREE -n lv_data vg_data

5. 挂载逻辑卷设备

# mount /dev/vg_data/lv_data /vol/data

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值