CN107229467A - A kind of device mapper partition methods based on android containers - Google Patents

A kind of device mapper partition methods based on android containers Download PDF

Info

Publication number
CN107229467A
CN107229467A CN201710326456.0A CN201710326456A CN107229467A CN 107229467 A CN107229467 A CN 107229467A CN 201710326456 A CN201710326456 A CN 201710326456A CN 107229467 A CN107229467 A CN 107229467A
Authority
CN
China
Prior art keywords
namespace
mnt
device mapper
list
mapper
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201710326456.0A
Other languages
Chinese (zh)
Inventor
王晓华
张韵
江滨
邓永德
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Haihang Communication Technology Co Ltd
Original Assignee
Beijing Haihang Communication 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 Haihang Communication Technology Co Ltd filed Critical Beijing Haihang Communication Technology Co Ltd
Priority to CN201710326456.0A priority Critical patent/CN107229467A/en
Publication of CN107229467A publication Critical patent/CN107229467A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/31Programming languages or programming paradigms
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44521Dynamic linking or loading; Link editing at or after load time, e.g. Java class loading

Landscapes

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

Abstract

The invention provides a kind of device mapper partition methods based on android containers, comprise the following steps:S1, be operating system nucleus in mnt namespace structures add a linked list head dm_list, the mnt_namespace structures are used to create device mapper, the device mapper newly created are suspended on using mnt_namespace linked list head dm_list as the chained list of head, each mnt namespace have a device mapper chained list.The beneficial effects of the invention are as follows:Because Device Mapper are kernel virtual drives, thus in the absence of different android machines it is incompatible the problem of, improve compatibility.

Description

