CN114138349A - Method, system, terminal and storage medium for mounting data partition - Google Patents

Method, system, terminal and storage medium for mounting data partition Download PDF

Info

Publication number
CN114138349A
CN114138349A CN202111365276.6A CN202111365276A CN114138349A CN 114138349 A CN114138349 A CN 114138349A CN 202111365276 A CN202111365276 A CN 202111365276A CN 114138349 A CN114138349 A CN 114138349A
Authority
CN
China
Prior art keywords
partition
file system
data partition
mounting
list
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.)
Withdrawn
Application number
CN202111365276.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.)
Suzhou Inspur Intelligent Technology Co Ltd
Original Assignee
Suzhou Inspur Intelligent 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 Suzhou Inspur Intelligent Technology Co Ltd filed Critical Suzhou Inspur Intelligent Technology Co Ltd
Priority to CN202111365276.6A priority Critical patent/CN114138349A/en
Publication of CN114138349A publication Critical patent/CN114138349A/en
Withdrawn legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/4401Bootstrapping
    • G06F9/4406Loading of operating system
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/0703Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation
    • G06F11/0706Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation the processing taking place on a specific hardware platform or in a specific software environment
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/0703Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation
    • G06F11/0793Remedial or corrective actions

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • Quality & Reliability (AREA)
  • Computer Security & Cryptography (AREA)
  • Hardware Redundancy (AREA)

Abstract

The invention relates to the technical field of servers, in particular to a method, a system, a terminal and a storage medium for mounting data partitions, which comprises the following steps: acquiring a data partition list of a linux operating system; checking the file system state associated with the data partition list, and starting a file system repair function when the file system state is confirmed to be abnormal; after the repair is successful, a data partition mount command is executed. The invention can ensure the successful mounting of the data partition, the normal starting of the specific function of the partition and the upper application thereof, and the service continuity.

Description

