CN117289956A - Mirror image manufacturing method, apparatus, electronic device and storage medium - Google Patents
Mirror image manufacturing method, apparatus, electronic device and storage medium Download PDFInfo
- Publication number
- CN117289956A CN117289956A CN202311323350.7A CN202311323350A CN117289956A CN 117289956 A CN117289956 A CN 117289956A CN 202311323350 A CN202311323350 A CN 202311323350A CN 117289956 A CN117289956 A CN 117289956A
- Authority
- CN
- China
- Prior art keywords
- image file
- partition
- information
- target
- disk
- 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.)
- Granted
Links
- 238000004519 manufacturing process Methods 0.000 title claims abstract description 12
- 238000005192 partition Methods 0.000 claims abstract description 163
- 238000000034 method Methods 0.000 claims abstract description 46
- 238000012545 processing Methods 0.000 claims description 17
- 238000006243 chemical reaction Methods 0.000 claims description 2
- 238000000638 solvent extraction Methods 0.000 claims description 2
- 230000008569 process Effects 0.000 abstract description 10
- 238000004891 communication Methods 0.000 description 8
- 238000004590 computer program Methods 0.000 description 8
- 238000010586 diagram Methods 0.000 description 4
- 230000006870 function Effects 0.000 description 4
- 238000009434 installation Methods 0.000 description 3
- 239000002184 metal Substances 0.000 description 3
- 238000012986 modification Methods 0.000 description 3
- 230000004048 modification Effects 0.000 description 3
- 230000003287 optical effect Effects 0.000 description 3
- 230000003993 interaction Effects 0.000 description 2
- 238000003491 array Methods 0.000 description 1
- 238000013473 artificial intelligence Methods 0.000 description 1
- 238000004422 calculation algorithm Methods 0.000 description 1
- 230000001413 cellular effect Effects 0.000 description 1
- 238000010276 construction Methods 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 238000001514 detection method Methods 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 239000004973 liquid crystal related substance Substances 0.000 description 1
- 238000010801 machine learning Methods 0.000 description 1
- 239000013307 optical fiber Substances 0.000 description 1
- 238000004806 packaging method and process Methods 0.000 description 1
- 238000012216 screening Methods 0.000 description 1
- 239000004065 semiconductor Substances 0.000 description 1
- 230000001953 sensory effect Effects 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
- 230000000007 visual effect Effects 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/60—Software deployment
- G06F8/61—Installation
- G06F8/63—Image based installation; Cloning; Build to order
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/06—Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
- G06F3/0601—Interfaces specially adapted for storage systems
- G06F3/0602—Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
- G06F3/0608—Saving storage space on storage systems
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/06—Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
- G06F3/0601—Interfaces specially adapted for storage systems
- G06F3/0628—Interfaces specially adapted for storage systems making use of a particular technique
- G06F3/0638—Organizing or formatting or addressing of data
- G06F3/0643—Management of files
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/06—Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
- G06F3/0601—Interfaces specially adapted for storage systems
- G06F3/0628—Interfaces specially adapted for storage systems making use of a particular technique
- G06F3/0638—Organizing or formatting or addressing of data
- G06F3/0644—Management of space entities, e.g. partitions, extents, pools
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/06—Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
- G06F3/0601—Interfaces specially adapted for storage systems
- G06F3/0668—Interfaces specially adapted for storage systems adopting a particular infrastructure
- G06F3/0671—In-line storage system
- G06F3/0673—Single storage device
- G06F3/0674—Disk device
- G06F3/0676—Magnetic disk device
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Human Computer Interaction (AREA)
- Software Systems (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The disclosure provides a mirror image manufacturing method, a mirror image manufacturing device, electronic equipment and a storage medium, and relates to the technical field of computers. The specific implementation scheme is as follows: determining attribute information of at least one target partition by using external equipment; creating a temporary mirror image file according to the attribute information; copying the system file to a designated directory in the temporary image file to generate a target image file. Through the process, the image file can be created according to the appointed partition requirement, the problem of overlarge image file caused in the whole disk copying process is solved, and the storage space is saved.
Description
Technical Field
The disclosure relates to the technical field of computers, and in particular relates to a mirror image manufacturing method, a device, electronic equipment and a storage medium.
Background
In the technical field of system installation, after the system installation work of one bare metal server is completed, the system is generally used as a template to perform batch installation on other bare metal servers. At this point, the installed system template needs to be converted into an image file. In the process of making an image file, the complete system image file is generally obtained by performing full disk copy on the disk where the template system is located. However, such processing would result in excessive memory occupied by the image file.
Therefore, how to provide a new image making method, the memory occupied by the compressed image file becomes a problem to be solved.
Disclosure of Invention
The disclosure provides a mirror image manufacturing method, a mirror image manufacturing device, electronic equipment and a storage medium.
According to an aspect of the present disclosure, there is provided a mirror image manufacturing method, which may include the steps of:
determining attribute information of at least one target partition by using external equipment; the target partition is a partition in which a system file is stored on the target disk; the attribute information includes partition capacity information and partition path information; the system files are files required by the operation of the operating system;
creating a temporary mirror image file according to the attribute information;
copying the system file to a designated directory in the temporary image file to generate a target image file.
According to an aspect of the present disclosure, there is provided a mirror image producing apparatus including:
the attribute information determining unit is used for determining attribute information of at least one target partition by using the external equipment; the target partition is a partition in which a system file is stored on the target disk; the attribute information includes partition capacity information and partition path information; the system files are files required by the operation of the operating system;
a temporary image file creating unit for creating a temporary image file according to the attribute information;
and the target image file generating unit is used for copying the system file to the appointed directory in the temporary image file to generate the target image file.
According to another aspect of the present disclosure, there is provided an electronic device including:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of any one of the embodiments of the present disclosure.
According to another aspect of the present disclosure, there is provided a non-transitory computer-readable storage medium storing computer instructions for causing a computer to perform the method of any of the embodiments of the present disclosure.
According to the mirror image making method provided by the technical scheme of the invention, the mirror image file can be created according to the appointed partition requirement, the problem of overlarge mirror image file caused in the whole disk copying process is solved, and the storage space occupied by the mirror image file is saved.
It should be understood that the description in this section is not intended to identify key or critical features of the embodiments of the disclosure, nor is it intended to be used to limit the scope of the disclosure. Other features of the present disclosure will become apparent from the following specification.
Drawings
The drawings are for a better understanding of the present solution and are not to be construed as limiting the present disclosure. Wherein:
FIG. 1 is a flow chart of a mirror image making method according to the present disclosure;
FIG. 2 is a flow chart of a method of determining attribute information according to the present disclosure;
FIG. 3 is a flow chart of a temporary image file creation method according to the present disclosure;
FIG. 4 is a flow chart of a blank image file generation method according to the present disclosure;
FIG. 5 is a block diagram of a mirror image producing apparatus according to the present disclosure;
FIG. 6 is a block diagram of an electronic device implementing an image file of an embodiment of the present disclosure.
Detailed Description
Exemplary embodiments of the present disclosure are described below in conjunction with the accompanying drawings, which include various details of the embodiments of the present disclosure to facilitate understanding, and should be considered as merely exemplary. Accordingly, one of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the present disclosure. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
As shown in fig. 1, the present disclosure relates to a mirror image making method, which may include the steps of:
s101: determining attribute information of at least one target partition by using external equipment; the target partition is a partition in which a system file is stored on the target disk; the attribute information includes partition capacity information and partition path information; the system files are files required by the operation of the operating system;
s102: creating a temporary mirror image file according to the attribute information;
s103: copying the system file to a designated directory in the temporary image file to generate a target image file.
The embodiment is suitable for external equipment of a computer, and the external equipment can be equipment comprising a system interface of a pre-starting environment. For example, an external USB flash disk running a UEFI system interface (Unified Extensible Fimware Interface, unified extensible firmware interface) may be used.
Before executing S101, the external device is plugged onto the target computing device, so that the external device is connected with the target computing device. The target computing device is a bare metal server provided with an active system file, and the external device is utilized to identify, analyze, copy and the like the active system file in the target computing device, so as to manufacture an image file corresponding to the active system, namely a target image file.
After plugging the external equipment into the target computing equipment, determining attribute information of at least one target partition by utilizing the external equipment; the target partition is a partition in which a system file is stored on the target disk; the attribute information includes partition capacity information and partition path information; the system files are files required for the operating system to run. The external device stores a disk partition (DiskPart) tool, and can manage a disk, partition or volume by directly inputting a script or a command prompt. The DiskPart tool can acquire any object in the target disk through the disk path through packaging a preset tool library of python, and further acquire attribute information of the target partition. The attribute information includes key information such as start and stop blocks, partition labels, partition names, uuid and the like of each partition. The object of the target disk may be a system file stored in advance on the target disk, which is not limited in particular.
After determining the attribute information of the target partition, executing step S102, and creating a temporary image file according to the attribute information; the temporary image file includes directory information corresponding to the partition path information. Specifically, firstly, the memory size occupied by the temporary image file can be determined according to the attribute information of the target partition, and secondly, the directory structure of the temporary image file can be determined according to the partition path information of the target partition.
Then, step S103 is executed to copy the system file to the specified directory in the temporary image file, and generate the target image file. Specifically, the system file may be copied by mounting the network block device with the temporary image file. Other ways of copying are possible as desired, without limitation.
Through the above process, the external equipment is utilized to determine the attribute information of at least one target partition, then the temporary mirror image file is created based on the attribute information, and the system file is copied to generate the target mirror image file. The method can create the image file according to the appointed partition requirement, so as to solve the problem of overlarge image file caused in the whole disk copying process and realize the technical effect of saving the storage space.
As shown in fig. 2, in one embodiment, determining attribute information of at least one target partition using an external device includes:
s201: detecting a target disk by using external equipment to generate a disk information dictionary; the disk information dictionary comprises at least one partition and label information corresponding to each partition;
s202: determining at least one target partition according to label information in the disk information dictionary; the target partition is a disk partition containing preset label information;
s203: and determining attribute information of the target partition.
The method for determining the attribute information of at least one target partition by using the external equipment can be realized by using a system partition tool in the external equipment to carry out full disk traversal, screening and detection on the target disk and generating a disk information dictionary of the target disk. The disk information dictionary may be a data structure including all files and corresponding partition paths. Specifically, the disk information dictionary may include at least one partition and tag information corresponding to each partition. The form of the disk information dictionary may be determined according to the need, for example, may be a database table structure, a key-value structure, or a nested structure of a database and a key-value, which is not limited herein.
And determining at least one target partition according to the label information in the disk information dictionary, wherein the target partition is a disk partition containing preset label information. The determination of the target partition may be accomplished by first traversing all the data records in the disk information dictionary. And then calling a labeled object searching method (find_labeled_part) in the DiskPart tool to search a partition path labeled with a preset label. The preset label is a label marked when the target disk is installed in the system, or a label marked when a user uses the target disk, which is not limited herein. The preset label can be set according to the requirement. For example, the target partition may be a partition or partitions on the target disk, without limitation. For example, the partition on the target disk storing the system file has a/dev/sdb 1 partition and a/dev/sdb 2 partition, where/dev/sdb 1 partition is labeled with an MKFS_ESP and/dev/sdb 2 is labeled with an img-rootfs. Through the find_delayed_part method in the DiskPart tool, the MKFS_ESP label and the img-rootfs label can be positioned, and then the/dev/sdb 1 partition and the/dev/sdb 2 partition corresponding to the label, namely the target partition, can be determined.
After the target partition is determined, step S203 is performed, i.e., attribute information of the target partition is determined. Specifically, the implementation manner of determining the attribute information may be to determine all detailed information related to the target partition by using an all_partition_info method of the diskport object, including: partition number (partition_number), partition length (length), partition liveness (active), partition type (type), partition name (name), partition label (label), and the like.
Through the above process, the attribute information of the target partition can be determined, so that the size of the target image file manufactured according to the attribute information can be accurately controlled.
As shown in fig. 3, in one embodiment, creating a temporary image file according to attribute information of a target partition includes:
s301: creating a blank mirror image file according to the partition capacity information;
s302: and carrying out partition processing on the blank mirror image file according to the partition path information to obtain a temporary mirror image file.
The implementation manner of creating the blank image file may be to call the partition capacity information by creating a disk file command, and generate the blank image file in img format according to the partition capacity information. Specifically, one sparse file may be created by a truncate command (create disk file command) and then converted into a blank image file in img format. The sparse file is a file storage mode in a file system, and continuous storage space required by the file is allocated to the sparse file in advance when the sparse file is created. For example, the partition capacity information of the target partition is 20 Gigabytes (GB), and by determining the sector start point and the sector end point, one 20G contiguous memory space is allocated in advance for creating a blank image file.
And carrying out partition processing on the blank mirror image file according to the partition path information to obtain a temporary mirror image file. Specifically, the partition function can be automatically called to perform partition processing on the blank mirror image file, so that the blank mirror image file containing the target partition path information is obtained. For example, a temporary image file may be created from a blank image file by creating a/dev/sdb 1 partition and a/dev/sdb 2 partition.
As shown in fig. 4, in one embodiment, creating a blank image file according to partition capacity information includes:
s401: determining the size of a blank mirror image file according to the capacity information of the target partition and the reserved capacity information; the reserved capacity information is used for representing the disk capacity occupied by the system files at the head and tail of the disk;
s402: and creating the blank image file according to the size of the blank image file.
The size of the blank image file may be determined by adding the capacity of the target partition and the reserved capacity to be the size of the blank image file. Specifically, firstly, the capacity information of the target partition is determined, specifically, a path (path) and a length (length) of the partition/dev/sdb 1 and the partition/dev/sdb 2 in the DiskPart tool are determined by using an all_partition_info method, the lengths of the two target partitions are added, and the reserved space of the head and the tail of the target disk is added, so that the size of the blank image file to be created can be calculated. The reserved capacity of the target disk can be obtained through a get (sector_size) method in the diskpoint tool. For example, the length of the/dev/sdb 1 partition is 15G, the length of the/dev/sdb 2 partition is 10G, and the reserved space acquired by the call get (sector_size) method to the head and tail of the target disk is 5G, so that the size of the computed blank image file is: 15 g+10g+5g=30g.
And creating the blank image file according to the determined size of the blank image file.
Through the above process, the blank image file can be created by calculating the sum of the capacities of the target partitions and the reserved capacity, so that redundant partitions are prevented from being added in the process of creating the image file, and the memory space occupied by the image file is reduced.
In one embodiment, the partitioning of the blank mirror file according to the partition path information includes:
mounting the network block equipment on the blank mirror image file;
directory information corresponding to the partition path information is created in the network block device, and the creation result is used as a temporary image file.
Wherein by mounting the network block device (network block device, nbd) to the blank image file, the blank image file can be entered based on nbd and loaded. Before loading the blank image file, whether the blank image file is successfully virtualized into the network block device can be judged. If the failure occurs, the error reason is checked and reloaded. Only after the network block device virtualization is successful, directory information corresponding to the partition path information is created in nbd. For example, a catalog corresponding to the/dev/sdb 1 partition and the/dev/sdb 2 partition is created in the nbd, the starting point and length of occupied memory under the corresponding catalog are consistent with the target partition, and the creation result is used as a temporary image file.
In one embodiment, after generating the target image file, the method further includes:
removing the mounting of the network block equipment and the target image file;
and converting the target image file after the mounting is removed into an image file in a preset format.
Specifically, after the partition is created in the nbd, the partition table of the nbd device can be repaired first, and then the network block device and the target image file are removed from the mount. After the mounting is removed, the target image file is converted into an image file in a preset format. Specifically, the target image file may be first compressed and converted into an image file in a preset format. The preset format may be a qcow2 format file, or may be other formats, which are not limited herein. The target image file in the preset format is then copied to the remote path and its checksum (checksum) is calculated. And finally, clearing the junk files and the related directory information, and completing the manufacture of the target image file.
As shown in fig. 5, the present disclosure relates to a mirror image producing apparatus, comprising:
an attribute information determining unit 501 configured to determine attribute information of at least one target partition using an external device; the target partition is a partition in which a system file is stored on the target disk; the attribute information includes partition capacity information and partition path information; the system files are files required by the operation of the operating system;
a temporary image file creating unit 502 for creating a temporary image file according to the attribute information;
the target image file generating unit 503 is configured to copy the system file to a specified directory in the temporary image file, and generate a target image file.
In one embodiment, the attribute information determining unit 501 includes:
the dictionary generating subunit is used for detecting the target disk by using external equipment and generating a disk information dictionary; the disk information dictionary comprises at least one partition and label information corresponding to each partition;
the target partition determining subunit is used for determining at least one target partition according to the label information in the disk information dictionary; the target partition is a disk partition containing preset label information;
the attribute information determination subunit is configured to determine attribute information of the target partition.
In one embodiment, temporary image creation unit 502 includes:
a blank image file creating subunit, configured to create a blank image file according to the partition capacity information;
and the partition processing subunit is used for carrying out partition processing on the blank mirror image file according to the partition path information to obtain a temporary mirror image file.
In one embodiment, a blank image file creation subunit includes:
the computing subunit is used for determining the size of the blank mirror image file according to the capacity information of the target partition and the reserved capacity information; the reserved capacity information is used for representing the disk capacity occupied by the system files at the head and tail of the disk;
and the blank image file creation execution subunit is used for creating the blank image file according to the size of the blank image file.
In one embodiment, a partitioned processing subunit includes:
the mounting subunit is used for mounting the network block equipment to the blank image file;
and the directory information creation subunit is used for creating directory information corresponding to the partition path information in the network block equipment, and taking the creation result as a temporary image file.
In one embodiment, the method further comprises:
the mounting removing subunit is used for removing the mounting of the network block equipment and the target image file;
and the format conversion subunit is used for converting the target image file after the mounting is removed into an image file with a preset format.
In the technical scheme of the disclosure, the acquisition, storage, application and the like of the related user personal information all conform to the regulations of related laws and regulations, and the public sequence is not violated.
According to embodiments of the present disclosure, the present disclosure also provides an electronic device, a readable storage medium and a computer program product.
Fig. 6 illustrates a schematic block diagram of an example electronic device 600 that may be used to implement embodiments of the present disclosure. Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular telephones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be exemplary only, and are not meant to limit implementations of the disclosure described and/or claimed herein.
As shown in fig. 6, the apparatus 600 includes a computing unit 601 that can perform various appropriate actions and processes according to a computer program stored in a Read Only Memory (ROM) 602 or a computer program loaded from a storage unit 608 into a Random Access Memory (RAM) 603. In the RAM 603, various programs and data required for the operation of the device 600 may also be stored. The computing unit 601, ROM 602, and RAM 603 are connected to each other by a bus 604. An input/output (I/O) interface 605 is also connected to bus 604.
Various components in the device 600 are connected to the I/O interface 605, including: an input unit 606 such as a keyboard, mouse, etc.; an output unit 607 such as various types of displays, speakers, and the like; a storage unit 608, such as a magnetic disk, optical disk, or the like; and a communication unit 609 such as a network card, modem, wireless communication transceiver, etc. The communication unit 609 allows the device 600 to exchange information/data with other devices via a computer network, such as the internet, and/or various telecommunication networks.
The computing unit 601 may be a variety of general and/or special purpose processing components having processing and computing capabilities. Some examples of computing unit 601 include, but are not limited to, a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), various specialized Artificial Intelligence (AI) computing chips, various computing units running machine learning model algorithms, a Digital Signal Processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 601 performs the various methods and processes described above, such as the method of mirror image production. For example, in some embodiments, the method of mirroring may be implemented as a computer software program tangibly embodied on a machine-readable medium, such as storage unit 608. In some embodiments, part or all of the computer program may be loaded and/or installed onto the device 600 via the ROM 602 and/or the communication unit 609. When the computer program is loaded into RAM 603 and executed by computing unit 601, one or more steps of the method of mirroring described above may be performed. Alternatively, in other embodiments, the computing unit 601 may be configured to perform the mirrored method in any other suitable way (e.g., by means of firmware).
Various implementations of the systems and techniques described here above may be implemented in digital electronic circuitry, integrated circuit systems, field Programmable Gate Arrays (FPGAs), application Specific Integrated Circuits (ASICs), application Specific Standard Products (ASSPs), systems On Chip (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs, the one or more computer programs may be executed and/or interpreted on a programmable system including at least one programmable processor, which may be a special purpose or general-purpose programmable processor, that may receive data and instructions from, and transmit data and instructions to, a storage system, at least one input device, and at least one output device.
Program code for carrying out methods of the present disclosure may be written in any combination of one or more programming languages. These program code may be provided to a processor or controller of a general purpose computer, special purpose computer, or other programmable data processing apparatus such that the program code, when executed by the processor or controller, causes the functions/operations specified in the flowchart and/or block diagram to be implemented. The program code may execute entirely on the machine, partly on the machine, as a stand-alone software package, partly on the machine and partly on a remote machine or entirely on the remote machine or server.
In the context of this disclosure, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. The machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
To provide for interaction with a user, the systems and techniques described here can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and pointing device (e.g., a mouse or trackball) by which a user can provide input to the computer. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form, including acoustic input, speech input, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a background component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such background, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), wide Area Networks (WANs), and the internet.
The computer system may include a client and a server. The client and server are typically remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The server may be a cloud server, a server of a distributed system, or a server incorporating a blockchain.
It should be appreciated that various forms of the flows shown above may be used to reorder, add, or delete steps. For example, the steps recited in the present disclosure may be performed in parallel or sequentially or in a different order, provided that the desired results of the technical solutions of the present disclosure are achieved, and are not limited herein.
The above detailed description should not be taken as limiting the scope of the present disclosure. It will be apparent to those skilled in the art that various modifications, combinations, sub-combinations and alternatives are possible, depending on design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present disclosure are intended to be included within the scope of the present disclosure.
Claims (14)
1. A mirror image production method, comprising:
determining attribute information of at least one target partition by using external equipment; the target partition is a partition in which a system file is stored on a target disk; the attribute information comprises partition capacity information and partition path information; the system files are files required by the operation of an operating system;
creating a temporary mirror image file according to the attribute information;
copying the system file to a designated directory in the temporary image file to generate a target image file.
2. The method of claim 1, wherein the determining, with the external device, attribute information of at least one target partition, comprises:
detecting the target disk by using external equipment to generate a disk information dictionary; the disk information dictionary comprises at least one partition and label information corresponding to each partition;
determining at least one target partition according to the label information in the disk information dictionary; the target partition is a disk partition containing preset label information;
and determining attribute information of the target partition.
3. The method of claim 2, wherein the creating a temporary image file according to the attribute information of the target partition comprises:
creating a blank mirror image file according to the partition capacity information;
and carrying out partition processing on the blank image file according to the partition path information to obtain a temporary image file.
4. The method of claim 3, wherein said creating a blank image file from said partition capacity information comprises:
determining the size of the blank mirror image file according to the capacity information and the reserved capacity information of the target partition; the reserved capacity information is used for representing the disk capacity occupied by system files at the head and tail of the disk;
and creating the blank image file according to the size of the blank image file.
5. The method of claim 3, wherein the partitioning the blank image file according to the partition path information includes:
mounting network block equipment to the blank mirror image file;
and creating directory information corresponding to the partition path information in the network block equipment, and taking the creation result as the temporary image file.
6. The method of claim 5, wherein after generating the target image file, further comprising:
removing the mounting of the network block equipment and the target image file;
and converting the target image file after the mounting is removed into an image file in a preset format.
7. A mirror image producing apparatus comprising:
the attribute information determining unit is used for determining attribute information of at least one target partition by using the external equipment; the target partition is a partition in which a system file is stored on a target disk; the attribute information comprises partition capacity information and partition path information; the system files are files required by the operation of an operating system;
a temporary image file creating unit for creating a temporary image file according to the attribute information;
and the target image file generating unit is used for copying the system file to the appointed directory in the temporary image file to generate a target image file.
8. The apparatus of claim 7, wherein the attribute information determining unit comprises:
the dictionary generating subunit is used for detecting the target disk by using external equipment and generating a disk information dictionary; the disk information dictionary comprises at least one partition and label information corresponding to each partition;
a target partition determining subunit, configured to determine at least one target partition according to the tag information in the disk information dictionary; the target partition is a disk partition containing preset label information;
and the attribute information determination subunit is used for determining the attribute information of the target partition.
9. The apparatus of claim 8, wherein the temporary image file creation unit comprises:
a blank image file creating subunit, configured to create a blank image file according to the partition capacity information;
and the partition processing subunit is used for carrying out partition processing on the blank image file according to the partition path information to obtain a temporary image file.
10. The apparatus of claim 9, wherein the blank image file creation subunit comprises:
a calculating subunit, configured to determine a size of the blank image file according to the capacity information and the reserved capacity information of the target partition; the reserved capacity information is used for representing the disk capacity occupied by system files at the head and tail of the disk;
and the blank image file creation execution subunit is used for creating the blank image file according to the size of the blank image file.
11. The apparatus of claim 9, wherein the partitioned processing subunit comprises:
a mounting subunit, configured to mount a network block device onto the blank image file;
and the directory information creation subunit is used for creating directory information corresponding to the partition path information in the network block equipment, and taking the creation result as the temporary image file.
12. The apparatus of claim 11, further comprising:
the mounting removing subunit is used for removing the mounting of the network block equipment and the target image file;
and the format conversion subunit is used for converting the target image file after the mounting is removed into an image file with a preset format.
13. An electronic device, comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-6.
14. A non-transitory computer readable storage medium storing computer instructions for causing the computer to perform the method of any one of claims 1-6.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202311323350.7A CN117289956B (en) | 2023-10-12 | 2023-10-12 | Mirror image manufacturing method, apparatus, electronic device and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202311323350.7A CN117289956B (en) | 2023-10-12 | 2023-10-12 | Mirror image manufacturing method, apparatus, electronic device and storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN117289956A true CN117289956A (en) | 2023-12-26 |
CN117289956B CN117289956B (en) | 2024-06-11 |
Family
ID=89258485
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202311323350.7A Active CN117289956B (en) | 2023-10-12 | 2023-10-12 | Mirror image manufacturing method, apparatus, electronic device and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN117289956B (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN117891472A (en) * | 2024-03-11 | 2024-04-16 | 杭州吉利汽车数字科技有限公司 | Bare metal mirror image deployment method, device and medium |
Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103713970A (en) * | 2013-12-31 | 2014-04-09 | 曙光云计算技术有限公司 | Disk mirroring file snapshot making method and system based on virtual machine |
CN106155589A (en) * | 2016-06-30 | 2016-11-23 | 数普金通数据技术有限公司 | A kind of virtual dynamic partition image file generates method and system |
CN107783724A (en) * | 2016-08-30 | 2018-03-09 | 深圳市中兴微电子技术有限公司 | A kind of generation method and device of full image file |
US10127029B1 (en) * | 2016-12-30 | 2018-11-13 | Veritas Technologies Llc | Operating system installation using logical volumes |
CN113886005A (en) * | 2021-09-13 | 2022-01-04 | 上海臻相软件科技有限公司 | Method for carrying out computer simulation on partitioned mirror image |
CN114579148A (en) * | 2022-03-02 | 2022-06-03 | 联想开天科技有限公司 | Installation method and device of operating system |
CN115357275A (en) * | 2022-07-11 | 2022-11-18 | 威胜信息技术股份有限公司 | Method, medium and terminal for reading and upgrading Nand Flash mirror image based on Linux |
CN116431399A (en) * | 2023-04-14 | 2023-07-14 | 北京网神洞鉴科技有限公司 | Disk mirror image manufacturing method, device, computer readable storage medium and system |
-
2023
- 2023-10-12 CN CN202311323350.7A patent/CN117289956B/en active Active
Patent Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103713970A (en) * | 2013-12-31 | 2014-04-09 | 曙光云计算技术有限公司 | Disk mirroring file snapshot making method and system based on virtual machine |
CN106155589A (en) * | 2016-06-30 | 2016-11-23 | 数普金通数据技术有限公司 | A kind of virtual dynamic partition image file generates method and system |
CN107783724A (en) * | 2016-08-30 | 2018-03-09 | 深圳市中兴微电子技术有限公司 | A kind of generation method and device of full image file |
US10127029B1 (en) * | 2016-12-30 | 2018-11-13 | Veritas Technologies Llc | Operating system installation using logical volumes |
CN113886005A (en) * | 2021-09-13 | 2022-01-04 | 上海臻相软件科技有限公司 | Method for carrying out computer simulation on partitioned mirror image |
CN114579148A (en) * | 2022-03-02 | 2022-06-03 | 联想开天科技有限公司 | Installation method and device of operating system |
CN115357275A (en) * | 2022-07-11 | 2022-11-18 | 威胜信息技术股份有限公司 | Method, medium and terminal for reading and upgrading Nand Flash mirror image based on Linux |
CN116431399A (en) * | 2023-04-14 | 2023-07-14 | 北京网神洞鉴科技有限公司 | Disk mirror image manufacturing method, device, computer readable storage medium and system |
Non-Patent Citations (1)
Title |
---|
金剑忠: ""在UEFI引导+GPT分区模式安装Win10"", 《电脑知识与技术》, 14 October 2016 (2016-10-14), pages 181 - 182 * |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN117891472A (en) * | 2024-03-11 | 2024-04-16 | 杭州吉利汽车数字科技有限公司 | Bare metal mirror image deployment method, device and medium |
CN117891472B (en) * | 2024-03-11 | 2024-06-04 | 杭州吉利汽车数字科技有限公司 | Bare metal mirror image deployment method, device and medium |
Also Published As
Publication number | Publication date |
---|---|
CN117289956B (en) | 2024-06-11 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN117289956B (en) | Mirror image manufacturing method, apparatus, electronic device and storage medium | |
US11099828B2 (en) | Updating a metadata structure for a firmware update | |
US20230367577A1 (en) | Method and apparatus for updating cloud platform | |
JP2023036774A (en) | Access control method of shared memory, access control device of shared memory, electronic apparatus, and autonomous vehicle | |
EP4145298A1 (en) | Method and apparatus for snapshotting metadata | |
CN113378091A (en) | Visual project generation method and device, electronic equipment and storage medium | |
CN115237436A (en) | Application deployment method and device, electronic equipment and readable storage medium | |
CN112817660B (en) | Method, device, equipment and storage medium for expanding applet capability | |
CN114328739A (en) | Data synchronization method, data reading method, data synchronization device, data reading device, electronic equipment, storage medium and product | |
CN116450184B (en) | System upgrading method and device, electronic equipment and storage medium | |
CN117236236A (en) | Chip design data management method and device, electronic equipment and storage medium | |
CN117082046A (en) | Data uploading method, device, equipment and storage medium | |
US12007965B2 (en) | Method, device and storage medium for deduplicating entity nodes in graph database | |
CN116028517A (en) | Fusion database system and electronic equipment | |
CN116009847A (en) | Code generation method, device, electronic equipment and storage medium | |
CN114327271B (en) | Lifecycle management method, apparatus, device and storage medium | |
CN115454971A (en) | Data migration method and device, electronic equipment and storage medium | |
CN115794742A (en) | File path data processing method, device, equipment and storage medium | |
CN115328736A (en) | Probe deployment method, device, equipment and storage medium | |
CN113326038B (en) | Method, apparatus, device, storage medium and program product for providing service | |
CN114780022A (en) | Method and device for realizing write-addition operation, electronic equipment and storage medium | |
CN113986134A (en) | Method for storing data, method and device for reading data | |
CN114679468B (en) | File transmission method and device, electronic equipment and computer readable storage medium | |
CN117008837A (en) | Partition mounting method, device and equipment of magnetic disk and storage medium | |
CN114579520A (en) | Mirror image data processing method, mirror image data loading method and device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |