什么是Linux LVM(逻辑卷管理)?

LVM or Logical Volume Management used to create, manage and delete logical volumes in Linux operating systems. LVM provides RAID like architectures for disk drives. We can create single logical volume from multiple physical disks.

LVM或Logical Volume Management用于在Linux操作系统中创建,管理和删除逻辑卷。 LVM为磁盘驱动器提供了类似于RAID的体系结构。 我们可以从多个物理磁盘创建单个逻辑卷。

基本 (Basics)

LVM consist of 3 main concepts:

LVM包含3个主要概念:

  • Physical  Volumes

    物理体积
  • Volume Groups

    卷组
  • Logical Volumes

    逻辑卷

Let me explain in a simple manner. By adding one or more than one Physical Volume we will create a Volume Group and than we can create one or more Logical Volume from a Volume Group. As we can see LVM provides some abstraction for disk and partition management.

让我以简单的方式解释一下。 通过添加一个或多个物理卷,我们将创建一个卷组,然后从一个卷组中创建一个或多个逻辑卷。 如我们所见,LVM为磁盘和分区管理提供了一些抽象。

PhysicalVolume1 + PhysicalVolume2 + ... + PhysicalVolumeN => Volume Group
VolumeGroup=>LogicalVolume1

VolumeGroup=>LogicalVolume2

...

VolumeGroup=>LogicalVolumeN

物理体积 (Physical Volume)

Physical Volume is a physical disk or a partition which is the source of the storage. We can also use RAID disks or partitions. Physical volume will be added into Volume Groups and this will add more disk space to the Volume Groups.

物理卷是物理磁盘或作为存储源的分区。 我们还可以使用RAID磁盘或分区。 物理卷将被添加到卷组中,这将为卷组添加更多的磁盘空间。

卷组 (Volume Groups)

Volume Groups a logical disk where one or more Physical Disk will participate. This will create enough disk space in order to create Logical Volumes.Volume groups provides flexibility like adding, removing physical volume , resizing Logical Volume on the fly.

卷将一个或多个物理磁盘将参与的逻辑磁盘分组。 这将创建足够的磁盘空间以创建逻辑卷。卷组提供了灵活性,如动态添加,删除物理卷,调整逻辑卷大小。

Volume Groups
Volume Groups
卷组

逻辑卷(Logical Volume)

Logical Volumes are the virtual disk or partitions created from a Volume Groups. We can resize and snapshot the Logical Volume without any interruption.

逻辑卷是从卷组创建的虚拟磁盘或分区。 我们可以在不中断的情况下调整逻辑卷的大小和快照。

Volume Groups
Volume Groups
卷组

创建卷组(Create Volume Group)

We will start by creating a Volume Group. First we will initialize the physical disk for the Volume Group. We will use pvcreate command by providing the disk device.

我们将从创建一个卷组开始。 首先,我们将初始化卷组的物理磁盘。 我们将通过提供磁盘设备来使用pvcreate命令。

$ sudo pvcreate /dev/sdb1

After the disk sdb1 initialized we will create a volume Group named myvg with the vgcreate command

初始化磁盘sdb1之后,我们将使用vgcreate命令创建一个名为myvg的卷组。

$ sudo vgcreate myvg /dev/sdb1

创建逻辑卷 (Create Logical Volume)

Than we will create Logical Volume with the lvcreate command by providing the Volume Group and the Logical Volume name. In this example we will use -n option for Logical Volume Name and -L for setting the size of the Logical Volume. The Logical Volume size will be 5GB .

然后,通过提供卷组和逻辑卷名称,使用lvcreate命令创建逻辑卷。 在此示例中,我们将-n选项用于逻辑卷名,并使用-L设置逻辑卷的大小。 逻辑卷大小为5GB。

$ sudo lvcreate -n mypart -L 5g myvg

调整分区大小 (Resize Partition)

LVM provides a lot of features against standard disk usage. We can resize the Logical Volume or partition on the fly without unmounting or restarting the system. This operation also called extending where we will use lvextend command. -L option is used to specify how much disk space will be added .

LVM提供了许多针对标准磁盘使用情况的功能。 我们可以动态调整逻辑卷或分区的大小,而无需卸载或重新启动系统。 此操作也称为extending ,我们将在其中使用lvextend命令。 -L选项用于指定要添加多少磁盘空间。

$ sudo lvextend -L 5g  myvg/mypart
LEARN MORE  What Is RAID 6 (Redundant Array Of Independent Disks) and Configuration?
了解更多什么是RAID 6(独立磁盘冗余阵列)和配置?

翻译自: https://www.poftut.com/what-is-linux-lvm-logical-volume-management/

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值