lvm逻辑卷管理_如何在Ubuntu中管理和使用LVM(逻辑卷管理)

本文详细介绍了如何在Ubuntu中管理和使用LVM,包括查看LVM信息、创建和调整逻辑卷大小、备份和删除逻辑卷。通过LVM,可以轻松地管理硬盘驱动器和分区,实现灵活的存储扩展。文章提供了LVM命令行工具的使用方法,帮助读者掌握LVM的关键管理技巧。
摘要由CSDN通过智能技术生成
lvm逻辑卷管理

lvm逻辑卷管理

In our previous article we told you what LVM is and what you may want to use it for, and today we are going to walk you through some of the key management tools of LVM so you will be confident when setting up or expanding your installation.

上一篇文章中,我们告诉了您什么是LVM以及您可能希望将其用于什么 ,今天我们将带您逐步了解LVM的一些关键管理工具,以便您在设置或扩展安装时充满信心。

As stated before, LVM is a abstraction layer between your operating system and physical hard drives. What that means is your physical hard drives and partitions are no longer tied to the hard drives and partitions they reside on. Rather, the hard drives and partitions that your operating system sees can be any number of separate hard drives pooled together or in a software RAID.

如前所述,LVM是操作系统和物理硬盘驱动器之间的抽象层。 这意味着您的物理硬盘驱动器和分区不再与它们所在的硬盘驱动器和分区相关联。 而是,您的操作系统看到的硬盘驱动器和分区可以是任意数量的单独的硬盘驱动器,它们可以汇集在一起​​或位于软件RAID中。

To manage LVM there are GUI tools available but to really understand what is happening with your LVM configuration it is probably best to know what the command line tools are. This will be especially useful if you are managing LVM on a server or distribution that does not offer GUI tools.

要管理LVM,可以使用GUI工具,但是要真正了解LVM配置正在发生什么,最好最好了解命令行工具是什么。 如果要在不提供GUI工具的服务器或发行版上管理LVM,这将特别有用。

Most of the commands in LVM are very similar to each other. Each valid command is preceded by one of the following:

LVM中的大多数命令彼此非常相似。 每个有效命令之前都带有以下命令之一:

  • Physical Volume = pv

    物理体积= pv
  • Volume Group = vg

    卷组= vg
  • Logical Volume = lv

    逻辑体积= lv

The physical volume commands are for adding or removing hard drives in volume groups. Volume group commands are for changing what abstracted set of physical partitions are presented to your operating in logical volumes. Logical volume commands will present the volume groups as partitions so that your operating system can use the designated space.

物理卷命令用于在卷组中添加或删除硬盘驱动器。 卷组命令用于更改在逻辑卷中提供给您的操作的物理分区的抽象集合。 逻辑卷命令会将卷组显示为分区,以便您的操作系统可以使用指定的空间。

可下载的LVM备忘单 (Downloadable LVM Cheat Sheet)

To help you understand what commands are available for each prefix we made a LVM cheat sheet. We will cover some of the commands in this article, but there is still a lot you can do that won’t be covered here.

为了帮助您了解每个前缀可用的命令,我们制作了LVM备忘单。 我们将在本文中介绍一些命令,但是您仍然可以做很多事情,此处不做介绍。

All commands on this list will need to be run as root because you are changing system wide settings that will affect the entire machine.

该列表中的所有命令都需要以root用户身份运行,因为您正在更改将影响整台计算机的系统范围设置。

(Click on the thumbnail for a full size image)

(单击缩略图可查看大图)

如何查看当前的LVM信息 (How to View Current LVM Information)

The first thing you may need to do is check how your LVM is set up. The s and display commands work with physical volumes (pv), volume groups (vg), and logical volumes (lv) so it is a good place to start when trying to figure out the current settings.

您可能需要做的第一件事是检查LVM的设置方式。 sdisplay命令可与物理卷(pv),卷组(vg)和逻辑卷(lv)配合使用,因此是尝试了解当前设置的理想起点。

The display command will format the information so it’s easier to understand than the s command. For each command you will see the name and path of the pv/vg and it should also give information about free and used space.

display命令将格式化信息,因此比s命令更容易理解。 对于每个命令,您将看到pv / vg的名称和路径,并且还应该提供有关可用空间和已用空间的信息。

The most important information will be the PV name and VG name. With those two pieces of information we can continue working on the LVM setup.

最重要的信息将是PV名称和VG名称。 有了这两条信息,我们就可以继续进行LVM设置。

创建逻辑卷 (Creating a Logical Volume)

Logical volumes are the partitions that your operating system uses in LVM. To create a logical volume we first need to have a physical volume and volume group. Here are all of the steps necessary to create a new logi

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值