Linux下的PV与LV

本文介绍了如何在Linux系统中管理LVM,包括扩展已存在的卷组(VG)的物理卷(PV),在线扩展逻辑卷(LV),以及挂载新的LV作为/oradata目录。内容涵盖了pvcreate、vgextend、lvextend、resize2fs等命令的使用,并演示了在不正确操作下可能出现的问题及解决方法。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

Linux下PV与LV

1.新增PV扩展已存在的VG

查看信息

[root@oracle ~]# fdisk -l

Disk /dev/sda: 21.5 GB, 21474836480 bytes

255 heads, 63 sectors/track, 2610 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: 0x0002fd0c

 

   Device Boot      Start         End      Blocks   Id  System

/dev/sda1   *           1          26      204800   83  Linux

Partition 1 does not end on cylinder boundary.

/dev/sda2              26         287     2097152   82  Linux swap / Solaris

Partition 2 does not end on cylinder boundary.

/dev/sda3             287        2611    18668544   8e  Linux LVM

 

Disk /dev/sdb: 21.5 GB, 21474836480 bytes

255 heads, 63 sectors/track, 2610 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: 0x27b457fc

 

   Device Boot      Start         End      Blocks   Id  System

 

Disk /dev/mapper/vg_oracle-LogVol00: 19.1 GB, 19113443328 bytes

255 heads, 63 sectors/track, 2323 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: 0x00000000

[root@oracle ~]# pvs

  PV         VG        Fmt  Attr  PSize  PFree

  /dev/sda3  vg_oracle   lvm2  a--u  17.80g    0

[root@oracle ~]# vgs

  VG        #PV #LV #SN  Attr   VSize  VFree

  vg_oracle   1   1   0  wz--n-  17.80g    0

将PV加入已有VG

[root@oracle ~]# vgextend vg_oracle /dev/sdb

[root@oracle ~]# pvs

  PV         VG      Fmt   Attr   PSize   PFree

  /dev/sda3  vg_oracle  lvm2  a—u  17.80g     0

  /dev/sdb   vg_oracle  lvm2  a—u  20.00g  20.00g

[root@oracle ~]# vgs

  VG        #PV #LV #SN Attr   VSize  VFree

  vg_oracle   2   1   0 wz--n-  37.80g 20.00g

虽然VG中已经可以看到扩容了,但是卷组可用仍然只有1.2G

[root@oracle ~]# df -hT

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值