码迷,mamicode.com
首页 > 其他好文 > 详细

Filesystem: managing

时间:2018-05-27 14:47:57      阅读:155      评论:0      收藏:0      [点我收藏+]

标签:groups   stat   span   map   code   linux   mount   and   command   

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

标签:groups   stat   span   map   code   linux   mount   and   command   

原文地址:https://www.cnblogs.com/sansna/p/9095831.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!