[go: up one dir, main page]

CN112114900B - Formatting method and related equipment - Google Patents

Formatting method and related equipment Download PDF

Info

Publication number
CN112114900B
CN112114900B CN202010986398.6A CN202010986398A CN112114900B CN 112114900 B CN112114900 B CN 112114900B CN 202010986398 A CN202010986398 A CN 202010986398A CN 112114900 B CN112114900 B CN 112114900B
Authority
CN
China
Prior art keywords
file system
formatting
block device
target
attribute
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.)
Active
Application number
CN202010986398.6A
Other languages
Chinese (zh)
Other versions
CN112114900A (en
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.)
Beijing Kingsoft Cloud Network Technology Co Ltd
Original Assignee
Beijing Kingsoft Cloud Network 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 Beijing Kingsoft Cloud Network Technology Co Ltd filed Critical Beijing Kingsoft Cloud Network Technology Co Ltd
Priority to CN202010986398.6A priority Critical patent/CN112114900B/en
Publication of CN112114900A publication Critical patent/CN112114900A/en
Application granted granted Critical
Publication of CN112114900B publication Critical patent/CN112114900B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; 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/445Program loading or initiating
    • G06F9/44505Configuring for program initiating, e.g. using registry, configuration files
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; 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/445Program loading or initiating
    • G06F9/44521Dynamic linking or loading; Link editing at or after load time, e.g. Java class loading
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; 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/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (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 application discloses a formatting method and related equipment, the method comprising: after receiving a container startup request, first obtaining formatting parameters of a block device to be mounted, and determining a target file system format attribute of the block device to be mounted according to the formatting parameters; when it is determined that the target file system format attribute meets a first preset condition, formatting the block device to be mounted, and mounting the formatted block device to be mounted to a target container in a startup state, so that the formatting of the block device to be mounted can be completed during the startup process of the target container.

Description

Formatting method and related equipment
Technical Field
The present application relates to the field of computer technologies, and in particular, to a formatting method and related devices.
Background
In the cluster system based on kubernetes (k 8s for short) and kata, for a virtual machine as a computing node, a block device (such as a cloud hard disk) is directly mounted not in the form of a directory into a container on the virtual machine, but in the form of a device into a container deployed on the virtual machine.
However, the user cannot directly format the block device in the container due to the limitation of the user authority, so that how to format the block device mounted in the container is a technical problem to be solved.
Disclosure of Invention
In order to solve the technical problems in the prior art, the application provides a formatting method and related equipment, which can realize formatting processing of block equipment mounted in a container.
In order to achieve the above object, the technical solution provided by the embodiments of the present application is as follows:
the embodiment of the application provides a formatting method, which comprises the following steps:
After receiving a container starting request, obtaining formatting parameters of block equipment to be mounted;
Determining the format attribute of the target file system of the block equipment to be mounted according to the formatting parameters;
And when the format attribute of the target file system meets a first preset condition, formatting the block equipment to be mounted, and mounting the formatted block equipment to be mounted into a target container in a starting state.
Optionally, the determining, according to the formatting parameter, a format attribute of the target file system of the block device to be mounted includes:
acquiring the format attribute of an initial file system of the block equipment to be mounted;
determining target attribute prefix words according to the formatting parameters;
and taking the target attribute prefix word as the prefix of the initial file system format attribute to obtain the target file system format attribute of the block equipment to be mounted.
Optionally, the formatting the block to be mounted device includes:
determining a target file system type according to the target file system format attribute;
Determining a target formatting tool according to the type of the target file system; the target formatting tool is used for formatting the file system of the block to be mounted device into the target file system type;
And formatting the block equipment to be mounted by using the target formatting tool.
Optionally, the determining that the target file system format attribute meets a first preset condition includes:
determining that an attribute prefix word in the target file system format attribute meets a first sub-condition;
Or alternatively
And determining that the attribute prefix word in the target file system format attribute meets a second sub-condition, and determining that the file system of the block to be mounted equipment meets a third sub-condition.
Optionally, the obtaining the formatting parameter of the block to be mounted device includes:
acquiring a configuration file of the block equipment to be mounted;
and analyzing the configuration file of the block equipment to be mounted to obtain formatting parameters of the block equipment to be mounted.
Optionally, the method further comprises:
and when the format attribute of the target file system meets a second preset condition, mounting the block equipment to be mounted into a target container in a starting state.
Optionally, the determining that the target file system format attribute meets a second preset condition includes:
determining that an attribute prefix word in the format attribute of the target file system meets a second sub-condition, and determining that a file system of the block to be mounted equipment meets a fourth sub-condition;
Or alternatively
And determining that the attribute prefix word in the target file system format attribute meets a fifth sub-condition.
The embodiment of the application also provides a formatting device, which comprises:
The acquisition unit is used for acquiring formatting parameters of the block equipment to be mounted after receiving a container starting request;
The determining unit is used for determining the format attribute of the target file system of the block equipment to be mounted according to the formatting parameters;
And the formatting unit is used for formatting the block equipment to be mounted when the format attribute of the target file system meets a first preset condition, and mounting the formatted block equipment to be mounted into a target container in a starting state.
The embodiment of the application also provides equipment, which comprises a processor and a memory:
the memory is used for storing a computer program;
the processor is configured to execute any implementation of the formatting method provided by the embodiment of the present application according to the computer program.
The embodiment of the application also provides a computer readable storage medium for storing a computer program for executing any implementation of the formatting method provided by the embodiment of the application.
Compared with the prior art, the embodiment of the application has at least the following advantages:
In the formatting method provided by the embodiment of the application, after receiving a container starting request, the formatting parameters of the block equipment to be mounted can be obtained first, and the format attribute of the target file system of the block equipment to be mounted can be determined according to the formatting parameters; when the format attribute of the target file system meets the first preset condition, formatting the block equipment to be mounted, and mounting the formatted block equipment to be mounted into a target container in a starting state, so that the formatting process of the block equipment to be mounted can be completed in the starting process of the target container.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings that are required in the embodiments or the description of the prior art will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments described in the present application, and other drawings may be obtained according to the drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flow chart of a formatting method according to an embodiment of the present application;
Fig. 2 is an application scenario schematic diagram of a formatting method according to an embodiment of the present application;
fig. 3 is a flowchart of a formatting method applied to the application scenario shown in fig. 2 according to an embodiment of the present application;
fig. 4 is a schematic structural diagram of a formatting device according to an embodiment of the present application;
Fig. 5 is a schematic diagram of an apparatus structure according to an embodiment of the present application.
Detailed Description
In order to make the present application better understood by those skilled in the art, the following description will clearly and completely describe the technical solutions in the embodiments of the present application with reference to the accompanying drawings, and it is apparent that the described embodiments are only some embodiments of the present application, not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the application without making any inventive effort, are intended to be within the scope of the application.
Method embodiment
Referring to fig. 1, a flowchart of a formatting method according to an embodiment of the present application is shown.
The formatting method provided by the embodiment of the application comprises S101-S103:
S101: and after receiving the container starting request, obtaining the formatting parameters of the block equipment to be mounted.
The container start request is for requesting to start a target container in the virtual machine, and the target container refers to a container deployed in the virtual machine for the block device to be mounted.
The block device to be mounted refers to a block device to be mounted in a container in a virtual machine, and the embodiment of the application is not limited to the block device to be mounted, for example, the block device to be mounted may be a cloud hard disk (EBS disk for short).
The formatting parameter is used to characterize the relevant information of the formatting process of the block to be mounted device, and the embodiment of the present application is not limited to the formatting parameter, for example, the formatting parameter may be Always, ifNotFormat or lever.
Always is used to identify mandatory formatting. The forced formatting means that each piece of equipment mounted in the container must be formatted in the starting-up process of the container. At this time, a once formatted disk may be once again subjected to forced formatting. In addition, the application scene of the forced formatting is as follows: when it is desired to perform file system replacement or data cleaning of the block devices mounted in the container, forced formatting may be selected. It should be noted that, for data security, mandatory formatting should be avoided as a configuration default for the formatting parameters of each block device.
IfNotFormat are used to identify a block device that only formats an unformatted block. Wherein, only formatting the block device without formatting means that the block device mounted to the container for the first time is automatically formatted in the boot process of the container. It can be seen that if a block device is mounted to the container for the first time, it is determined that the block device is a block device that has not undergone formatting, so that the block device needs to be subjected to formatting; if a block device is not N (N.gtoreq.2) th mounted to the container, determining that the block device is a formatted block device, so that the block device does not need to be formatted again.
Never is used to indicate that formatting is prohibited. The prohibition of formatting refers to that all block devices mounted in the container are not formatted in any condition in the starting-up process of the container. It can be seen that this protects the user data from being corrupted by accidental formatting, causing unnecessary losses, so that for data security reasons, the forbidden formatting can be taken as a configuration default for the formatting parameters of each block device.
In addition, the embodiment of the application also provides an implementation manner for obtaining the formatting parameters (that is, S101) of the block to be mounted equipment, which specifically includes: and acquiring the configuration file of the block equipment to be mounted, and analyzing the configuration file of the block equipment to be mounted to obtain the formatting parameters of the block equipment to be mounted. The configuration file is used for recording relevant configuration parameters of the block equipment to be mounted, and the configuration file of the block equipment to be mounted comprises formatting parameters of the block equipment to be mounted. It should be noted that the embodiment of the present application is not limited to the configuration file, and for example, the configuration file may be a json file.
Based on the above-mentioned content related to S101, after receiving the container start request for requesting to start the target container, it may be determined that the target container is in a start-up state, at this time, a configuration file of the block device to be mounted may be obtained first, and then the configuration file may be subjected to format parameter analysis to obtain the format parameters of the block device to be mounted, so that the block device to be mounted may be formatted based on the format parameters.
S102: and determining the format attribute of the target file system of the block equipment to be mounted according to the format parameters of the block equipment to be mounted.
The target file system format attribute is used to characterize a file system (e.g., xfs file system, ext4 file system, and other file systems, etc.) that the block device to be mounted should have when mounting the block device to be mounted to the target container, and type information of formatting processing that the block device to be mounted should undergo before mounting the block device to be mounted to the target container (e.g., types of forced formatting, formatting only non-formatted block devices, or inhibit formatting, etc.).
In addition, the embodiment of the present application further provides an implementation manner for determining the format attribute of the target file system (i.e. S102), which specifically includes S1021-S1023:
s1021: and acquiring the format attribute of the initial file system of the block equipment to be mounted.
The initial file system format attribute is used to characterize the file system (e.g., xfs file system, ext4 file system, and other file systems, etc.) that the block device to be mounted should have when mounting the block device to be mounted to the target container.
In addition, the embodiment of the present application further provides an implementation manner for obtaining the format attribute of the initial file system (i.e. S1021), which specifically includes: analyzing the configuration file of the block equipment to be mounted to obtain the format attribute of the initial file system of the block equipment to be mounted. It can be seen that the configuration file of the block device to be mounted may include not only the formatting parameters of the block device to be mounted, but also the format attribute of the initial file system of the block device to be mounted.
S1022: and determining the target attribute prefix word according to the formatting parameters of the block equipment to be mounted.
The target attribute prefix word is used to characterize type information of formatting processing that the block device to be mounted should undergo before mounting the block device to be mounted to the target container (e.g., types of forced formatting, formatting only non-formatted block devices, or prohibited formatting, etc.), and the target attribute prefix word may be added to the initial file system format attribute as a prefix word of the initial file system format attribute.
In addition, the embodiment of the application also provides an implementation manner for determining the target attribute prefix word (namely S1022), which specifically comprises the following steps: and determining the target attribute prefix word according to the first mapping relation and the formatting parameters of the block equipment to be mounted. The first mapping relation comprises a corresponding relation between formatting parameters of the block equipment to be mounted and target attribute prefix words.
The first mapping relationship is used for recording between each formatting parameter and each attribute prefix word, and the embodiment of the present application is not limited to the first mapping relationship, and the first mapping relationship may be a mapping relationship shown in table 1.
Formatting parameters Attribute prefix words
Always format-
ifNotFormat tryformat-
Never (Without attribute prefix word)
Table 1 correspondence between different formatting parameters and prefix words of different attributes
Based on the above-mentioned related content of S1022, after the formatting parameter of the block device to be mounted is obtained, the target attribute prefix word of the block device to be mounted may be determined according to the formatting parameter of the block device to be mounted, which specifically includes: when the first mapping relation comprises the corresponding relation shown in table 1, if the formatting parameter of the block equipment to be mounted is Always, knowing that the target attribute prefix word of the block equipment to be mounted is format-based on the first mapping relation, so that the format-serving as the prefix word can be added to the initial file system format attribute of the block equipment to be mounted subsequently to obtain the target file system format attribute of the block equipment to be mounted; if the formatting parameter of the block equipment to be mounted is ifNotFormat, knowing that the target attribute prefix word of the block equipment to be mounted is tryformat-based on the first mapping relation, so that tryformat-serving as the prefix word can be added to the initial file system format attribute of the block equipment to be mounted to obtain the target file system format attribute of the block equipment to be mounted; if the formatting parameter of the block to be mounted equipment is new, the target attribute prefix word of the block to be mounted equipment can be known to be null based on the first mapping relation, so that the initial file system format attribute of the block to be mounted equipment can be directly used as the target file system format attribute of the block to be mounted equipment, and any attribute prefix word is not required to be added.
S1023: and taking the target attribute prefix word as the prefix of the initial file system format attribute of the block equipment to be mounted to obtain the target file system format attribute of the block equipment to be mounted.
In the embodiment of the application, after the initial file system format attribute and the target attribute prefix word of the block equipment to be mounted are obtained, the target attribute prefix word can be added into the initial file system format attribute of the block equipment to be mounted as the attribute prefix word to obtain the target file system format attribute of the block equipment to be mounted, so that the target file system format attribute can comprise the target attribute prefix word and the initial file system format attribute, and the target file system format attribute can characterize the file system type which the block equipment to be mounted should have and the type of formatting process which should be experienced when the block equipment to be mounted is mounted to a target container.
Based on the above-mentioned related content of S102, in the embodiment of the present application, after the format parameter of the block device to be mounted is obtained, the format attribute of the target file system of the block device to be mounted may be determined according to the format parameter, which specifically includes: firstly, inquiring from a first mapping relation to obtain an attribute prefix word corresponding to the formatting parameter as a target attribute prefix word; and adding the target attribute prefix word as a prefix of the initial file system format attribute of the block equipment to be mounted to obtain the target file system format attribute of the block equipment to be mounted, so that the target file system format attribute can comprise the target attribute prefix word and the initial file system format attribute, and the target file system format attribute can represent the file system type which the block equipment to be mounted should have and the type of formatting process which should be experienced when the block equipment to be mounted is mounted to a target container.
S103: when the format attribute of the target file system of the block equipment to be mounted meets a first preset condition, formatting the block equipment to be mounted, and mounting the formatted block equipment to be mounted into a target container in a starting state of starting.
The first preset condition is used for representing conditions met by the format attribute of the target file system of the block device needing to be formatted.
In some cases, determining that the target file system format attribute meets the first preset condition may specifically include the following two cases.
In case 1, when it is determined that the attribute prefix word in the target file system format attribute meets the first sub-condition, it is determined that the target file system format attribute meets the first preset condition.
The first sub-condition may be preset, for example, the first sub-condition may be that the attribute prefix word is format-.
Based on the above description of case 1, after the target file system format attribute of the block device to be mounted is obtained, if the attribute prefix word in the target file system format attribute meets the first sub-condition (for example, the attribute prefix word in the target file system format attribute is format-), it can be determined that the block device to be mounted should be formatted forcedly, so that it can be determined that the block device to be mounted must be formatted before being mounted to the target container.
And 2, when the attribute prefix word in the format attribute of the target file system is determined to meet the second sub-condition and the file system of the block to be mounted equipment is determined to meet the third sub-condition, determining that the format attribute of the target file system meets the first preset condition.
The second sub-condition may be preset, for example, the second sub-condition may be that the attribute prefix word is tryformat-.
The third sub-condition may be preset, for example, the third sub-condition may be that a file system of the block device to be mounted cannot be detected.
Based on the above-mentioned related content of the case 2, after the target file system format attribute of the block device to be mounted is obtained, if the attribute prefix word in the target file system format attribute satisfies the second sub-condition, it may be determined that the block device to be mounted should correspond to the formatting process of "only formatting the unformatted block device", so that the file system detection of the block device to be mounted may be continued, and when it is determined that the file system of the block device to be mounted cannot be detected (that is, it is determined that the file system of the block device to be mounted satisfies the third sub-condition), it may be determined that the block device to be mounted belongs to the unformatted block device, so that it may be determined that the block device to be mounted must be formatted before being mounted to the target container.
It should be noted that, the embodiment of the present application is not limited to the above-mentioned execution process of file system detection for the block device to be mounted, and for example, it may be implemented by using blkid tools capable of supporting file system format detection.
Based on the above two situations, in the embodiment of the present application, when determining that the block device to be mounted should be formatted forcibly according to the attribute prefix word of the target file system format attribute of the block device to be mounted, no matter whether the block device to be mounted is formatted or not, the block device to be mounted needs to be formatted in the startup process of the target container. In addition, when determining that the block device to be mounted corresponds to the formatting process of the block device which is only formatted and not formatted according to the attribute prefix word of the target file system format attribute of the block device to be mounted, formatting the block device to be mounted only when determining that the block device to be mounted belongs to the block device which is not formatted.
In addition, the embodiment of the application also provides an implementation manner for formatting the equipment of the block to be mounted, which specifically can include S1031-S1033:
s1031: and determining the type of the target file system according to the format attribute of the target file system of the block equipment to be mounted.
The target file system type is used to characterize the type of file system that the block to be mounted device should have when it is mounted to the target container.
In addition, the embodiment of the present application further provides an implementation manner of determining the type of the target file system (i.e. S1031), which specifically includes: and deleting prefix attribute words (such as formats-or tryformat-) in the format attribute of the target file system of the block device to be mounted to obtain the target file system type of the block device to be mounted, so that the target file system type can represent the type of the file system which the block device to be mounted should have when the block device to be mounted is mounted to the target container.
S1032: a target formatting utility is determined based on the target file system type.
The target formatting tool is used for formatting the file system of the block equipment to be mounted into a target file system type.
In addition, the embodiment of the present application further provides an implementation manner of determining the target formatting tool (i.e. S1032), which specifically includes: and determining a target formatting tool according to the second mapping relation and the target file system type. The second mapping relationship comprises a corresponding relationship between the type of the target file system and the target formatting tool.
The second mapping relationship is used to record the correspondence between each file system type and each formatting tool, for example, the second mapping relationship may include the correspondence shown in table 2.
File system type Formatting tool
ext4 Mkfs. Ext4 tool
xfs Mkfs. Xfs tool
TABLE 2 correspondence between different file system types and different formatting tools
Based on the above-mentioned content related to S1032, after determining the target file system type of the block device to be mounted, the formatting tool corresponding to the target file system type may be directly queried from the second mapping relationship as a target formatting tool for formatting the block device to be mounted. For example, when the second mapping relationship includes the correspondence relationship shown in table 2, if the target file system type of the block device to be mounted is ext4, the target formatting utility should be an mkfs.ext4 utility; if the target file system type of the block device to be mounted is xfs, the target formatting utility should be an mkfs.
S1033: and formatting the block to be mounted equipment by utilizing the target formatting tool.
Based on the above-mentioned content related to S103, after determining that the format attribute of the target file system of the block device to be mounted meets the first preset condition, the attribute prefix word in the format attribute of the target file system may be removed to obtain the target file system type of the block device to be mounted, and then the format tool corresponding to the target file system type is used to format the file system of the block device to be mounted into the target file system type, so that the formatted block device to be mounted has the file system of the target file system type.
In some cases, the block device to be mounted can be directly mounted in the target container, and the block device to be mounted cannot be formatted in the starting process of the target container. Based on this, the embodiment of the present application further provides a possible implementation manner of the formatting method, where the formatting method includes S104 in addition to S101 to S103 described above:
S104: and when the format attribute of the target file system of the block equipment to be mounted meets a second preset condition, mounting the block equipment to be mounted into a target container in a starting state of starting.
The second preset condition is used for representing the condition met by the format attribute of the target file system of the block device without formatting.
In some cases, determining that the target file system format attribute meets the second preset condition may specifically include the following two cases.
In the first case, when it is determined that the attribute prefix word in the target file system format attribute meets the second sub-condition and it is determined that the file system of the block device to be mounted meets the fourth sub-condition, it is determined that the target file system format attribute meets the second preset condition.
It should be noted that, please refer to the above for the relevant content of the second sub-condition.
The third sub-condition may be preset, for example, the third sub-condition may be a file system capable of detecting the block device to be mounted.
Based on the above-mentioned related content of the first case, after the target file system format attribute of the block device to be mounted is obtained, if the attribute prefix word in the target file system format attribute meets the second sub-condition, it may be determined that the block device to be mounted should correspond to the formatting process of "only the unformatted block device is formatted", so that the file system detection of the block device to be mounted may be continued, and when it is determined that the file system of the block device to be mounted can be detected (that is, it is determined that the file system of the block device to be mounted meets the fourth sub-condition), it may be determined that the block device to be mounted belongs to the formatted block device, so that it may be determined that the block device to be mounted does not need to be formatted before being mounted to the target container.
And secondly, when the attribute prefix word in the target file system format attribute is determined to meet the fifth sub-condition, determining that the target file system format attribute meets a second preset condition.
Wherein, the fifth sub-condition may be preset, for example, the fifth sub-condition may be that the attribute prefix word is null (i.e., there is no attribute prefix word).
Based on the above-mentioned related content of the second case, after the target file system format attribute of the block device to be mounted is obtained, if the attribute prefix word in the target file system format attribute meets the fifth sub-condition (for example, the target file system format attribute has no attribute prefix word), it may be determined that the block device to be mounted should be prohibited from being formatted, so that it may be determined that the block device to be mounted does not need to be formatted before being mounted to the target container.
Based on the above two situations, in the embodiment of the present application, when determining that the block device to be mounted corresponds to the formatting process of "only formatting unformatted block device" according to the attribute prefix word of the target file system format attribute of the block device to be mounted, if it is determined that the block device to be mounted belongs to the formatted block device, it is not necessary to perform formatting processing on the block device to be mounted. In addition, when determining that the block device to be mounted should be prohibited from being formatted according to the attribute prefix word of the format attribute of the target file system of the block device to be mounted, no matter whether the block device to be mounted is formatted or not, the block device to be mounted cannot be formatted in the starting process of the target container.
Based on the above-mentioned related content of S104, if the format attribute of the target file system of the block device to be mounted meets the second preset condition, it may be determined that no formatting process is required for the block device to be mounted in the boot process of the target container, so that the block device to be mounted may be directly mounted in the target container in the boot state, and thus the data security in the block device to be mounted may be protected.
Based on the related content of the formatting method, after receiving a container starting request, the formatting parameters of the block equipment to be mounted can be obtained first, and the format attribute of the target file system of the block equipment to be mounted can be determined according to the formatting parameters; when the format attribute of the target file system meets the first preset condition, formatting the block equipment to be mounted, and mounting the formatted block equipment to be mounted into a target container in a starting state, so that the formatting process of the block equipment to be mounted can be completed in the starting process of the target container.
In order to facilitate understanding of the technical solution of the present application, the following description will be made with reference to a scenario embodiment.
Scene embodiment
Referring to fig. 2, the application scenario of the formatting method provided by the embodiment of the present application is schematic, and in the application scenario shown in fig. 2, the block device ebs1 needs to be mounted inside the container 2.
When the formatting method provided by the embodiment of the present application is applied to the application scenario shown in fig. 2, as shown in fig. 3, the formatting method may include S301-S310:
s301: a user-triggered container start request is received and is used to request that container 2 be started in the virtual machine.
S302: the configuration file ebs1.Json of the block device ebs1 is acquired. Wherein the configuration file ebs1.Json of the block device ebs1 includes formatting parameters and initial file system format attributes of the block device ebs1.
S303: and analyzing the configuration file ebs1.Json of the block device ebs1 to obtain the formatting parameters of the block device ebs1 and the format attribute of the initial file system of the block device ebs1.
The embodiment of the present application is not limited to the implementation of S303, for example, if an analysis tool for analyzing a configuration file is deployed in kata-runtime shown in fig. 2 (for example, the analysis tool can implement analysis procedures such as format parameter analysis and file system format attribute analysis), S303 may be implemented by using the analysis tool in kata-runtime shown in fig. 2.
S304: determining a target file system format attribute of the block device ebs1 according to the formatting parameter of the block device ebs1 and the initial file system format attribute of the block device ebs1, and updating file system attribute information of the block device ebs1 by using the target file system format attribute of the block device ebs1 so that the updated file system attribute information of the block device ebs1 comprises the target file system format attribute of the block device ebs 1.
The embodiment of the present application is not limited to the implementation of S303, for example, S304 may be implemented by kata-runtime shown in fig. 2 for S304.
S305: and detecting attribute prefix words of the file system attribute information of the block equipment ebs1 to obtain an attribute prefix word detection result.
The embodiment of the present application is not limited to the implementation of S303, for example, if a prefix detection tool for detecting attribute prefix words of file system attribute information of a block device is deployed in advance in kata-agents shown in fig. 2, S305 may be executed by using the prefix detection tool in kata-agents shown in fig. 2.
In addition, in the embodiment of the present application, since different attribute prefix words correspond to different formatting processes, the formatting process for the block device ebs1 may be determined based on the attribute prefix word detection result, which specifically includes: if the attribute prefix word detection result indicates that the attribute prefix word does not exist in the format attribute of the target file system of the block device ebs1, determining that the block device ebs1 corresponds to the format prohibition, so that the block device ebs1 does not need to be formatted and directly mount the block device ebs1 into the container 2 (i.e., the related content of S306); if it is determined that the attribute prefix word detection result indicates that the attribute prefix word in the target file system format attribute of the block device ebs1 is format-, it is determined that the block device ebs1 corresponds to forced formatting, so that the block device ebs1 must be formatted first, and then the formatted block device ebs1 is mounted in the container 2, that is, the related content of S307); if the attribute prefix word detection result indicates that the attribute prefix word in the target file system format attribute of the block device ebs1 is tryformat-, it is determined that the block device ebs1 corresponds to only the block device that is not formatted, so it may be determined whether the block device ebs1 needs to be formatted based on the file system of the block device ebs1 itself (i.e., the related content of S308-S310).
S306: and when the attribute prefix word detection result indicates that the attribute prefix word does not exist in the target file system format attribute of the block device ebs1, the block device ebs1 is mounted inside the container 2.
The embodiment of the present application is not limited to the implementation of S306, for example, S306 may be performed by using kata-agent shown in fig. 2, which may specifically be: when it is determined that the attribute prefix word detection result indicates that the attribute prefix word does not exist in the target file system format attribute of the block device ebs1, it may be determined that the block device ebs1 is in a forbidden format state, so in order to ensure data security of the block device ebs1, no formatting process needs to be performed on the block device ebs1, and the block device ebs1 is directly mounted inside the container 2 according to a file system format specified by file system attribute information thereof, so as to be accessed by a user. It should be noted that, if the above mounting process fails, it is required to additionally emphasize that the block device ebs1 is prohibited from being formatted in the information of the reporting error.
S307: when it is determined that the attribute prefix word detection result indicates that the attribute prefix word in the target file system format attribute of the block device ebs1 is format-, the block device ebs1 is formatted, and the formatted block device ebs1 is mounted inside the container 2.
The embodiment of the present application is not limited to the implementation of S307, for example, S307 may be performed by using kata-agent shown in fig. 2, which may specifically be: when it is determined that the attribute prefix word detection result indicates that the attribute prefix word in the target file system format attribute of the block device ebs1 is format-, it may be determined that the block device ebs1 is in a forced format state, at this time, the prefix word format in the target file system format attribute of the block device ebs1 is first removed to obtain an initial file system format attribute of the block device ebs1, and file system attribute information of the block device ebs1 is updated according to the initial file system format attribute of the block device ebs1, so that the updated file system attribute information of the block device ebs1 includes the initial file system format attribute of the block device ebs 1. Then, determining the file system of the block device ebs1 according to the initial file system format attribute of the block device ebs1, and calling a formatting tool corresponding to the file system of the block device ebs1 to perform formatting processing on the block device ebs1, so that the formatted block device ebs1 has the file system of the block device ebs 1. Finally, the formatted block device ebs1 is mounted inside the container 2 according to the file system format specified by the file system attribute information thereof, so as to be accessed by the user.
It should be noted that, the formatting tools corresponding to each file system may be pre-deployed into the virtual machine base image of the virtual machine shown in fig. 2, so that kata-agents can call the formatting tools. In addition, the virtual machine base image can pre-deploy some basic formatting tools (such as mkfs. Ext4 and mkfs. Xfs tools), and can further increase and deploy some formatting tools corresponding to new demands of the file system of the user in the later period so as to support the realization of more types of file system formatting.
S308: and when the attribute prefix word detection result is determined to indicate that the attribute prefix word in the target file system format attribute of the block equipment ebs1 is tryformat-, detecting the current file system type of the block equipment ebs1 to obtain a system type detection result. The current file system type of the block device ebs1 refers to the type of the file system that the block device ebs1 has at the current time.
The embodiment of the present application is not limited to the implementation of S308, for example, S308 may be performed by using kata-agents shown in fig. 2, which may specifically be: when it is determined that the attribute prefix word detection result indicates that the attribute prefix word in the target file system format attribute of the block device ebs1 is tryformat-, it may be determined that the block device ebs1 is in a state of formatting only an unformatted block device, at this time, the prefix word tryformat-in the target file system format attribute of the block device ebs1 is first removed to obtain an initial file system format attribute of the block device ebs1, and file system attribute information of the block device ebs1 is updated according to the initial file system format attribute of the block device ebs1, so that the updated file system attribute information of the block device ebs1 includes the initial file system format attribute of the block device ebs 1. Then, blkid tool is called by kata-agent to detect the current file system type of the device ebs1, and a system type detection result is obtained.
It should be noted that blkid tools may be pre-deployed into the virtual machine base image of the virtual machine shown in fig. 2 to enable kata-agents to call the blkid tools. In addition, blkid tools are used to detect the file system format (e.g., file system type) of the block device.
S309: if the system type detection result indicates that the file system type of the block device ebs1 cannot be detected, formatting the block device ebs1, and mounting the formatted block device ebs1 into the container 2.
The embodiment of the present application is not limited to the implementation of S309, for example, S309 may be performed by using kata-agent shown in fig. 2, which may specifically be: when the block device ebs1 is in a state of only formatting the unformatted block device, if it is determined that the system type detection result indicates that the file system type of the block device ebs1 cannot be detected, it may be determined that the block device ebs1 belongs to the unformatted block device, so that the file system of the block device ebs1 may be determined according to the initial file system format attribute of the block device ebs1, and a formatting tool corresponding to the file system of the block device ebs1 may be called to perform formatting processing on the block device ebs1, so that the formatted block device ebs1 has the file system of the block device ebs 1; and then the formatted block equipment ebs1 is mounted in the container 2 according to the file system format specified by the file system attribute information thereof so as to be accessed by a user.
S310: if the system type detection result indicates that the file system type of the block device ebs1 can be detected, the block device ebs1 is mounted inside the container 2.
The embodiment of the present application is not limited to the implementation of S310, for example, S310 may be performed by using kata-agents shown in fig. 2, which may specifically be: when the block device ebs1 is in a state of only formatting the unformatted block device, if it is determined that the system type detection result indicates that the file system type of the block device ebs1 can be detected, it can be determined that the block device ebs1 belongs to the formatted block device, so that in order to ensure the data security of the block device ebs1, the block device ebs1 does not need to be formatted, but the block device ebs1 is directly mounted in the container 2 according to the file system format specified by the file system attribute information thereof, so as to be accessed by a user.
Based on the above-mentioned related content of S301 to S310, the present application can implement the formatting process of the block device by implanting the formatting process into the boot-up process of the container, so that the formatting process of the block device mounted inside the container can be implemented without changing the user permission.
Based on the formatting method provided by the embodiment of the method, the embodiment of the application also provides a formatting device, which is explained and illustrated below with reference to the accompanying drawings.
Device embodiment
For technical details of the formatting device provided in the device embodiment, please refer to the above method embodiment.
Referring to fig. 4, a schematic structural diagram of a formatting device according to an embodiment of the present application is shown.
The formatting device 400 provided in the embodiment of the application includes:
an obtaining unit 401, configured to obtain a formatting parameter of a block device to be mounted after receiving a container start request;
A determining unit 402, configured to determine, according to the formatting parameter, a target file system format attribute of the block device to be mounted;
And a formatting unit 403, configured to, when it is determined that the format attribute of the target file system meets a first preset condition, format the block device to be mounted, and mount the formatted block device to be mounted in a target container in a startup state.
In a possible implementation manner, the determining unit 402 includes:
the first acquisition subunit is used for acquiring the format attribute of the initial file system of the block equipment to be mounted;
a first determining subunit, configured to determine a target attribute prefix word according to the formatting parameter;
and the second determining subunit is used for taking the target attribute prefix word as the prefix of the initial file system format attribute to obtain the target file system format attribute of the block to be mounted equipment.
In a possible implementation manner, the formatting unit 403 includes:
a third determining subunit, configured to determine a target file system type according to the format attribute of the target file system;
A fourth determining subunit, configured to determine a target formatting tool according to the target file system type; the target formatting tool is used for formatting the file system of the block to be mounted device into the target file system type;
And the formatting subunit is used for formatting the block equipment to be mounted by utilizing the target formatting tool.
In one possible implementation manner, the determining that the target file system format attribute meets a first preset condition includes:
determining that an attribute prefix word in the target file system format attribute meets a first sub-condition;
Or alternatively
And determining that the attribute prefix word in the target file system format attribute meets a second sub-condition, and determining that the file system of the block to be mounted equipment meets a third sub-condition.
In a possible implementation manner, the obtaining unit 401 includes:
the second acquisition subunit is used for acquiring the configuration file of the block equipment to be mounted;
and a fifth determining subunit, configured to parse the configuration file of the block to be mounted device to obtain the formatting parameter of the block to be mounted device.
In one possible implementation, the formatting device 400 further includes:
and the mounting unit is used for mounting the block equipment to be mounted into a target container in a starting state when the format attribute of the target file system meets a second preset condition.
In one possible implementation manner, the determining that the target file system format attribute meets a second preset condition includes:
determining that an attribute prefix word in the format attribute of the target file system meets a second sub-condition, and determining that a file system of the block to be mounted equipment meets a fourth sub-condition;
Or alternatively
And determining that the attribute prefix word in the target file system format attribute meets a fifth sub-condition.
Based on the related content of the formatting device 400, after receiving the container start request, the formatting device 400 may first obtain the formatting parameters of the block device to be mounted, and determine the format attribute of the target file system of the block device to be mounted according to the formatting parameters; when the format attribute of the target file system meets the first preset condition, formatting the block equipment to be mounted, and mounting the formatted block equipment to be mounted into a target container in a starting state, so that the formatting process of the block equipment to be mounted can be completed in the starting process of the target container.
Based on the formatting method provided by the method embodiment, the embodiment of the application also provides equipment, and the equipment is explained and illustrated below with reference to the accompanying drawings.
Device embodiment
For the technical details of the device provided in the device embodiment, please refer to the above method embodiment.
Referring to fig. 5, a schematic diagram of an apparatus structure according to an embodiment of the present application is shown.
The apparatus 500 provided in the embodiment of the present application includes: a processor 501 and a memory 502;
the memory 502 is used for storing a computer program;
The processor 501 is configured to execute any implementation of the formatting method provided by the method embodiment described above according to the computer program. That is, the processor 501 is configured to perform the steps of:
After receiving a container starting request, obtaining formatting parameters of block equipment to be mounted;
Determining the format attribute of the target file system of the block equipment to be mounted according to the formatting parameters;
And when the format attribute of the target file system meets a first preset condition, formatting the block equipment to be mounted, and mounting the formatted block equipment to be mounted into a target container in a starting state.
Optionally, the determining, according to the formatting parameter, a format attribute of the target file system of the block device to be mounted includes:
acquiring the format attribute of an initial file system of the block equipment to be mounted;
determining target attribute prefix words according to the formatting parameters;
and taking the target attribute prefix word as the prefix of the initial file system format attribute to obtain the target file system format attribute of the block equipment to be mounted.
Optionally, the formatting the block to be mounted device includes:
determining a target file system type according to the target file system format attribute;
Determining a target formatting tool according to the type of the target file system; the target formatting tool is used for formatting the file system of the block to be mounted device into the target file system type;
And formatting the block equipment to be mounted by using the target formatting tool.
Optionally, the determining that the target file system format attribute meets a first preset condition includes:
determining that an attribute prefix word in the target file system format attribute meets a first sub-condition;
Or alternatively
And determining that the attribute prefix word in the target file system format attribute meets a second sub-condition, and determining that the file system of the block to be mounted equipment meets a third sub-condition.
Optionally, the obtaining the formatting parameter of the block to be mounted device includes:
acquiring a configuration file of the block equipment to be mounted;
and analyzing the configuration file of the block equipment to be mounted to obtain formatting parameters of the block equipment to be mounted.
Optionally, the method further comprises:
and when the format attribute of the target file system meets a second preset condition, mounting the block equipment to be mounted into a target container in a starting state.
Optionally, the determining that the target file system format attribute meets a second preset condition includes:
determining that an attribute prefix word in the format attribute of the target file system meets a second sub-condition, and determining that a file system of the block to be mounted equipment meets a fourth sub-condition;
Or alternatively
And determining that the attribute prefix word in the target file system format attribute meets a fifth sub-condition.
The foregoing is related to the device 500 provided in the embodiment of the present application.
Based on the formatting method provided by the method embodiment, the embodiment of the application also provides a computer readable storage medium.
Media embodiment
For technical details of the computer-readable storage medium provided in the medium embodiment, please refer to the method embodiment.
The present application provides a computer readable storage medium for storing a computer program for executing any one of the formatting methods provided by the above method embodiments. That is, the computer program is for performing the steps of:
After receiving a container starting request, obtaining formatting parameters of block equipment to be mounted;
Determining the format attribute of the target file system of the block equipment to be mounted according to the formatting parameters;
And when the format attribute of the target file system meets a first preset condition, formatting the block equipment to be mounted, and mounting the formatted block equipment to be mounted into a target container in a starting state.
Optionally, the determining, according to the formatting parameter, a format attribute of the target file system of the block device to be mounted includes:
acquiring the format attribute of an initial file system of the block equipment to be mounted;
determining target attribute prefix words according to the formatting parameters;
and taking the target attribute prefix word as the prefix of the initial file system format attribute to obtain the target file system format attribute of the block equipment to be mounted.
Optionally, the formatting the block to be mounted device includes:
determining a target file system type according to the target file system format attribute;
Determining a target formatting tool according to the type of the target file system; the target formatting tool is used for formatting the file system of the block to be mounted device into the target file system type;
And formatting the block equipment to be mounted by using the target formatting tool.
Optionally, the determining that the target file system format attribute meets a first preset condition includes:
determining that an attribute prefix word in the target file system format attribute meets a first sub-condition;
Or alternatively
And determining that the attribute prefix word in the target file system format attribute meets a second sub-condition, and determining that the file system of the block to be mounted equipment meets a third sub-condition.
Optionally, the obtaining the formatting parameter of the block to be mounted device includes:
acquiring a configuration file of the block equipment to be mounted;
and analyzing the configuration file of the block equipment to be mounted to obtain formatting parameters of the block equipment to be mounted.
Optionally, the method further comprises:
and when the format attribute of the target file system meets a second preset condition, mounting the block equipment to be mounted into a target container in a starting state.
Optionally, the determining that the target file system format attribute meets a second preset condition includes:
determining that an attribute prefix word in the format attribute of the target file system meets a second sub-condition, and determining that a file system of the block to be mounted equipment meets a fourth sub-condition;
Or alternatively
And determining that the attribute prefix word in the target file system format attribute meets a fifth sub-condition.
The above is related content of a computer readable storage medium provided by an embodiment of the present application.
It should be understood that in the present application, "at least one (item)" means one or more, and "a plurality" means two or more. "and/or" for describing the association relationship of the association object, the representation may have three relationships, for example, "a and/or B" may represent: only a, only B and both a and B are present, wherein a, B may be singular or plural. The character "/" generally indicates that the context-dependent object is an "or" relationship. "at least one of" or the like means any combination of these items, including any combination of single item(s) or plural items(s). For example, at least one (one) of a, b or c may represent: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", wherein a, b, c may be single or plural.
The above description is only of the preferred embodiment of the present invention, and is not intended to limit the present invention in any way. While the invention has been described with reference to preferred embodiments, it is not intended to be limiting. Any person skilled in the art can make many possible variations and modifications to the technical solution of the present invention or modifications to equivalent embodiments using the methods and technical contents disclosed above, without departing from the scope of the technical solution of the present invention. Therefore, any simple modification, equivalent variation and modification of the above embodiments according to the technical substance of the present invention still fall within the scope of the technical solution of the present invention.

