7.2 LVM(逻辑卷管理器)
LVM:硬盘设备资源管理技术。LVM可以允许用户对硬盘资源进行动态调整。
7.2.1 部署逻辑卷
1.让新添加的两块硬盘支持LVM技术;
例:pvcreate /dev/sd[b,c]
2.把两块硬盘设备加入到storage卷组中,然后查看卷组的状态;
例:vgcreate storage /dev/sd[b,c] (加入到storage卷组中)
vgdisplay(查看)
3.切割出一个约为150MB的逻辑卷设备;
例:lvcreate -n vo -L 150M (切割出150MB)
lvdisplay(查看)
4.把生成好的逻辑卷进行格式化,然后挂载使用;
例:mkfs.ext4 /dev/storage/vo(格式化化为ext4文件系统)
mkdir /linuxprobe(创建名为linuxprobe的文件夹)
mount /dev/storage/vo /linuxprobe(挂载)
5.查看挂载状态,并写入到配置文件,使其永久生效。
例:df -h(查看挂载状态)
echo "/dev/storage/vo /linuxprobe ext4 defaults 0 0(写入配置文件)
如果要同时做LVM和RAID,则要先做RAID,再做LVM。
以下是部分学习笔记: