Linux Sysadmin:如何使用GUI管理LVM

We’ve talked about how to use LVM before, but what if you wanted to accomplish the same tasks only with a comfortable graphical interface? HowTo Geek dives into how to manage LVM drives with a GUI.

我们之前已经讨论过如何使用LVM,但是如果您只想通过舒适的图形界面来完成相同的任务,该怎么办? HowTo Geek深入探讨了如何使用GUI管理LVM驱动器。

Image by marfis.

图片由marfis提供

介绍 (Introduction)

The Logical Volume Manager or LVM, has already been covered on HTG as well as why you should use it. As LVM is becoming more and more mainstream, where some of the major distribution players like CentOS and Ubuntu with their latest 12.10 release, now installing on LVM by default, you may come across it sooner then you might think. With the above it will probably won’t be long before the time that you would want to administrate an LVM, to increase the space available on the volume for example… with that said, what could be more pleasant then having a nice graphical interface to do the job? Nothing, so lets install one.

L ogical V olume 中号 anager或LVM,已经被覆盖上HTG以及为什么你应该使用它。 随着LVM变得越来越主流,其中一些主要的发行公司(例如CentOS和Ubuntu及其最新的12.10版本)已默认安装在LVM上,您可能会想得更快。 有了上面的内容,也许不久之后您便要管理LVM,例如增加卷上的可用空间……说了这么多,然后有了一个不错的图形界面来做这份工作? 什么都没有,所以让我们安装一个。

安装LVM GUI实用程序 (Install LVM GUI utility)

The utility that we will be using to perform the job is “system-config-lvm” from Redhat. as this utility has been repackaged for Ubuntu, the only difference between the two, is how you install it.

我们将用于执行作业的实用程序是Redhat的“ system-config-lvm ”。 由于已为Ubuntu重新打包了该实用程序,因此两者之间的唯一区别在于安装方式。

On CentOS

在CentOS上

You can install the package using the CLI, by issuing in a terminal:

您可以通过在终端中发出以下命令,使用CLI安装软件包:

yum install system-config-lvm

yum install system-config-lvm

Once installed, you can issue the utility name with sudo for admin rights to launch it:

安装后,您可以使用sudo发出实用程序名称,以获得启动它的管理员权限:

sudo system-config-lvm

sudo system-config-lvm

Alternatively, You may wish to install the package using the graphical package manager. To do that, go to “system” -> “Administration” -> “Add/Remove Software”.

或者,您可能希望使用图形软件包管理器来安装软件包。 为此,请转到“系统”->“管理”->“添加/删除软件”。

Search for “LVM” in the filter box to find the “system-config-lvm” utility down at the bottom.

在过滤器框中搜索“ LVM”,在底部找到“ system-config-lvm”实用程序。

Select the checkbox and “Next -> Next -> Finish” to accept the installation and it’s key. Once installed (this is true for the CLI way as well), the program will appear under “System” -> “Administration” -> “Logical Volume Management”.

选中复选框,然后单击“下一步->下一步->完成”以接受安装及其关键。 安装后(对于CLI方式也是如此),该程序将出现在“系统”->“管理”->“逻辑卷管理”下。

Click It to Open the program. At this point you may skip to the “Using” segment at the bottom.

单击它打开程序。 此时,您可以跳到底部的“使用”部分。

On Ubuntu

在Ubuntu上

The newest version of Ubuntu (12.10 at the time of this writing), now ships with LVM as an integral part. That is good news, because on previous releases, while you could install the system-config-lvm utility, you would also have to install about 180MB worth of missing LVM stuff with it. This would make the “just get in and out with a live CD” use case a bit slower. Moreover you had to issue a manual command so that all of the functions of the utility, namely the filesystem re-sizing, would work.

Ubuntu的最新版本(在撰写本文时为12.10)现已随​​LVM一起提供。 这是个好消息,因为在以前的版本中,虽然可以安装system-config-lvm实用程序,但同时还必须安装约180MB的丢失LVM内容。 这将使“只需使用实时CD进出即可”用例会慢一些。 此外,您还必须发出手动命令,以便实用程序的所有功能(即重新调整文件系统的大小)都可以使用。

Open the “Ubuntu software center” and look for “LVM”.

打开“ Ubuntu软件中心”,然后查找“ LVM”。

Click on the “Logical Volume management” row and then click “More info”.

单击“逻辑卷管理”行,然后单击“更多信息”。

Because the LVM utility comes from the Linux “Universe”, we have to first enable the repository by clicking on “Use This Source”. Once the resource is enabled and the package manager has been updated (have patience as this may take a short while), you will get the option to install the program. Click “install”.

因为LVM实用程序来自Linux“ Universe”,所以我们必须首先通过单击“使用此源”来启用存储库。 启用资源并更新程序包管理器后(请耐心等待,因为这可能会花费一些时间),您将可以选择安装程序。 点击“安装”。

Once installed, if you are running a version earlier then 12.10, you’re gonna want to drop to a shell to issue the following single command, which will enable the utility’s filesystem re-sizing ability.

安装后,如果您正在运行12.10之前的版本,则需要放到shell发出以下单个命令,这将启用该实用程序的文件系统大小调整功能。

vgchange -ay

vgchange -ay

Now you can open the program by clicking its icon.

现在,您可以通过单击该程序的图标来打开该程序。

使用实用程序 (Using the utility)

If you’ve read our “What is Logical Volume Management and How Do You Enable It in Ubuntu?” guide, you’ve probably noticed that all of the LVM setup there, is done in the command line. With this program, you could perform all of the setup necessary to create an LVM from scratch with the GUI.

