基于LVM的系统扩容技术研究
2021-04-25魏培
魏培



摘要:近年来,随着大数据业务的使用,系统在运行时会产生大量的数据信息与日志文件并保存在磁盘中。由于在系统规划初期,对系统分区大小规划预期不足,很难合理规划磁盘空间,造成后期系统运行中经常出现系统分区磁盘不足的问题。当发生此类告警时,通常的分区很难动态调整大小,通常采用暂停业务,更换磁盘,数据备份与恢复的方式,该方式操作困难,程序复杂,有数据丢失的风险。在Linux系统里使用LVM(逻辑卷)技术,支持在线空间扩容,可以在用户无感知的情况下扩展系统分区容量,达到合理利用磁盘空间的目的。本文介绍了LVM技术,并在Linux系统里将分区做成逻辑卷,达到合理利用磁盘空间的目的。
关键词:LVM(逻辑卷);物理卷(PV);卷组(VG);逻辑卷(LV);扩容
中图分类号:TP391 文献标识码:A
文章编号:1009-3044(2021)09-0043-03
开放科学(资源服务)标识码(OSID):
Research on System Expansion Technology Based on LVM
WEI Pei
(AHCERT,Hefei 230041,China)
Abstract: In recent years, with the use of big data business, a large number of data information and files will be generated and saved in the disk when the system is running. In the early stage of system planning, the expected size of the system partition planning is insufficient, and it is difficult to plan the disk space reasonably, resulting in the frequent shortage of the system partition disk in the later stage of system operation. When the disk capability alarm occurs, the usual partition is difficult to dynamically resize, usually by suspending business, replacing disk, data backup and recovery, which is difficult to operate, complex program, and has the risk of data loss. LVM (logical volume) technology is used in Linux system to support online space expansion, and the system partition capacity can be expanded without user awareness, so as to achieve the purpose of reasonable utilization of disk space. This paper introduces LVM technology, and makes partitions into logical volumes in Linux system, so as to make reasonable use of disk space.
Key words: LVM (logical volume);Physical volume(PV);Volume group (VG);Logical volume (LV);expansion
1 背景
目前Linux系统在正常运行中经常出现两个亟待解决的问题,一是某些系统分区利用率随着系统运行增长很快常达到90%多,需要人工清除历史文件或者迁移数据达到磁盘正常使用、业务正常运行的目的,二是在系统的运行中某些分区的数据量变化不大、分区利用率相对稳定,如果在系统规划时预留了较大的空间,这时这些空间不易划分给急需空间的分区使用,造成资源分配不均,磁盘空间浪费的现象。由此可见,找到系统在线运行时合理利用、调配磁盘资源的方法是亟待解决的问题。LVM技术的使用,尤其结合网络挂载的方式的使用可以很好地解决合理利用磁盘空间的目的。……