Method, system, terminal and storage medium for mounting data partition
Technical Field
The invention relates to the technical field of servers, in particular to a method, a system, a terminal and a storage medium for mounting a data partition.
Background
The data partition of Linux, also including the storage system developed based on Linux system, enables some data security mechanisms or advanced functions, such as file system check or quota, under the system. However, due to the fact that the disk partition is too large, situations that file system check fails, the partition cannot be mounted, a quota cannot be used and the like may exist, and therefore the service cannot be started. The conventional partition mounting method directly executes a partition mounting instruction, and after the partition cannot be mounted, factors which cannot be mounted are searched, so that the mounting efficiency of the data partition is greatly reduced, service interruption is caused, and the availability of a system is reduced.
Disclosure of Invention
In view of the above-mentioned deficiencies of the prior art, the present invention provides a method, a system, a terminal and a storage medium for mounting data partitions, so as to solve the above-mentioned technical problems.
In a first aspect, the present invention provides a method for mounting a data partition, including:
acquiring a data partition list of a linux operating system;
checking the file system state associated with the data partition list, and starting a file system repair function when the file system state is confirmed to be abnormal;
after the repair is successful, a data partition mount command is executed.
Further, before obtaining the data partition list of the operating system, the method further includes:
the automatic mount function of the linux operating system is disabled.
Further, the method further comprises:
if the file system is failed to repair, the hot spare disk is cancelled and the exchange area is used for expanding the capacity of the abnormal partition;
the file system repairing function is called again, and after the repairing is successful, a data partition mounting command is executed;
and starting the upper layer application, stopping the expanded exchange area partition and restoring the hard disk to the hot standby state.
In a second aspect, the present invention provides a system for mounting a data partition, including:
the list acquisition unit is used for acquiring a data partition list of the linux operating system;
the state checking unit is used for checking the file system state associated with the data partition list and starting a file system repair function when the file system state is confirmed to be abnormal;
and the partition mounting unit is used for executing the data partition mounting command after the repairing is successful.
Further, before executing the list obtaining unit, the system further includes:
and the basic setting unit is used for disabling the automatic mounting function of the linux operating system.
Further, the system further comprises:
the partition capacity expansion module is used for canceling the hot standby disk and expanding the capacity of the abnormal partition by using the exchange area if the file system fails to be repaired;
the secondary mounting module is used for recalling the file system repair function and executing a data partition mounting command after the repair is successful;
and the expansion stopping module is used for starting the upper application, stopping the expanded exchange partition and recovering the hard disk to a hot standby state.
In a third aspect, a terminal is provided, including:
a processor, a memory, wherein,
the memory is used for storing a computer program which,
the processor is used for calling and running the computer program from the memory so as to make the terminal execute the method of the terminal.
In a fourth aspect, a computer storage medium is provided having stored therein instructions that, when executed on a computer, cause the computer to perform the method of the above aspects.
The method, the system, the terminal and the storage medium for mounting the data partitions have the advantages that the partition list is obtained by reading the data partitions in the system, then file system check is carried out on the partitions in the list, and if the partitions are normal, mounting and upper-layer application are started; and if the partition is abnormal, repairing, successfully repairing, starting mounting and upper application, and if the repair is failed, continuously repairing after the swap partition is expanded by using the hot standby disk, and successfully starting mounting. By the method, the successful mounting of the data partition, the normal starting of the specific function of the partition and the upper application of the specific function can be ensured, and the service continuity is ensured.
In addition, the invention has reliable design principle, simple structure and very wide application prospect.
Drawings
In order to more clearly illustrate the embodiments or technical solutions in the prior art of the present invention, the drawings used in the description of the embodiments or prior art will be briefly described below, and it is obvious for those skilled in the art that other drawings can be obtained based on these drawings without creative efforts.
FIG. 1 is a schematic flow diagram of a method of one embodiment of the invention.
FIG. 2 is a schematic block diagram of a system of one embodiment of the present invention.
Fig. 3 is a schematic structural diagram of a terminal according to an embodiment of the present invention.
Detailed Description
In order to make those skilled in the art better understand the technical solution of the present invention, the technical solution in the embodiment of the present invention will be clearly and completely described below with reference to the drawings in the embodiment of the present invention, and it is obvious that the described embodiment is only a part of the embodiment of the present invention, and not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The following explains key terms appearing in the present invention.
Linux: the GNU/Linux is a free-use and free-propagation UNIX-like operating system, the kernel of which is released for the first time in 1991 by Linnas Benne Kett Towaz, and the operating system is mainly inspired by Minix and Unix ideas and is a multi-user, multi-task, multi-thread and multi-CPU supporting operating system based on POSIX and Unix. It can run major Unix tool software, applications, and network protocols. It supports 32-bit and 64-bit hardware. Linux inherits the design idea of Unix with network as core, and is a multi-user network operating system with stable performance. There are hundreds of different releases for Linux, such as debian, archlinux based on community development, and Red Hat Enterprise Linux, SUSE, oracle Linux based on commercial development, etc.
And (3) system partitioning: the partitions necessary for installing and running the Linux system can be generally divided into:
root directory for storing system commands and user data
Static link file of/boot loader, storing program related to Linux startup
A home user directory for storing data of common users
/tmp temporary file
/usr is the place for storing software in Red Hat Linux system
The/usr/local self-installed program is installed in the device
The data that is constantly changing by/var, some services of the server are put below.
Opt-attached application software package
/Swap switching area
Data partitioning: the partitions, except the system, are generally used for business data storage.
And (3) partition checking: the Linux file system may be damaged in various situations, such as a system crash, a sudden power failure, a disk disconnection, or an inadvertent overwriting of a file node (i-node), etc., and thus needs to check the file system.
And (3) repairing partitions: and repairing the partition by using a file system repairing tool, and correcting the abnormal state. However, due to insufficient system resources, such as insufficient memory capacity, the success rate of repair can be improved by capacity expansion (memory or swap partition).
A Swap partition: when the physical memory of the system is insufficient, the system exchanges with the Swap, and breaks through the limitation of the physical memory in function.
Quota (quota): the use amount of the user (user group) to the disk space is limited, and under the NAS sharing use mode, a plurality of user sharing partitions exist, so that the situation that a certain user excessively uses the disk space and other clients have no space to use is avoided. The available quota specifies the maximum available space for a user (user group).
FIG. 1 is a schematic flow diagram of a method of one embodiment of the invention. The execution subject in fig. 1 may be a system for mounting a data partition.
As shown in fig. 1, the method includes:
step 110, acquiring a data partition list of a linux operating system;
step 120, checking the file system state associated with the data partition list, and starting a file system repair function when the file system state is confirmed to be abnormal;
step 130, after the repair is successful, a data partition mount command is executed.
In order to facilitate understanding of the present invention, the method for mounting data partitions provided by the present invention is further described below with reference to the principle of the method for mounting data partitions of the present invention and the process of mounting data partitions performed by the operating system in the embodiment.
Specifically, taking the wave AS1500G2 data partition starting AS an example, the method for mounting the data partition includes:
s1, disabling automatic mounting of the partition system:
cp/etc/mtab/etc/mtab.bak.$date
echo“”>/etc/mtab
s2, acquiring a data partition list by using a cat instruction: cat/dev/iom _ block. The cat command is used to link files and print to standard output devices.
S3, checking the file system state based on the data partition list:
xfs_repair_adm-C/dev/iom_block_834。
the file system checking function is a self-contained function of the linux operating system, namely, each partition in a data partition list is traversed, and when the space of a certain partition is insufficient or a file is abnormal, the file is displayed in a checking result.
S4, repair file system xfs _ repair _ adm-l/dev/iom _ block _834
And starting a file system repair process of the linux system and executing file system repair.
S5, when the repair fails, the hot spare disk is cancelled, the swap partition of the mkswap capacity expansion system is executed, then the swap analysis is started by executing the swap command, and then the file system is repaired:
idisk-s=0/dev/vd-sdy
mkswap/dev/vd-sdy
swapon/dev/sdy
xfs_repair_adm-l/dev/iom_block_834。
when the physical memory of the system is not enough, the Swap partition releases a part of the space in the hard disk memory for the current running program to use. The freed space may come from programs that have not operated for a long time, is temporarily saved to the Swap partition, and the saved data is restored from the Swap partition to memory until the programs are run.
S6, completing the repair of the xfs _ repair _ adm, and executing mount partition of mount command
mkdir-p/fs/vg150803-data1
mount-o usrquota,grpquota-t xfs/dev/iom_block_834/fs/vg150803-data1。
S7, enabling upper application/etc/init.d/nfs restart.
S8, using swap off to stop expanded swap partition, and restoring hard disk to hot standby state
swapoff/dev/vd-sdy
idisk--global-s=1/dev/vd-sdy。
As shown in fig. 2, the system 200 includes:
the list acquisition unit is used for acquiring a data partition list of the linux operating system;
the state checking unit is used for checking the file system state associated with the data partition list and starting a file system repair function when the file system state is confirmed to be abnormal;
and the partition mounting unit is used for executing the data partition mounting command after the repairing is successful.
Optionally, as an embodiment of the present invention, before executing the list obtaining unit, the system further includes:
and the basic setting unit is used for disabling the automatic mounting function of the linux operating system.
Optionally, as an embodiment of the present invention, the system further includes:
the partition capacity expansion module is used for canceling the hot standby disk and expanding the capacity of the abnormal partition by using the exchange area if the file system fails to be repaired;
the secondary mounting module is used for recalling the file system repair function and executing a data partition mounting command after the repair is successful;
and the expansion stopping module is used for starting the upper application, stopping the expanded exchange partition and recovering the hard disk to a hot standby state.
Fig. 3 is a schematic structural diagram of a terminal 300 according to an embodiment of the present invention, where the terminal 300 may be used to execute the method for mounting data partition according to the embodiment of the present invention.
Among them, the terminal 300 may include: a processor 310, a memory 320, and a communication unit 330. The components communicate via one or more buses, and those skilled in the art will appreciate that the architecture of the servers shown in the figures is not intended to be limiting, and may be a bus architecture, a star architecture, a combination of more or less components than those shown, or a different arrangement of components.
The memory 320 may be used for storing instructions executed by the processor 310, and the memory 320 may be implemented by any type of volatile or non-volatile storage terminal or combination thereof, such as Static Random Access Memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk. The executable instructions in memory 320, when executed by processor 310, enable terminal 300 to perform some or all of the steps in the method embodiments described below.
The processor 310 is a control center of the storage terminal, connects various parts of the entire electronic terminal using various interfaces and lines, and performs various functions of the electronic terminal and/or processes data by operating or executing software programs and/or modules stored in the memory 320 and calling data stored in the memory. The processor may be composed of an Integrated Circuit (IC), for example, a single packaged IC, or a plurality of packaged ICs connected with the same or different functions. For example, the processor 310 may include only a Central Processing Unit (CPU). In the embodiment of the present invention, the CPU may be a single operation core, or may include multiple operation cores.
A communication unit 330, configured to establish a communication channel so that the storage terminal can communicate with other terminals. And receiving user data sent by other terminals or sending the user data to other terminals.
The present invention also provides a computer storage medium, wherein the computer storage medium may store a program, and the program may include some or all of the steps in the embodiments provided by the present invention when executed. The storage medium may be a magnetic disk, an optical disk, a read-only memory (ROM) or a Random Access Memory (RAM).
Therefore, the invention obtains the partition list by reading the data partition in the system, then carries out file system check on the partition in the list, and starts mounting and upper application if the partition is normal; and if the partition is abnormal, repairing, successfully repairing, starting mounting and upper application, and if the repair is failed, continuously repairing after the swap partition is expanded by using the hot standby disk, and successfully starting mounting. By the method, successful mounting of the data partition, normal starting of the partition specific function and the upper layer application thereof, and service continuity can be ensured.
Those skilled in the art will readily appreciate that the techniques of the embodiments of the present invention may be implemented as software plus a required general purpose hardware platform. Based on such understanding, the technical solutions in the embodiments of the present invention may be embodied in the form of a software product, where the computer software product is stored in a storage medium, such as a usb disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and the like, and the storage medium can store program codes, and includes instructions for enabling a computer terminal (which may be a personal computer, a server, or a second terminal, a network terminal, and the like) to perform all or part of the steps of the method in the embodiments of the present invention.
The same and similar parts in the various embodiments in this specification may be referred to each other. Especially, for the terminal embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant points can be referred to the description in the method embodiment.
In the embodiments provided in the present invention, it should be understood that the disclosed system and method can be implemented in other ways. For example, the above-described system embodiments are merely illustrative, and for example, the division of the units is only one logical functional division, and other divisions may be realized in practice, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, systems or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit.
Although the present invention has been described in detail by referring to the drawings in connection with the preferred embodiments, the present invention is not limited thereto. Various equivalent modifications or substitutions can be made on the embodiments of the present invention by those skilled in the art without departing from the spirit and scope of the present invention, and these modifications or substitutions are within the scope of the present invention/any person skilled in the art can easily conceive of the changes or substitutions within the technical scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.