Claims (8)

1.一种格式化方法,其特征在于,包括:1. A formatting method, comprising: 在接收到容器启动请求之后,获取待挂载块设备的格式化参数;After receiving the container startup request, obtain the formatting parameters of the block device to be mounted; 根据所述格式化参数,确定所述待挂载块设备的目标文件系统格式属性;Determining the target file system format attributes of the block device to be mounted according to the formatting parameters; 在确定所述目标文件系统格式属性满足第一预设条件时,对所述待挂载块设备进行格式化,并将格式化后的待挂载块设备挂载至处于开机启动状态的目标容器中;When it is determined that the format attribute of the target file system satisfies the first preset condition, formatting the block device to be mounted, and mounting the formatted block device to be mounted to the target container in the boot state; 所述根据所述格式化参数,确定所述待挂载块设备的目标文件系统格式属性,包括:Determining the target file system format attribute of the block device to be mounted according to the formatting parameter includes: 获取所述待挂载块设备的初始文件系统格式属性;Obtaining the initial file system format attributes of the block device to be mounted; 根据所述格式化参数确定目标属性前缀词;Determine a target attribute prefix word according to the formatting parameter; 将所述目标属性前缀词作为所述初始文件系统格式属性的前缀,得到所述待挂载块设备的目标文件系统格式属性;Using the target attribute prefix as a prefix of the initial file system format attribute to obtain the target file system format attribute of the block device to be mounted; 所述对所述待挂载块设备进行格式化,包括:The step of formatting the block device to be mounted includes: 根据所述目标文件系统格式属性,确定目标文件系统类型;Determining the target file system type according to the target file system format attribute; 根据所述目标文件系统类型,确定目标格式化工具;其中,所述目标格式化工具用于将所述待挂载块设备的文件系统格式化为所述目标文件系统类型;Determine a target formatting tool according to the target file system type; wherein the target formatting tool is used to format the file system of the block device to be mounted into the target file system type; 利用所述目标格式化工具对所述待挂载块设备进行格式化。The target formatting tool is used to format the block device to be mounted. 2.根据权利要求1所述的方法,其特征在于,所述确定所述目标文件系统格式属性满足第一预设条件,包括:2. The method according to claim 1, wherein determining that the target file system format attribute satisfies a first preset condition comprises: 确定所述目标文件系统格式属性中的属性前缀词满足第一子条件;Determining that the attribute prefix word in the target file system format attribute satisfies the first sub-condition; 或者,or, 确定所述目标文件系统格式属性中的属性前缀词满足第二子条件,且确定所述待挂载块设备的文件系统满足第三子条件。It is determined that the attribute prefix in the target file system format attribute satisfies the second sub-condition, and it is determined that the file system of the block device to be mounted satisfies the third sub-condition. 3.根据权利要求1所述的方法,其特征在于,所述获取待挂载块设备的格式化参数,包括:3. The method according to claim 1, wherein obtaining formatting parameters of the block device to be mounted comprises: 获取所述待挂载块设备的配置文件;Obtaining a configuration file for the block device to be mounted; 对所述待挂载块设备的配置文件进行解析,得到所述待挂载块设备的格式化参数。The configuration file of the block device to be mounted is parsed to obtain formatting parameters of the block device to be mounted. 4.根据权利要求1所述的方法,其特征在于,所述方法还包括:4. The method according to claim 1, characterized in that the method further comprises: 在确定所述目标文件系统格式属性满足第二预设条件时,将所述待挂载块设备挂载至处于开机启动状态的目标容器中。When it is determined that the target file system format attribute satisfies the second preset condition, the block device to be mounted is mounted to the target container in the boot state. 5.根据权利要求4所述的方法,其特征在于,所述确定所述目标文件系统格式属性满足第二预设条件,包括:5. The method according to claim 4, wherein determining that the target file system format attribute satisfies a second preset condition comprises: 确定所述目标文件系统格式属性中的属性前缀词满足第二子条件,且确定所述待挂载块设备的文件系统满足第四子条件;Determining that the attribute prefix in the target file system format attribute satisfies the second sub-condition, and determining that the file system of the block device to be mounted satisfies the fourth sub-condition; 或者,or, 确定所述目标文件系统格式属性中的属性前缀词满足第五子条件。It is determined that the attribute prefix word in the target file system format attribute satisfies a fifth sub-condition. 6.一种格式化装置,其特征在于,包括:6. A formatting device, comprising: 获取单元,用于在接收到容器启动请求之后,获取待挂载块设备的格式化参数;An acquisition unit, configured to acquire formatting parameters of a block device to be mounted after receiving a container startup request; 确定单元,用于根据所述格式化参数,确定所述待挂载块设备的目标文件系统格式属性;A determination unit, configured to determine a target file system format attribute of the block device to be mounted according to the formatting parameter; 格式化单元,用于在确定所述目标文件系统格式属性满足第一预设条件时,对所述待挂载块设备进行格式化,并将格式化后的待挂载块设备挂载至处于开机启动状态的目标容器中;a formatting unit, configured to format the block device to be mounted when it is determined that the format attribute of the target file system satisfies a first preset condition, and mount the formatted block device to be mounted into the target container in a booted state; 所述确定单元,包括:The determining unit comprises: 第一获取子单元,用于获取所述待挂载块设备的初始文件系统格式属性;A first acquisition subunit is used to acquire the initial file system format attribute of the block device to be mounted; 第一确定子单元,用于根据所述格式化参数确定目标属性前缀词;A first determining subunit, configured to determine a target attribute prefix word according to the formatting parameter; 第二确定子单元,用于将所述目标属性前缀词作为所述初始文件系统格式属性的前缀,得到所述待挂载块设备的目标文件系统格式属性;A second determining subunit is configured to use the target attribute prefix as a prefix of the initial file system format attribute to obtain the target file system format attribute of the block device to be mounted; 所述格式化单元,包括:The formatting unit comprises: 第三确定子单元,用于根据所述目标文件系统格式属性,确定目标文件系统类型;A third determining subunit, configured to determine a target file system type according to the target file system format attribute; 第四确定子单元,用于根据所述目标文件系统类型,确定目标格式化工具;其中,所述目标格式化工具用于将所述待挂载块设备的文件系统格式化为所述目标文件系统类型;A fourth determination subunit is used to determine a target formatting tool according to the target file system type; wherein the target formatting tool is used to format the file system of the block device to be mounted into the target file system type; 格式化子单元,用于利用所述目标格式化工具对所述待挂载块设备进行格式化。The formatting subunit is used to format the block device to be mounted using the target formatting tool. 7.一种设备,其特征在于,所述设备包括处理器以及存储器:7. A device, characterized in that the device comprises a processor and a memory: 所述存储器用于存储计算机程序;The memory is used to store computer programs; 所述处理器用于根据所述计算机程序执行权利要求1-5中任一项所述的方法。The processor is configured to execute the method according to any one of claims 1 to 5 according to the computer program. 8.一种计算机可读存储介质,其特征在于,所述计算机可读存储介质用于存储计算机程序,所述计算机程序用于执行权利要求1-5中任一项所述的方法。8. A computer-readable storage medium, characterized in that the computer-readable storage medium is used to store a computer program, and the computer program is used to execute the method according to any one of claims 1 to 5.
CN202010986398.6A 2020-09-18 2020-09-18 Formatting method and related equipment Active CN112114900B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010986398.6A CN112114900B (en) 2020-09-18 2020-09-18 Formatting method and related equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010986398.6A CN112114900B (en) 2020-09-18 2020-09-18 Formatting method and related equipment