如果您已经阅读了“ 什么是逻辑卷管理以及如何在Ubuntu中启用它? 指南中,您可能已经注意到那里的所有LVM设置都是在命令行中完成的。 使用此程序,您可以执行使用GUI从头创建LVM所需的所有设置。

With that said, for the purpose of this example, we will not be setting up an LVM, but rather walk through the one of the most prominent use case scenarios of “increasing the available disk space” for a volume.

话虽如此,对于本示例而言,我们将不会设置LVM,而是逐步介绍一种最突出的用例场景,即“增加卷的可用磁盘空间”。

New space for a volume can come in many forms, maybe you’ve physically added and HD to the system, maybe you’ve increased the disk for a VM… it doesn’t really matter the procedure of adding the space to a volume is very similar.

卷的新空间可以有多种形式,也许您已经物理上添加了HD并添加到了系统中,也许您已经增加了VM磁盘 ……实际上,将空间添加到卷中的过程并不重要非常相似。

  1. Initialize the “New space” for LVM usage.

    初始化供LVM使用的“新空间”。
  2. Add the “New space” to the Physical Volume(PV).

    在物理卷(PV)中添加“新空间”。
  3. Allocate the “New space” in the PV to the Logical Volume(LV).

    将PV中的“新空间”分配给逻辑卷(LV)。
  4. Increase a specific Logical Volume size.

    增加特定的逻辑卷大小。
  5. Increase the filesystem on the LV.

    在LV上增加文件系统。

Initializing the “New space”

初始化“新空间”

For this example, we’ve opted to go the “There is a new HD in the system” route, and now we will prepare it for LVM use.

在此示例中,我们选择了“系统中有新的高清”路由,现在我们将为LVM使用做好准备。

Expand the “Uninitialized Entities” tree menu, and find the “new space” (in our case, that’s “/dev/sdb”) and select it.

展开“未初始化的实体”树菜单,找到“新空间”(在我们的示例中为“ / dev / sdb”)并选择它。

Once Selected click on “Initialize Entity”.

选择后,单击“初始化实体”。

Click yes to confirm you understand that the data on the disk will be destroyed.

单击“是”以确认您了解磁盘上的数据将被破坏

Note: In our example, we haven’t partitioned the disk for simplicity’s sake, but you are advised (even by the program) to do so.

注意:在我们的示例中,为简单起见,我们并未对磁盘进行分区 ,但是建议您(甚至是程序)对磁盘进行分区

Add the “New space” to the Physical Volume(PV)

在物理卷(PV)中添加“新空间”

Now that the “New space” has been initialized, it can be added to and existing “Volume Group”.

现在,“新空间”已经初始化,可以将其添加到现有的“卷组”中。

Once you click “Add to existing Volume Group”, you will be presented with a list of the detected groups on the system. In our example, the Volume Group we will be adding to, is the one Ubuntu was installed on with the 12.10 installer which had the LVM option enabled. As the Volume Group was created for us by the installer, it chose the name “Ubuntu”.

单击“添加到现有卷组”后,将向您显示系统上检测到的组的列表。 在我们的示例中,我们将添加到的卷组是在Ubuntu 12.00安装程序中安装了一个启用了LVM选项的Ubuntu组。 由于卷组是由安装程序为我们创建的,因此选择了名称“ Ubuntu”。

Select the Volume Group if its not selected and click on “Add”.

如果未选择卷组,则选择它,然后单击“添加”。

Allocate the “New space” in the PV to the Logical Volume(LV)

将PV中的“新空间”分配给逻辑卷(LV)

Once the “New space” has been added to the PV, you will see the new “Unused Space” as part of the Logical Volume Group, as in the picture below.

一旦将“新空间”添加到PV中,您将在逻辑卷组中看到新的“未使用空间”,如下图所示。

Increase a specific Logical Volume size

增加特定的逻辑卷大小

In order to have a “Logical Volume” use the “New space”, expand the “Logical View” tree menu and select the Logical Volume you wish to increase. In our example, that would be the “root” volume.

为了获得“逻辑卷”,请使用“新空间”,展开“逻辑视图”树菜单,然后选择要增加的逻辑卷。 在我们的示例中,这将是“根”卷。

Once the Logical Volume is selected, click on “Edit Properties”.

选择逻辑卷后,单击“编辑属性”。

The “Edit Logical Volume” window enables you to change the size of the Volume, using a simple slider or a “Use remaining” button.

“编辑逻辑卷”窗口使您可以使用简单的滑块或“使用剩余”按钮来更改卷的大小。

Increase the filesystem on the LV

增加LV上的文件系统

If the system fully supports LVM, as CentOS and Ubuntu 12.10 do (for 12.04, see the comment in the installation segment) clicking OK, will also increase the size for the  filesystem which resides inside of the Logical Volume… neat haa? :)

如果系统完全支持LVM(如CentOS和Ubuntu 12.10所做的那样(对于12.04,请参见安装部分中的注释)),请单击确定,还会增加逻辑卷内部文件系统的大小吗? :)

It is the hope of this writer, that this guide has changed what was once a “oh dear gowaaad, i’ll have to pull out the manual and my hair again” procedure to a “sure, what’s the problem” one… :)

这是作者的希望,该指南已将曾经是“噢,亲爱的宝贝,我必须再次拔出手册和头发”的程序更改为“确定,这是什么问题”……:)



A Command Line is great for the copy & paste reproducibility, not for the monkey understanding or usability… (Aviad Raviv 2009)

命令行非常适合复制和粘贴的可复制性,而不适合猴子的理解或可用性……(Aviad Raviv 2009)

翻译自: https://www.howtogeek.com/127246/linux-sysadmin-how-to-manage-lvms-with-a-gui/

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值