A kind of device mapper partition methods based on android containers
Technical field
The present invention relates to partition method, more particularly to a kind of device mapper isolation sides based on android containers Method.
Background technology
With android development, the multisystem scheme based on container is proposed out on android, wherein Realize process isolation, file system isolation, Network Isolation etc..Android container schemes are to be based on linux kernel(Operation System kernel)The namespace of offer(NameSpace)With cgroups technologies, isolated on single kernel multiple complete Whole Virtual Space.
In order to illustrate mechanism below, how the isolation for first saying down file system in the scheme based on single kernel multisystem is Realize.The isolation of file system is by chroot(Change Root, that is, root referenced during reprogramming execution Directory location)Realized with mnt namespace, switch the rootfs in a new space by chroot(Root file system), this Sample we the bibliographic structure as on single system can be just created in new rootfs.
Device mapper(Device Mapper are to support the general of logical volume management to set in Linux2.6 kernels Standby mapping mechanism, it provides the kernel frame of a high modularization for realization for the Block Device Driver of SRM Structure)It is the virtual of linux block equipment, is highly suitable for integrated a variety of functions on the basis of block device.Device Mapper can To realize a variety of functions such as soft raid, soft encryption, logical volume band, multipath, mirror image, snapshot.Google is on android System subregions signature, completeness check and userdata subregion encryption functions are realized with Device mapper.
On android in single kernel multisystem scheme, each system realizes system schools with Device mapper Test and encrypted with userdata, and bibliographic structure is the same.Primary Device mapper distinguish different using mount point Device mapper entities ,/system this mount point wounds are passed through then just occurring in the scheme based on single kernel multisystem Build up after work(Device Mapper, second system can not just use the mount point of same title to create Device Mapper The problem of.
One feasible solution is that the file system of Device Mapper mechanism will be needed to use in different systems Change different mount points into, but the program needs to change many codes using this document system, and the service newly increased is all needed It is noted that the problem.
The content of the invention
In order to solve the problems of the prior art, the invention provides a kind of device based on android containers Mapper partition methods.
The invention provides a kind of device mapper partition methods based on android containers, comprise the following steps:
S1, be operating system nucleus in mnt namespace structures addition one linked list head dm_list, the mnt_ Namespace structures are used to create device mapper, and the device mapper newly created are suspended to mnt_namespace Linked list head dm_list for head chained list on, each mnt namespace have a device mapper chained list;
S2, inquiry device mapper in need operation, where being required for first determining the device mapper to be found Mnt namespace, then on the linked list head dm_list of the mnt namespace search.
As a further improvement on the present invention, device mapper foundation step is:In operating system nucleus, look for To the corresponding mnt namespace of current process, judge whether there is the device of mount point of the same name on the mnt namespace Mapper, if so, then returning to mistake, if it is not, creating device mapper, and is mounted to correspondence mnt On namespace linked list head dm_list.
The beneficial effects of the invention are as follows:Because Device Mapper are kernel virtual drives, so in the absence of difference Android machines it is incompatible the problem of, improve compatibility.
Brief description of the drawings
Fig. 1 is a kind of device mapper of the device mapper partition methods based on android containers of the present invention Chained list schematic diagram.
Fig. 2 is a kind of device mapper of the device mapper partition methods based on android containers of the present invention Visioning procedure figure.
Embodiment
The invention will be further described for explanation and embodiment below in conjunction with the accompanying drawings.
The problem of conflicting for the Device Mapper mount points of the same name solved in single kernel multisystem, the present invention proposed one The scheme based on linux namespace of kind, solves the problem in Device Mapper driving.
As shown in Figure 1 to Figure 2, a kind of device mapper partition methods based on android containers, including following step Suddenly:
1st, it is that struct mnt_namespace in kernel add a linked list head dm_list, the structure with creating later When building device mapper, the device mapper newly created are suspended to the chain using mnt_namespace dm_list as head On table.
2nd, it is the mnt in kernel when calling one new mnt namespace of establishment by systems such as clone () Namespace's.
3rd, as one device mapper of some system creation, by the corresponding mnt namespace of the process, so The device mapper structures newly created are suspended on correspondence mnt namespace dm_list afterwards.
4th, inquiry device mapper in need operation, be required for the device mapper institutes for first determining to be found Mnt namespace, then on the dm_list of the mnt namespace search.
As shown in figure 1, each mnt namespace have a device mapper chained list.
Device mapper foundation step is:In operating system nucleus, the corresponding mnt of current process is found Namespace, judges whether there are the device mapper of mount point of the same name on the mnt namespace, if so, then returning Mistake is returned, if it is not, creating device mapper, and correspondence mnt namespace linked list head dm_list is mounted to On.
A kind of device mapper partition methods based on android containers that the present invention is provided have advantages below:
1. because Device Mapper are kernel virtual drives, so incompatible in the absence of different android machines The problem of.
2. without the concern for the interface used in modification android to device Mapper.
Above content is to combine specific preferred embodiment further description made for the present invention, it is impossible to assert The specific implementation of the present invention is confined to these explanations.For general technical staff of the technical field of the invention, On the premise of not departing from present inventive concept, some simple deduction or replace can also be made, should all be considered as belonging to the present invention's Protection domain.

Claims (2)

1. a kind of device mapper partition methods based on android containers, it is characterised in that comprise the following steps:
S1, be operating system nucleus in mnt namespace structures addition one linked list head dm_list, the mnt_ Namespace structures are used to create device mapper, and the device mapper newly created are suspended to mnt_namespace Linked list head dm_list for head chained list on, each mnt namespace have a device mapper chained list;
S2, inquiry device mapper in need operation, where being required for first determining the device mapper to be found Mnt namespace, then on the linked list head dm_list of the mnt namespace search.
2. the device mapper partition methods according to claim 1 based on android containers, it is characterised in that Device mapper foundation step is:In operating system nucleus, the corresponding mnt namespace of current process are found, are sentenced Whether on the mnt namespace have the device mapper of of the same name mount point, if so, mistake is then returned to, if do not had if breaking Have, then create device mapper, and be mounted on correspondence mnt namespace linked list head dm_list.
CN201710326456.0A 2017-05-10 2017-05-10 A kind of device mapper partition methods based on android containers Pending CN107229467A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710326456.0A CN107229467A (en) 2017-05-10 2017-05-10 A kind of device mapper partition methods based on android containers

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710326456.0A CN107229467A (en) 2017-05-10 2017-05-10 A kind of device mapper partition methods based on android containers

Publications (1)

Publication Number Publication Date
CN107229467A true CN107229467A (en) 2017-10-03

Family

ID=59934149

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710326456.0A Pending CN107229467A (en) 2017-05-10 2017-05-10 A kind of device mapper partition methods based on android containers

Country Status (1)

Country Link
CN (1) CN107229467A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109190386A (en) * 2018-04-04 2019-01-11 中国电子科技网络信息安全有限公司 Container mirror image layered encryption storage method based on Device Mapper
CN113641437A (en) * 2021-08-16 2021-11-12 深圳技德智能科技研究院有限公司 Linux-compatible Android application interface rotation method and device

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101334785A (en) * 2008-07-30 2008-12-31 浙江大学 Method for organizing dummy catalog and managing naming space for distributed file systems
CN106209741A (en) * 2015-05-06 2016-12-07 阿里巴巴集团控股有限公司 A kind of fictitious host computer and partition method, resource access request processing method and processing device

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101334785A (en) * 2008-07-30 2008-12-31 浙江大学 Method for organizing dummy catalog and managing naming space for distributed file systems
CN106209741A (en) * 2015-05-06 2016-12-07 阿里巴巴集团控股有限公司 A kind of fictitious host computer and partition method, resource access request processing method and processing device

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
LSGX: "The Linux Process Principle,NameSpace, PID、PGID、PPID、SID、TID、TTY"", 《HTTPS://WWW.IT610.COM/ARTICLE/2171583.HTM》 *

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109190386A (en) * 2018-04-04 2019-01-11 中国电子科技网络信息安全有限公司 Container mirror image layered encryption storage method based on Device Mapper
CN113641437A (en) * 2021-08-16 2021-11-12 深圳技德智能科技研究院有限公司 Linux-compatible Android application interface rotation method and device
CN113641437B (en) * 2021-08-16 2023-06-16 深圳技德智能科技研究院有限公司 Android-compatible application interface rotation method and device for Linux

Similar Documents

Publication Publication Date Title
CN107256178B (en) Container management platform
US20200092222A1 (en) Automated migration of compute instances to isolated virtual networks
US20180011885A1 (en) Systems and methods for management of virtualization data
US8407702B2 (en) Computer system for managing virtual machine migration
CN112099918A (en) Live migration of clusters in containerized environments
CN102917025B (en) Method for business migration based on cloud computing platform
WO2012113336A1 (en) System for managing resources in virtualized environment and implementation method therefor
CN101488174A (en) Implementing method for dynamically transparent virtual credible platform module
CN104685830A (en) Fault management method, entity and system
US20140115576A1 (en) Extensible Network Configuration Management
US20090249340A1 (en) Managing the Progress of a Plurality of Tasks
RU2008138700A (en) CREATING DISABLED RESOURCE TEMPLATES
CN107222349A (en) A kind of method and device for configuring virtual machine network interface card speed
US9275238B2 (en) Method and apparatus for data security reading
WO2020123213A1 (en) Container migration in computing systems
CN102981888B (en) For the virtualization implementation method of Power server
JP2011523128A (en) Distributed virtual switch for virtualized computer systems
CN106775928A (en) A kind of virtual machine Autonomic Migration Framework system and method between isomery cloud platform
CN108509251A (en) A kind of safety virtualization system suitable for credible performing environment
CN107229467A (en) A kind of device mapper partition methods based on android containers
CN108549571A (en) A kind of safety virtualization method suitable for credible performing environment
CN105468429A (en) Efficient virtual cluster management method and cluster node
US20140053276A1 (en) Safe data storage method and device
US8683026B2 (en) Framework providing unified infrastructure management for polymorphic information technology (IT) functions across disparate groups in a cloud computing environment
CN107273246A (en) A kind of server system backup 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
AD01 Patent right deemed abandoned

Effective date of abandoning: 20210423

AD01 Patent right deemed abandoned