lvm ext4_在Linux中的LVM上缩小Ext4文件系统

lvm ext4

In Extending a Mounted Ext4 File System on LVM in Linux, we introduced how to extend a mounted ext4 filesystem on LVM Logical volume by adding a new physical volume. It is also common to shrink an ext4 file system as to spare some disk space. In this post, I will discuss how to shrink an ext file system on a LVM logical volume (LV).

在Linux的LVM上扩展已挂载的Ext4文件系统中 ,我们介绍了如何通过添加新的物理卷在LVM逻辑卷上扩展已挂载的ext4文件系统。 缩小ext4文件系统以节省一些磁盘空间也是很常见的。 在本文中,我将讨论如何在LVM逻辑卷(LV)上缩小ext文件系统。

After the file system and LV is shrunk, the disk space is returned to the volume group (VG) and you can allocate the disk space in the VG to other LVs. On the other hand, you may also delete a PV to remove a hard drive from the Linux box or shrink the underlining partition to spare some raw disk space. We will also introduce these 2 following actions.

文件系统和LV收缩后,磁盘空间将返回到卷组(VG),您可以将VG中的磁盘空间分配给其他LV。 另一方面,您也可以删除PV,以从Linux机器中删除硬盘驱动器,或者缩小下划线分区以节省一些原始磁盘空间。 我们还将介绍以下两个动作。

The example we used for introduction here is that /dev/sdb is a hard drive with a partition /dev/sdb1 as a PV of VG vg, vg contains a LV named lv_data, and an ext4 file system on lv_data is created and mounted to /mnt/data.

我们在此处使用的示例是/ dev / sdb是一个硬盘驱动器,其分区为/ dev / sdb1作为VG vg的PV,vg包含一个名为lv_data的LV,并且在lv_data上创建了ext4文件系统并将其安装到/ mnt / data。

第一步:备份数据 (First step: backup your data)

Backup your data in /mnt/data first! Shrinking file systems and partitions are danger operations. Backup your data before any following operations.

首先备份/ mnt / data中的数据! 缩小文件系统和分区是危险的操作。 执行以下任何操作之前,请备份数据。

卸载ext4文件系统 (

你可能感兴趣的:(linux,java,python,大数据,mysql)