Claims (8)

1. A method for mounting a data partition, comprising:
acquiring a data partition list of a linux operating system;
checking the file system state associated with the data partition list, and starting a file system repair function when the file system state is confirmed to be abnormal;
after the repair is successful, a data partition mount command is executed.
2. The method of claim 1, wherein prior to obtaining the list of data partitions for the operating system, the method further comprises:
the automatic mount function of the linux operating system is disabled.
3. The method of claim 1, further comprising:
if the file system is failed to repair, the hot spare disk is cancelled and the exchange area is used for expanding the capacity of the abnormal partition;
the file system repairing function is called again, and after the repairing is successful, a data partition mounting command is executed;
and starting the upper layer application, stopping the expanded exchange area partition and restoring the hard disk to the hot standby state.
4. A system for mounting a data partition, comprising:
the list acquisition unit is used for acquiring a data partition list of the linux operating system;
the state checking unit is used for checking the file system state associated with the data partition list and starting a file system repair function when the file system state is confirmed to be abnormal;
and the partition mounting unit is used for executing the data partition mounting command after the repairing is successful.
5. The system of claim 4, wherein prior to executing the list acquisition unit, the system further comprises:
and the basic setting unit is used for disabling the automatic mounting function of the linux operating system.
6. The system of claim 4, further comprising:
the partition capacity expansion module is used for canceling the hot standby disk and expanding the capacity of the abnormal partition by using the exchange area if the file system fails to be repaired;
the secondary mounting module is used for recalling the file system repair function and executing a data partition mounting command after the repair is successful;
and the expansion stopping module is used for starting the upper application, stopping the expanded exchange partition and recovering the hard disk to a hot standby state.
7. A terminal, comprising:
a processor;
a memory for storing instructions for execution by the processor;
wherein the processor is configured to perform the method of any one of claims 1-3.
8. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the method according to any one of claims 1-3.
CN202111365276.6A 2021-11-17 2021-11-17 Method, system, terminal and storage medium for mounting data partition Withdrawn CN114138349A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111365276.6A CN114138349A (en) 2021-11-17 2021-11-17 Method, system, terminal and storage medium for mounting data partition

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111365276.6A CN114138349A (en) 2021-11-17 2021-11-17 Method, system, terminal and storage medium for mounting data partition