Publications (2)

Publication Number Publication Date
CN112114900A CN112114900A (en) 2020-12-22
CN112114900B true CN112114900B (en) 2024-11-15

Family

ID=73799920

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010986398.6A Active CN112114900B (en) 2020-09-18 2020-09-18 Formatting method and related equipment

Country Status (1)

Country Link
CN (1) CN112114900B (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106446275A (en) * 2016-10-21 2017-02-22 国云科技股份有限公司 A container implementation method supporting file system expansion
CN106484719A (en) * 2015-08-28 2017-03-08 中兴通讯股份有限公司 A kind of method of extended mobile phone storage and terminal

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9690811B1 (en) * 2003-11-05 2017-06-27 Hewlett Packard Enterprise Development Lp Single repository manifestation of a multi-repository system
JP2007058671A (en) * 2005-08-25 2007-03-08 Sony Corp Information processor, method and program, and recording medium
US10310949B1 (en) * 2016-12-22 2019-06-04 EMC IP Holding Company LLC Disaster restore of big data application with near zero RTO

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106484719A (en) * 2015-08-28 2017-03-08 中兴通讯股份有限公司 A kind of method of extended mobile phone storage and terminal
CN106446275A (en) * 2016-10-21 2017-02-22 国云科技股份有限公司 A container implementation method supporting file system expansion

Also Published As

Publication number Publication date
CN112114900A (en) 2020-12-22

Similar Documents

Publication Publication Date Title
CN107040578B (en) Data synchronization method, device and system
CN103246595B (en) Application program management method, device, server and terminal equipment
US11726860B2 (en) Intelligent automatic support
WO2020224238A1 (en) Blockchain node depolyment method, device and equipment, and storage medium
CN111190962B (en) File synchronization method and device and local terminal
CN110825399B (en) Deployment method and device of application program
JP6870466B2 (en) Control programs, control methods, controls, and database servers
CN113626286A (en) Multi-cluster instance processing method and device, electronic equipment and storage medium
CN109271172B (en) A method and device for extending host performance of a swarm cluster
CN112328363B (en) Cloud hard disk mounting method and device
US9514176B2 (en) Database update notification method
CN110881224B (en) Network long connection method, device, equipment and storage medium
JP2008090504A (en) Computer maintenance support system and analysis server
CN108874441B (en) Board card configuration method, device, server and storage medium
CN111241198B (en) Data synchronization method and device and data processing equipment
CN112286559A (en) A method and device for upgrading a vehicle-mounted intelligent terminal
CN112114900B (en) Formatting method and related equipment
WO2019001321A1 (en) Yang model extension verification method, device, and computer readable storage medium
US20150347402A1 (en) System and method for enabling a client system to generate file system operations on a file system data set using a virtual namespace
CN118445501A (en) Method and device for offline information recording, electronic equipment and storage medium
CN117421278A (en) Deleted application installation trace detection method and device and electronic equipment
US11994958B2 (en) Inference service management method, apparatus and system for inference platform, and medium
US11714896B2 (en) Information processing apparatus, information processing method, and computer program
CN105511848B (en) Detection method and device for dynamic link library
CN115002107A (en) Method, system, equipment and storage medium for deploying fragment service

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
GR01 Patent grant
GR01 Patent grant