CN108874317A - The automatic flash chamber of logical volume subregion and method under a kind of linux system - Google Patents

The automatic flash chamber of logical volume subregion and method under a kind of linux system Download PDF

Info

Publication number
CN108874317A
CN108874317A CN201810578893.6A CN201810578893A CN108874317A CN 108874317 A CN108874317 A CN 108874317A CN 201810578893 A CN201810578893 A CN 201810578893A CN 108874317 A CN108874317 A CN 108874317A
Authority
CN
China
Prior art keywords
logical volume
subregion
volume
name
partition
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201810578893.6A
Other languages
Chinese (zh)
Inventor
赵伟
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Zhengzhou Yunhai Information Technology Co Ltd
Original Assignee
Zhengzhou Yunhai Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Zhengzhou Yunhai Information Technology Co Ltd filed Critical Zhengzhou Yunhai Information Technology Co Ltd
Priority to CN201810578893.6A priority Critical patent/CN108874317A/en
Publication of CN108874317A publication Critical patent/CN108874317A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0602Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
    • G06F3/0604Improving or facilitating administration, e.g. storage management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0629Configuration or reconfiguration of storage systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0638Organizing or formatting or addressing of data
    • G06F3/0644Management of space entities, e.g. partitions, extents, pools

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Human Computer Interaction (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The present invention provides the automatic flash chamber of logical volume subregion, the devices under a kind of linux system to include:Input module, for inputting logical volume partition name to be expanded and the Disk name of logical volume is added;First obtains module, claims for obtaining volumegroup name according to logical volume partition name;Processing module for the disk dilatation of logical volume will to be added to logical volume subregion, and makes dilatation come into force.Logical volume dilatation step can be formed and be automated by the design, thus can be reduced manual operation, and reducing human factor influences, to improve efficiency, guarantee the safety of subregion.In addition, the present invention also provides the automatic expansion methods of logical volume subregion under a kind of linux system.

Description

The automatic flash chamber of logical volume subregion and method under a kind of linux system
Technical field
The present invention relates to design Storage fields, expand automatically more specifically to logical volume subregion under a kind of linux system Capacitance device and method.
Background technique
Logical volume is to organize several disk partition or block device to form a big extension subregion, when in use It is divided into logical volume subregion, is then formatted into different file system, carry uses.With directly use physical disk phase There is lot of advantages than, logical volume, for example, can flexibly configure logical volume capacity, can be with dilatation or reduction logical volume subregion Size and do not have to reformat subregion etc..
In the project, the case where frequently encountering under server system that subregion is inadequate, needing manual dilatation.Previous way is Referring to document, go to execute step by step.Disadvantage of this is that complex steps, inefficiency, and there are certain risks.Such as Fruit operator is unfamiliar with order or server apparatus situation, easily makes a fault operating, subregion is caused to occur Failure causes loss of data.
Summary of the invention
For disadvantage mentioned above, the invention proposes the automatic flash chamber of logical volume subregion and method under a kind of linux system, Logical volume dilatation step can be formed and be automated, thus can be reduced manual operation, reducing human factor influences, to improve Efficiency guarantees the safety of subregion.
The embodiment of the invention provides the automatic flash chamber of logical volume subregion under a kind of linux system, the device packets It includes:
Input module, for inputting logical volume partition name to be expanded and the Disk name of logical volume is added;
First obtains module, claims for obtaining volumegroup name according to logical volume partition name;
Processing module for the disk dilatation of logical volume will to be added to logical volume subregion, and makes dilatation come into force.
Further, the processing module includes:
First processing module will be added the disk partition of volume group and be formatted as lvm format;
Second processing module, by the partition creating formatted at physical volume;
Third processing module, volume group physical volume being added to where logical volume subregion to be expanded;
Fourth processing module, by space dilatation idle in volume group to logical volume subregion;
5th processing module, decision logic roll up partitioned file system format;
6th processing module makes dilatation come into force according to file system type synchronization file system.
Further, the device further includes:
Second obtains module, obtains and shows the system partitioning information after synchronizing.
The embodiment of the invention provides the automatic expansion method of logical volume subregion, the methods under a kind of linux system to be:
S1:It inputs logical volume partition name to be expanded and the Disk name of logical volume is added;
S2:Volumegroup name is obtained according to logical volume partition name to claim;
S3:The disk partition of volume group will be added and be formatted as lvm format;
S4:By the partition creating formatted at physical volume;
S5:Volume group physical volume being added to where logical volume subregion to be expanded;
S6:By space dilatation idle in volume group to logical volume subregion;
S7:Decision logic rolls up partitioned file system format;
S8:According to file system type synchronization file system, dilatation is made to come into force;
S9:Return to the system partitioning information after synchronizing.
Further, in step S2, by the order lvdisply under Linux system, the logical volume of current system is shown Information obtains volumegroup name and claims.
Further, in step S3, disk partition is formatted as by lvm format by fdisk order.
Further, in step S7, using xfs_growfs command determination XFS format, resize2fs command determination is used Ext, ext2, ext3, ext4 format.
Further, in step S8, the method that makes dilatation come into force:Subregion is rolled up by system command flush logic.
Further, the realization process of step S9 is:Df-lh order is executed, return system partition information is primarily to see and patrols Collect the current size of volume subregion, Avail column.
The effect provided in summary of the invention is only the effect of embodiment, rather than invents all whole effects, above-mentioned A technical solution in technical solution has the following advantages that or beneficial effect:
In the present invention, the integration executed by system command and program, on the one hand, integrate cumbersome step automatic Change, reduces operating procedure, the time is saved, to improve efficiency;On the other hand, the program and instruction executed automatically, avoids Human factor influences, and guarantees partition security.
Detailed description of the invention
Fig. 1 is the schematic diagram of device of the embodiment of the present invention;
Fig. 2 is the method flow diagram of the embodiment of the present invention.
Specific embodiment
In order to clarify the technical characteristics of the invention, below by specific embodiment, and its attached drawing is combined, to this hair It is bright to be described in detail.Following disclosure provides many different embodiments or example is used to realize different knots of the invention Structure.In order to simplify disclosure of the invention, hereinafter the component of specific examples and setting are described.In addition, the present invention can be with Repeat reference numerals and/or letter in different examples.This repetition is that for purposes of simplicity and clarity, itself is not indicated Relationship between various embodiments and/or setting is discussed.It should be noted that illustrated component is not necessarily to scale in the accompanying drawings It draws.Present invention omits the descriptions to known assemblies and treatment technology and process to avoid the present invention is unnecessarily limiting.
Embodiment
As shown in Figure 1, the embodiment of the present invention 1 provides the automatic flash chamber of logical volume subregion under a kind of linux system, institute The device stated includes input module, the first acquisition module, processing module and the second acquisition module.
The input module, for inputting logical volume partition name to be expanded and the disk name of logical volume is added Claim.
Described first obtains module, by lvdisply order, for obtaining volumegroup name according to logical volume partition name Claim.
The processing module for the disk dilatation of logical volume will to be added to logical volume subregion, and makes dilatation come into force.
According to the process of processing, the processing module is divided into 6 parts, is first processing module, second processing respectively Module, third processing module, fourth processing module, the 5th processing module, the 6th processing module.
Wherein, first processing module mainly passes through fdisk order.The disk partition of volume group and formatting will be added For lvm format.Then, the partition creating that Second processing module is responsible for have formatted is at physical volume.Then, third handles mould Block, volume group physical volume being added to where logical volume subregion to be expanded.Next, fourth processing module, hollow by volume group Not busy space dilatation is to logical volume subregion.After the completion of dilatation, the 5th processing module is responsible for decision logic volume partitioned file system lattice Formula, the mainly common format of difference ext, ext2, ext3, ext4 and XFS these types, finally, the 6th processing module is according to text Part system type synchronization file system, makes dilatation come into force.
The second acquisition module obtains after the completion of dilatation and shows the system partitioning information after synchronizing, Ke Yicha See capacity enlargement effect.
As shown in Fig. 2, the embodiment of the invention provides the automatic expansion method of logical volume subregion, institutes under a kind of linux system The method stated is:
S1:It inputs logical volume partition name to be expanded (/dev/mapper/vg-home) and the magnetic of logical volume is added Disk title (/dev/sdb).
S2:It obtains volumegroup name according to logical volume partition name to claim, specific means is:Using lvdisply order, from In lvdisplay information, the title of lv and the title of vg are first matched, then extracts vg title.
When actually executing, implementation procedure is as follows:
Screen in the information that lvdisplay is exported using order, orders and be:lvdisplay|sed-n'/ Home/ ,/VG/p'| awk'{ print $ 3 } ' | sed-n'3p'lvdisplay | sed-n'/home/ ,/VG/p', this order in Home is logical volume partition name, can be used in script as variable, this order effect is exactly to print matching logic volume The row of entitled home starts to all the elements between the row of matching VG, then prints the 3rd column using awk order Lvdisplay | sed-n'/home/ ,/VG/p'| awk'{ print $ 3 } ', sed order is finally reused, the third line is printed, Obtain the title lvdisplay of VG | sed-n'/home/ ,/VG/p'| awk'{ print $ 3 } ' | sed-n'3p'.
S3:The disk partition of volume group will be added and be formatted as lvm format.Wherein, physical volume is in logical volume management The bottom of system can be the subregion on entire physical hard disk or actual physics hard disk.Volume group (VG) is built upon physics On volume, a volume group at least will include a physical volume.Volume group can be exactly this in dynamic additive reason reel-to-reel group after establishing The dilatation mentioned in application.Popular saying is exactly that volume group space is not much of that, and one piece of disk is added.
Formatting in step S3 realized by fdisk order, such as:Np1t8e is exactly the option of the inside, subregion lattice The corresponding hexadecimal code of formula LVM is exactly 8e.
S4:By the partition creating formatted at physical volume.For example,/dev/sdb1 is exactly that physical hard disk/dev/sdb makes The subregion created with fdisk order, creation physical volume order are exactly pvcreate, the included order of system, execution [root@Tone~] #pvcreate/dev/sdb1;Physical volume"/dev/sdb1"successfully creaded。
S5:Volume group physical volume being added to where logical volume subregion to be expanded.This is also the included order of system, Execution, format are vgextend+VG title+physical volume title.
S6:By space dilatation idle in volume group to logical volume subregion.Command format is lvextend-l+100%FREE Logical volume partition name.Because newly joined one piece of physical volume, 100%FREE parameter is exactly all surplus in volume group (VG) Remaining free space is added in specified logical volume subregion.
S7:Decision logic rolls up partitioned file system format.
It should be noted that there are many file system format, such as Linux file-system types:minix,ext, ext2,ext3,ext4,Reiserfs,XFS,JFS,xia,msdos,umsdos,vfat,ntfs,proc,nfs,iso9660, Hpfs, sysv, smb, ncpfs, the common format of this patent main distinction ext, ext2, ext3, ext4 and XFS these types.
XFS is needed with xfs_growfs order, and ext, ext2, ext3, ext4 format are needed with resize2fs order.Example When such as, by xfs_info command determination, this order is to return to xfs filesystem information, if it is the system of xfs format Relevant information will be returned to, command execution results return to 0;If not xfs format, it is returned to the information of mistake, order is held Row result returns to 1.Code is xfs format according to 0 or 1 judgement is returned the result.
S8:According to file system type synchronization file system, dilatation is made to come into force.It was mentioned in step S7, XFS needs to use Xfs_growfs order;Ext, ext2, ext3, ext4 format are needed with resize2fs order, this process of step S8 is to expand This order is executed after appearance, it can be understood as refresh, change is allowed to come into force.In step S8, the format of order is exactly to order+logical volume Subregion.
S9:Return to the system partitioning information after synchronizing.The process is exactly to perform df-lh order, return system subregion letter Breath is primarily to see the current size of logical volume subregion, Avail column.Further, it is also possible to record the size before dilatation, returned after dilatation Return dilatation information in how many space.
Although specification and drawings and examples have been carried out detailed description to the invention, this field skill Art personnel should be appreciated that and still can be modified or replaced equivalently to the invention;And all do not depart from wound of the present invention The technical solution and its improvement for the spirit and scope made, are encompassed by the protection scope of the invention patent.

Claims (9)

1. the automatic flash chamber of logical volume subregion under a kind of linux system, it is characterized in that:The device includes:
Input module, for inputting logical volume partition name to be expanded and the Disk name of logical volume is added;
First obtains module, claims for obtaining volumegroup name according to logical volume partition name;
Processing module for the disk dilatation of logical volume will to be added to logical volume subregion, and makes dilatation come into force.
2. the automatic flash chamber of logical volume subregion under a kind of linux system according to claim 1, it is characterized in that:It is described Processing module include:
First processing module will be added the disk partition of volume group and be formatted as lvm format;
Second processing module, by the partition creating formatted at physical volume;
Third processing module, volume group physical volume being added to where logical volume subregion to be expanded;
Fourth processing module, by space dilatation idle in volume group to logical volume subregion;
5th processing module, decision logic roll up partitioned file system format;
6th processing module makes dilatation come into force according to file system type synchronization file system.
3. the automatic flash chamber of logical volume subregion under a kind of linux system according to claim 1 or 2, it is characterized in that:Institute The device stated further includes:
Second obtains module, obtains and shows the system partitioning information after synchronizing.
4. the automatic expansion method of logical volume subregion under a kind of linux system, it is characterized in that:The method is:
S1:It inputs logical volume partition name to be expanded and the Disk name of logical volume is added;
S2:Volumegroup name is obtained according to logical volume partition name to claim;
S3:The disk partition of volume group will be added and be formatted as lvm format;
S4:By the partition creating formatted at physical volume;
S5:Volume group physical volume being added to where logical volume subregion to be expanded;
S6:By space dilatation idle in volume group to logical volume subregion;
S7:Decision logic rolls up partitioned file system format;
S8:According to file system type synchronization file system, dilatation is made to come into force;
S9:Return to the system partitioning information after synchronizing.
5. the automatic expansion method of logical volume subregion under a kind of linux system according to claim 4, it is characterized in that:Step In S2, by the order lvdisply under Linux system, the logic volume information of current system is shown, obtain volumegroup name and claim.
6. the automatic expansion method of logical volume subregion under a kind of linux system according to claim 4, it is characterized in that:Step In S3, disk partition is formatted as by lvm format by fdisk order.
7. the automatic expansion method of logical volume subregion under a kind of linux system according to claim 4, it is characterized in that:Step In S7, using xfs_growfs command determination XFS format, resize2fs command determination ext, ext2, ext3, ext4 lattice are used Formula.
8. the automatic expansion method of logical volume subregion under a kind of linux system according to claim 4, it is characterized in that:Step In S8, the method that makes dilatation come into force:Subregion is rolled up by system command flush logic.
9. the automatic expansion method of logical volume subregion under a kind of linux system according to claim 4, it is characterized in that:Step The realization process of S9 is:Execute df-lh order, return system partition information, be primarily to see the current size of logical volume subregion, Avail column.
CN201810578893.6A 2018-06-07 2018-06-07 The automatic flash chamber of logical volume subregion and method under a kind of linux system Pending CN108874317A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810578893.6A CN108874317A (en) 2018-06-07 2018-06-07 The automatic flash chamber of logical volume subregion and method under a kind of linux system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810578893.6A CN108874317A (en) 2018-06-07 2018-06-07 The automatic flash chamber of logical volume subregion and method under a kind of linux system

Publications (1)

Publication Number Publication Date
CN108874317A true CN108874317A (en) 2018-11-23

Family

ID=64337201

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810578893.6A Pending CN108874317A (en) 2018-06-07 2018-06-07 The automatic flash chamber of logical volume subregion and method under a kind of linux system

Country Status (1)

Country Link
CN (1) CN108874317A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110489062A (en) * 2019-08-27 2019-11-22 浪潮云信息技术有限公司 A kind of disk expansion method and system based on OpenStack environment
CN111930707A (en) * 2020-07-10 2020-11-13 江苏安超云软件有限公司 Method and system for correcting drive letter of windows cloud migration
CN113766008A (en) * 2021-08-06 2021-12-07 苏州浪潮智能科技有限公司 method, system, terminal and storage medium for dynamically adjusting storage capacity under mcs

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080010421A1 (en) * 2006-07-10 2008-01-10 Inventec Corporation Snapshot expansion system and method thereof
CN104317675A (en) * 2014-11-21 2015-01-28 华为技术有限公司 Disaster tolerance treatment method and device of applications
CN105528302A (en) * 2015-12-03 2016-04-27 Tcl集团股份有限公司 Logical volume-based method and system for dynamically managing disk
CN106168885A (en) * 2016-07-18 2016-11-30 浪潮(北京)电子信息产业有限公司 A kind of method and system of logical volume dynamic capacity-expanding based on LVM

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080010421A1 (en) * 2006-07-10 2008-01-10 Inventec Corporation Snapshot expansion system and method thereof
CN104317675A (en) * 2014-11-21 2015-01-28 华为技术有限公司 Disaster tolerance treatment method and device of applications
CN105528302A (en) * 2015-12-03 2016-04-27 Tcl集团股份有限公司 Logical volume-based method and system for dynamically managing disk
CN106168885A (en) * 2016-07-18 2016-11-30 浪潮(北京)电子信息产业有限公司 A kind of method and system of logical volume dynamic capacity-expanding based on LVM

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
UREY_PP: "CentOS6、7LVM逻辑卷分区自动扩容Shell脚本编程思路与实例", 《HTTPS://BLOG.51CTO.COM/DGD2010/1619692》 *
散尽浮华: "LVM基础详细说明及动态扩容lvm逻辑卷的操作记录", 《HTTPS://WWW.CNBLOGS.COM/KEVINGRACE/P/5845634.HTML》 *
沙滩上的前浪: "为LVM的逻辑卷扩容(CentOS 6)", 《HTTPS://BLOG.CSDN.NET/U012918303/ARTICLE/DETAILS/44492283?UTM_MEDIUM=DISTRIBUTE.PC_RELEVANT.NONE-TASK-BLOG-TITLE-14&SPM=1001.2101.3001.4242》 *

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110489062A (en) * 2019-08-27 2019-11-22 浪潮云信息技术有限公司 A kind of disk expansion method and system based on OpenStack environment
CN111930707A (en) * 2020-07-10 2020-11-13 江苏安超云软件有限公司 Method and system for correcting drive letter of windows cloud migration
CN111930707B (en) * 2020-07-10 2022-08-02 江苏安超云软件有限公司 Method and system for correcting drive letter of windows cloud migration
CN113766008A (en) * 2021-08-06 2021-12-07 苏州浪潮智能科技有限公司 method, system, terminal and storage medium for dynamically adjusting storage capacity under mcs

Similar Documents

Publication Publication Date Title
CN108874317A (en) The automatic flash chamber of logical volume subregion and method under a kind of linux system
CN105354036B (en) Database manipulation code generating method and device
CN110908859B (en) Application service processing method, device, terminal and storage medium
CN105138752B (en) Intelligent substation SCD file land parcel change trace differentiation compares and methods of exhibiting
CN107273122A (en) Based on decoupling mechanism can iteration set up operation system method and its terminal
CN106681956A (en) Method and device for operating large-scale computer cluster
CN109672712A (en) Method of data synchronization, device, super controller, domain controller and storage medium
CN109062820A (en) A kind of software performance testing method and device
CN115730008A (en) Log analysis method, data synchronization system, electronic device and storage medium
CN110502482A (en) User interface configuration method, system and data manipulation method
CN107943912A (en) A kind of response type Resource TOC data visualization management method, terminal and device
CN104090779B (en) Method of automatic configuration and cloud compiling system
CN109543300A (en) A kind of method of pixel device in extraction domain
CN106648618B (en) Text information generation method and device for virtual application
CN110489686A (en) A kind of data analysing method, device and terminal
CN110222169A (en) A kind of visualized data processing resolution system and its processing method
CN105808595B (en) A kind of the data library generating method and device of authority file
CN112256500B (en) Storage system test server configuration method, system, terminal and storage medium
CN110489432B (en) Model-based database automatic synchronization method, medium, equipment and device
CN109614443B (en) DDL synchronization method and device for V9.7 version DB2 database
CN102867017A (en) Method and client for constructing character library of input method
JP5833908B2 (en) Operation procedure creation support system and creation method
CN107704367A (en) A kind of resource period information displaying method and device
CN111738874A (en) Method and device for automatically generating operation steps of new power grid equipment based on starting model
CN108182189B (en) Material table file generation method and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20181123