当前位置:网站首页>[Day8] (Super detailed steps) Use LVM to expand capacity
[Day8] (Super detailed steps) Use LVM to expand capacity
2022-08-05 06:08:00 【Mingli Yui】
目录
2、Change the type of partition to 8e
6、Format and mount logical volumes
根据LVMExpand the root partition
一、LVM逻辑卷的创建
1、Prepare a hard disk
Can be recreated or already created:
The hard disk that has been created and partitioned is used heresdc;

2、Change the type of partition to 8e

①然后使用命令:fdisk /dev/sdc 让硬盘进入分区模式,进行更改类型;

②输入t,Make mode changes

③输入1,Indicates to modify the type of the first partition

④输入8e,Indicates that the type is modified to8e

⑤输入p,查看修改结果

⑥All modifications are completed;

Note that the type of extended partition cannot be modified directly!

⑦记得输入w保存,It will prompt that it will take effect on the next restart
3、创建物理卷(PV)
①创建逻辑卷

pvsView physical volume size pvscan扫描物理卷 pvdisplay 查看详细信息
pvremove /dev/sdb1
4、创建卷组(VG)
创建卷组:vgcreate volume-group1 /dev/sdb1 /dev/sdb2 /dev/sdb3
删除卷组:vgremove volume-group1
5、创建逻辑卷(LV)
创建一个名为'1v1'、大小为100MB的逻辑卷.我们使用小分区减少执行时间.这个逻辑卷使用之前创建的卷组的空间.(The division is based on physical volume groups,The size cannot exceed the size of the physical volume)
lvcreate -L 100M -n lv1 vg1

6、Format and mount logical volumes

②创建目录
mkdir /mnt/lv1_mount
③挂载逻辑卷

lvremove删除逻辑卷:1.# umount /lvm-mount/

二、扩展一个LVM卷
扩展逻辑卷
Perform the following operations on the basis of the previous operations
lvextend -L 200M /dev/vg1/lv1
before expansion:
expanded:
扩展卷组
vgextend vg1 /dev/sdc1 (表示将/dev/sdc1扩展到vg1卷组)

before expansion:

expanded:

根据LVMExpand the root partition
lvextend -l +100%FREE /dev/mapper/centos-root
【The logical volume that will be created(LV)增加给root】
before expansion:
expanded:
三、LVM工作原理总结
Follow the partitionsLVMThe format is first created into PV(物理卷),Add the physical volume to the volume group(VG)里,And then through the roll group out
LV(逻辑卷),Finally, the expansion of the partition is realized.


边栏推荐
猜你喜欢
随机推荐
(C语言)动态内存管理
UE5再次更新!扫描或手动建模面部模型可直接转为绑定好的Metahuman
“元宇宙”是个啥?都有哪些大招?
每日一题-括号生成-0721
错误类型:reflection.ReflectionException: Could not set property ‘xxx‘ of ‘class ‘xxx‘ with value ‘xxx‘
Cocos Creator小游戏案例《棍子士兵》
每日一题-三数之和-0716(2)
Cocos Creator开发中的事件响应
(C语言)计算结构体大小——结构体内存对齐
网络通信及相关函数介绍
最简单的防抖节流理解法
【UiPath2022+C#】UiPath 数据操作
[Pytorch study notes] 8. How to use WeightedRandomSampler (weight sampler) when the training category is unbalanced data
CIPU,对云计算产业有什么影响
入门文档07 分阶段输出
电子产品量产工具(2)- 输入系统实现
论那些给得出高薪的游戏公司底气到底在哪里?
Unity huatuo 革命性热更系列1.2 huatuo热更环境安装与示例项目
每日一题-最长回文子串-0714
每日一题-DFS





![[Pytorch study notes] 8. How to use WeightedRandomSampler (weight sampler) when the training category is unbalanced data](/img/29/5b44c016bd11f0c0a9110cf513f4e1.png)




