3 月 272018
 

操作系统:centos7
参考url:http://blog.51cto.com/qicheng0211/1620171
https://blog.csdn.net/youjin/article/details/79137203
操作步骤:
1:fdisk  /dev/sdc
n 添加
p 主分区
t 选择分区
L 分区代码
8e (LVM)
w 写入

2:partprobe

3:pvcreate /dev/sdc1
4:vgextend centos  /dev/sdc1
5:lvextend -l +100%FREE  /dev/mapper/centos-root
6:
ext4:resize2fs    /dev/centos/root   600G  //扩容文件系统到600G,resize2fs 针对 ext2/ext3/ext4文件系统。
xfs_growfs /dev/mapper/centos-root   //使扩容生效,xfs_groufs 针对 xfs文件系统

 

超过2T硬盘 需要用parted 划分GPT的分区
parted /dev/sdb
(parted) mklabel gpt           # 将MBR磁盘格式化为GPT
(parted) print                       #打印当前分区
(parted) mkpart primary 0 4TB                # 分一个4T的主分区

pvcreate /dev/sdb1 /dev/sdc1 /dev/sdd1
pvscan
vgcreate myvg /dev/sdb1 /dev/sdc1 /dev/sdd1
vgdisplay
lvcreate -L 8.19T   myvg
lvdisplay
mkfs.ext4 /dev/myvg/lvol0
mount  /dev/myvg/lvol0 /data

如果遇到分区错误需要处理:
参考:https://www.linuxea.com/1677.html

WARNING: Device for PV ZKBljh-qpd7-IhOp-9pSg-1270-kOe0-HZOuYi not found or rejected by a filter

pvscan
vgreduce –removemissing -v MKVG

 Leave a Reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

(required)

(required)

这个站点使用 Akismet 来减少垃圾评论。了解你的评论数据如何被处理

This website stores cookies on your computer. These cookies are used to provide a more personalized experience and to track your whereabouts around our website in compliance with the European General Data Protection Regulation. If you decide to to opt-out of any future tracking, a cookie will be setup in your browser to remember this choice for one year.

Accept or Deny