Publications (1)

Publication Number Publication Date
CN114138349A true CN114138349A (en) 2022-03-04

Family

ID=80390180

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111365276.6A Withdrawn CN114138349A (en) 2021-11-17 2021-11-17 Method, system, terminal and storage medium for mounting data partition

Country Status (1)

Country Link
CN (1) CN114138349A (en)

Similar Documents

Publication Publication Date Title
JPH03278126A (en) Computer system starting system
CN111309524A (en) Distributed storage system fault recovery method, device, terminal and storage medium
CN110221938A (en) The method and storage medium of electronic device, block chain common recognition
CN114116280B (en) Interactive BMC self-recovery method, system, terminal and storage medium
CN110990190A (en) Distributed file lock fault processing method, system, terminal and storage medium
CN111181780A (en) HA cluster-based host pool switching method, system, terminal and storage medium
CN109344004A (en) A kind of memory database backup management method, device, terminal and storage medium
CN116521209B (en) Upgrading method and device of operating system, storage medium and electronic equipment
CN111221683A (en) Double-flash hot backup method, system, terminal and storage medium for data center switch
CN114138349A (en) Method, system, terminal and storage medium for mounting data partition
CN111090537A (en) Cluster starting method and device, electronic equipment and readable storage medium
CN115658152A (en) Firmware upgrading method, firmware, electronic device and computer readable storage medium
CN112527327A (en) Method, system, terminal and storage medium for factory restoration of UOS operating system
CN117234544B (en) Method and device for recovering system of server equipment
CN110109775A (en) Virtual machine restoration methods, device, terminal device and storage medium
CN112272220B (en) Cluster software start control method, system, terminal and storage medium
CN111475349B (en) Method, system, terminal and storage medium for testing stability of cluster DPDK
CN114816023B (en) Method, system, terminal and storage medium for optimizing standby power function of server
US11468094B2 (en) Computer system and fault tolerance processing method thereof of image file
CN117827255A (en) System, method and related equipment capable of realizing multi-computer cluster transaction heat update
CN110928563A (en) Pin management method, system, terminal and storage medium based on CPLD update
CN117762505A (en) Cross-version migration method and device for operating system
CN115469935A (en) Starting method of intelligent terminal and related equipment
CN116795620A (en) Redis server deployment method, electronic equipment and storage medium
CN116150111A (en) Method, device and medium for saving kernel crash log and electronic equipment

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
WW01 Invention patent application withdrawn after publication
WW01 Invention patent application withdrawn after publication

Application publication date: 20220304