Filesystem: managing

Posted 三叁

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Filesystem: managing相关的知识,希望对你有一定的参考价值。

Linux block devices can be partitioned into several partitions, max to several tens or hundreds primary partitions. (According to MBR or GPT)

In order to manage the block deivce more easily, Logical volume manager(lvm) is introduced. It can split a partition into several volumes.

First a partition is splitted into several physical volums (pv), and a physical volume is consists of several volume groups (vg), and each volume group consists of several logical volumes(lv).

Determine a partition is of lvm kind, use fdisk to print its type.

Check lvm status, using the commands: pvs, vgs, lvs.

Each logical volume has a filesystem managing files contained in it, check each fs type by:

fsck /dev/mapper/cl-home

If fs type is xfs, then the fs cannot be shrinked, and only can grow to a larger size.

To remove current logical volume:

umount /dev/mapper/cl-home
lvremove /dev/mapper/cl-home

To recreate a logical volume with given size:

lvcreate -L 4G -n home cl
mkfs.xfs /dev/mapper/cl-home
mount /dev/mapper/cl-home

Now that shrinked one partition, to grow another partition of xfs typed fs by:

lvextend -r -l 100%FREE /dev/mapper/cl-root

Check results: using lvs

以上是关于Filesystem: managing的主要内容,如果未能解决你的问题,请参考以下文章

如何更改片段 Kotlin

SQL server management studio的基本使用

Backstack management : Restarter 只能在所有者初始化阶段创建

yum报错setup has installed conflicts filesystem < ('0', '3', None): filesystem(示例代码

不能在使用 make 和 g++ 构建的代码中使用 std::filesystem

如何在 Linux 上使用 Boost.Filesystem?