Linux系统——逻辑卷扩容

Linux系统——逻辑卷扩容

1、对新的磁盘进行分区

[root@ ~]# fdisk /dev/sdc
WARNING: DOS-compatible mode is deprecated. It's strongly recommended to
         switch off the mode (command 'c') and change display units to
		 sectors (command 'u').

Command (m for help): n 		 #输入n,新建分区
Command action
   e   extended
   p   primary partition (1-4)  	p 		  #输入p,确定主分区
Partition number (1-4): 1					  #输入数字1,选择sdc1
First cylinder (1-652, default 1): 		      #输入回车,默认
Using default value 1
Last cylinder, +cylinders or +size{K,M,G} (1-652, default 652): 	 #输入回车,默认

Command (m for help): t						 #输入t,更改分区的系统id
Selected partition 1
Hex code (type L to list codes): 8e			 #输入8e,选择Linux LVM
Changed system type of partition 1 to 8e (Linux LVM)

Command (m for help): p                      #输入p,打印分区信息

Disk /dev/sdc: 5368 MB, 5368709120 bytes
255 heads, 63 sectors/track, 652 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00093fc1

   Device Boot      Start         End      Blocks   Id  System
/dev/sdc1               1         132     1060258+  8e  Linux LVM

Command (m for help): w			#输入w,写入分区 
The partition table has been altered!

Calling ioctl() to re-read partition table.
Syncing disks.

2、创建物理卷

[root@ ~]# pvcreate /dev/sdc1
Physical volume "/dev/sdc1" successfully created

3、把/dev/sdc1添加到已有的vg_data卷组中

[root@ ~]# vgextend vg_data /dev/sdc1
  Physical volume "/dev/sdc1" successfully created
  Volume group "vg_data" successfully extended

检查pv和vg的情况

[root@ ~]# pvs
[root@ ~]# vgs
[root@ ~]# pvdisplay
[root@ ~]# vgdisplay

4、把新增的空间全部加入到已有卷组

[root@ ~]# lvextend -l +100%FREE /dev/mapper/vg_data-lv_data

5、重新加载分区

[root@ ~]# resize2fs /dev/mapper/vg_data-lv_data

6、查看分区大小

[root@ ~]# df –h
  • 2
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值