WO2022222351A1 - 一种操作系统安装方法及计算设备 - Google Patents

一种操作系统安装方法及计算设备 Download PDF

Info

Publication number
WO2022222351A1
WO2022222351A1 PCT/CN2021/118422 CN2021118422W WO2022222351A1 WO 2022222351 A1 WO2022222351 A1 WO 2022222351A1 CN 2021118422 W CN2021118422 W CN 2021118422W WO 2022222351 A1 WO2022222351 A1 WO 2022222351A1
Authority
WO
WIPO (PCT)
Prior art keywords
operating system
partition
target
disk
target operating
Prior art date
Application number
PCT/CN2021/118422
Other languages
English (en)
French (fr)
Inventor
张廉洁
Original Assignee
统信软件技术有限公司
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 统信软件技术有限公司 filed Critical 统信软件技术有限公司
Publication of WO2022222351A1 publication Critical patent/WO2022222351A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/61Installation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/4401Bootstrapping
    • G06F9/4406Loading of operating system
    • G06F9/441Multiboot arrangements, i.e. selecting an operating system to be loaded

Definitions

  • the invention relates to the technical field of operating systems, and in particular, to a method for installing an operating system and a computing device.
  • the UOS operating system is gradually selected by users.
  • Install the UOS system on the existing hard disk without destroying the original operating system the user can freely switch the required operating system, which is more practical for the user, and will gradually get used to the UOS system.
  • the present invention provides an operating system installation method to try to solve or at least alleviate the above problems.
  • a method for installing an operating system which is executed in a computing device and includes the steps of: judging whether a first operating system exists in a first disk partition; if there is a first operating system, then: determining the first disk The available space of the partition is used to determine whether the available space is enough to install the target operating system; if it is enough to install the target operating system, the first disk partition is reduced to separate the available space; installing a target partition of a target operating system; and installing the target operating system based on the target partition.
  • the step of creating a target partition suitable for installing the target operating system includes: determining a starting sector number and an ending sector number of the available space. ; Create the target partition within the range of the starting sector number and the ending sector number.
  • the step of installing the target operating system based on the target partition includes: setting a mount point of the target partition, and installing the target operating system to the target partition mount point.
  • the first disk partition is an NTFS partition
  • performing shrinking processing on the first disk partition includes: performing shrinking processing on the first disk partition based on the ntfsresize command. .
  • the step of reducing the first disk partition based on the ntfsresize command includes: reducing the size of the NTFS file system corresponding to the NTFS partition based on the ntfsresize command; deleting the NTFS partition and recreate the new smaller partition.
  • the step of judging whether the first operating system exists in the first disk partition includes: traversing the first disk partition to find out whether the first disk partition includes the related information of the first operating system.
  • the file directory if the relevant file directory is included, it is determined that the first operating system exists in the first disk partition.
  • the step of judging whether the available space is enough to install the target operating system further includes: if not enough to install the target operating system, generating a message that the installation of the target operating system fails, and ending the installation of the target operating system. operating system.
  • the method before judging whether the first operating system exists in the first disk partition, the method further includes the steps of: mounting a boot disk of the target operating system; starting the installation in the boot disk so as to use the installer to install the target operating system; wherein, the boot disk includes an image file of the target operating system, and the image file includes an automatic partition script.
  • the first operating system is a Windows operating system
  • the target operating system is a UOS operating system
  • the relevant file directory includes one or more of the Windows directory, the Users directory, and the Program Files directory.
  • a computing device comprising: at least one processor; and a memory storing program instructions, wherein the program instructions are configured to be adapted to be executed by the at least one processor, the The program instructions include instructions for executing the operating system installation method as described above.
  • a readable storage medium storing program instructions, which when read and executed by a computing device, cause the computing device to perform the method as described above.
  • an operating system installation method is provided.
  • a first operating system such as a Windows operating system
  • another operating system needs to be installed
  • the target operating system for example, the UOS operating system
  • the partition can be automatically performed before the target operating system is installed, and the target partition suitable for installing the target operating system can be automatically created.
  • the operation is simpler and more convenient, so that the user can easily realize the installation of the dual system, experience the dual system, and can switch the two operating systems freely, which improves the user experience.
  • For technicians it is possible to install dual systems in batches, which improves the efficiency of system installation.
  • FIG. 1 shows a schematic diagram of a computing device 100 according to one embodiment of the present invention.
  • FIG. 2 shows a flowchart of an operating system installation method 200 according to an embodiment of the present invention.
  • FIG. 1 is a schematic block diagram of an example computing device 100 .
  • computing device 100 typically includes system memory 106 and one or more processors 104 .
  • the memory bus 108 may be used for communication between the processor 104 and the system memory 106 .
  • the processor 104 may be any type of process including, but not limited to, a microprocessor (UP), a microcontroller (UC), a digital information processor (DSP), or any combination thereof.
  • Processor 104 may include one or more levels of cache, such as L1 cache 110 and L2 cache 112 , processor core 114 , and registers 116 .
  • Exemplary processor cores 114 may include arithmetic logic units (ALUs), floating point units (FPUs), digital signal processing cores (DSP cores), or any combination thereof.
  • the exemplary memory controller 118 may be used with the processor 104 , or in some implementations, the memory controller 118 may be an internal part of the processor 104 .
  • system memory 106 may be any type of memory including, but not limited to, volatile memory (such as RAM), non-volatile memory (such as ROM, flash memory, etc.), or any combination thereof.
  • System memory 106 may include operating system 120 , one or more applications 122 , and program data 124 .
  • applications 122 may be arranged to execute instructions using program data 124 by one or more processors 104 on an operating system.
  • Computing device 100 may also include a storage interface bus 134 .
  • Storage interface bus 134 enables communication from storage devices 132 (eg, removable storage 136 and non-removable storage 138 ) to base configuration 102 via bus/interface controller 130 .
  • Operating system 120, applications 122, and at least a portion of data 124 may be stored on removable storage 136 and/or non-removable storage 138, and via the storage interface bus when computing device 100 is powered on or applications 122 are to be executed 134 is loaded into system memory 106 and executed by one or more processors 104 .
  • Computing device 100 may also include an interface bus 140 that facilitates communication from various interface devices (eg, output device 142 , peripheral interface 144 , and communication device 146 ) to base configuration 102 via bus/interface controller 130 .
  • Example output devices 142 include graphics processing unit 148 and audio processing unit 150 . They may be configured to facilitate communication via one or more A/V ports 152 with various external devices such as displays or speakers.
  • Example peripheral interfaces 144 may include serial interface controller 154 and parallel interface controller 156, which may be configured to facilitate communication via one or more I/O ports 158 and input devices such as keyboard, mouse, pen , voice input devices, touch input devices) or other peripherals (eg printers, scanners, etc.)
  • the example communication device 146 may include a network controller 160 that may be arranged to facilitate communication via one or more communication ports 164 with one or more other computing devices 162 over a network communication link.
  • a network communication link may be one example of a communication medium.
  • Communication media may typically embody computer readable instructions, data structures, program modules in a modulated data signal such as a carrier wave or other transport mechanism, and may include any information delivery media.
  • a "modulated data signal" may be a signal in which one or more of its data sets or whose changes may be made in the signal in a manner that encodes information.
  • communication media may include wired media, such as wired or leased line networks, and various wireless media, such as acoustic, radio frequency (RF), microwave, infrared (IR), or other wireless media.
  • RF radio frequency
  • IR infrared
  • the term computer readable medium as used herein may include both storage media and communication media.
  • Computing device 100 may be implemented as a personal computer including a desktop computer and a notebook computer configuration.
  • computing device 100 may also be implemented as part of a small form factor portable (or mobile) electronic device such as a cellular telephone, digital camera, personal digital assistant (PDA), personal media player device, wireless web browsing device , personal headsets, application-specific devices, or hybrid devices that can include any of the above.
  • PDA personal digital assistant
  • It can even be implemented as a server, such as a file server, database server, application server, and WEB server. The embodiments of the present invention do not limit this.
  • the computing device 100 is configured to perform the operating system installation method 200 according to the present invention.
  • the computing device 100 includes a plurality of program instructions for executing the operating system installation method 200 according to the present invention, so that the operating system installation method 200 of the present invention can be executed in the computing device.
  • FIG. 2 shows a flowchart of an operating system installation method 200 according to an embodiment of the present invention.
  • the method 200 is suitable for execution in a computing device, such as the aforementioned computing device 100 .
  • the user wants the operating system installed in the storage device (hard disk) of the computing device to be the target operating system.
  • the computing device Before installing the target operating system, the computing device needs to obtain an image file of the target operating system, so as to install the target operating system based on the image file of the target operating system.
  • the image file of the target operating system includes an automatic partition script
  • the operating system installation method 200 of the present invention can be implemented based on the automatic partition script.
  • the automatic partitioning of the disk can be realized based on the automatic partitioning script.
  • a bootable disk (eg, a U disk) of the target operating system can be made based on the image file of the target operating system including the automatic partitioning script.
  • the computing device executes the method 200 of the present invention by mounting the boot disk of the target operating system based on the image file including the automatic partitioning script in the boot disk. Specifically, after mounting the boot disk of the target operating system, the computing device starts the installer in the boot disk, and after starting the installer, first executes the automatic partition script, so as to realize the corresponding automatic partition based on the automatic partition script execution method 200 step.
  • the present invention does not limit the specific type of the target operating system.
  • the operating system installation method 200 of the present invention is described in detail by taking the UOS operating system as the target operating system as an example, but the operating system installation solution 200 of the present invention is not limited to the UOS operating system.
  • the method 200 starts at step S210.
  • step S210 it is determined whether there is a first operating system in the first disk partition, that is, it is determined whether other operating systems different from the target operating system have been installed on the hard disk of the current computing device.
  • the present invention does not limit the specific type of the first operating system.
  • the first operating system may be implemented as a Windows operating system, but is not limited thereto.
  • the first disk partition may be implemented as an NTFS disk partition.
  • whether the first operating system exists is determined by judging whether the first disk partition includes a related file directory of the first operating system. Specifically, when judging whether the first operating system exists, the first disk partition is traversed to find out whether the first disk partition includes the relevant file directory of the first operating system. If the relevant file directory is included, it is determined that the first operating system exists in the first disk partition. If the relevant file directory is not included, it means that the first operating system does not exist, and the target operating system is installed directly based on the installer, and the steps related to automatic partitioning are no longer performed.
  • the relevant file directory of the first operating system may include one or more of the Windows directory, the Users directory, and the Program Files directory.
  • step S210 determines that the first operating system exists in the first disk partition. It should be noted that if it is determined in the above step S210 that the first operating system exists in the first disk partition, the original disk partitioning step of the installer is skipped, and the following steps S220-S240 are executed based on the automatic partitioning script.
  • the available space of the first disk partition is determined, and it is determined whether the available space is enough to install the target operating system.
  • the target operating system is, for example, the UOS operating system, but the present invention is not limited thereto.
  • the target operating system can also be implemented as other types of operating systems based on the Linux kernel.
  • step S230 is performed.
  • a shrinking process is performed on the first disk partition so as to separate the available space. In this way, the target operating system can be installed based on the free space released by the first disk partition.
  • the first disk partition (ie, the NTFS partition) is reduced by executing the ntfsresize command under the Linux system.
  • the ntfsresize command can be used to shrink or enlarge any NTFS filesystem located on a disk partition without data loss, the new filesystem will have the specified size.
  • the data in the first disk partition is stored in sequence based on the starting position of the first disk partition, so as to release the remaining available space. Also, it is necessary to ensure that the file contents in the first disk partition cannot be damaged.
  • the size of the NTFS file system corresponding to the NTFS partition is first reduced based on the ntfsresize command. Subsequently, the original NTFS partition is deleted based on a utility (eg fdisk(1M)) and a new smaller partition is re-created to achieve shrinking the NTFS partition size.
  • a utility eg fdisk(1M)
  • a new smaller partition is re-created to achieve shrinking the NTFS partition size.
  • recreating a new partition make sure that it is based on the same starting sector and partition type as the original partition being replaced, otherwise, the file system cannot be accessed.
  • step S240 is executed.
  • a target partition suitable for installing the target operating system is created based on the separated available space. Specifically, after the available space is separated, the starting sector number and the ending sector number of the available space are determined, and based on the starting sector number and the ending sector number, a target partition is created within the range of the starting sector number and the ending sector number.
  • the present invention performs the above steps S210-S240 based on the automatic partitioning script, thereby realizing the automatic partitioning function before installing the target operating system, and automatically creating a target partition suitable for installing the target operating system.
  • the target partition may be created based on the parted command.
  • the final created target partition includes EFI, Boot, Roota, Rootb, swap, Backup, _dde_data.
  • step S250 an installer is used to install the target operating system based on the target partition.
  • the mount point of the target partition is firstly set, and then the target operating system is installed to the mount point of the target partition.
  • creating the mount point of the target partition is achieved by executing the following command:
  • the partition format of the hard disk needs to be determined first.
  • the partition format of the hard disk includes, for example, GPT and MBR. Specifically, determine whether the partition format of the hard disk is GPT or MBR. If it is in GPT format, there is no need to consider whether the partition created is logical or primary. If it is in the MBR format, it is necessary to determine whether the target partition to be created is a logical partition, an extended partition or a primary partition, and then create the target partition.
  • an automatic partitioning script can be pre-injected into the image file of the target operating system, for example, an automatic partitioning script can be added in the oem/before_install directory of the decompressed image file.
  • the automatic partitioning of the disk can be realized based on the automatic partitioning script, that is, the automatic partitioning method in the above steps S210-S240 can be realized based on the automatic partitioning script, and the operating system installation method 200 of the present invention can be realized in cooperation with the installer of the target operating system.
  • the operating system installation method 200 of the present invention in the case that the first operating system has been installed in the computing device, the user can install the target operating system conveniently and quickly to realize dual-system installation.
  • the operating system installation method 200 of the present invention when the first operating system (such as the Windows operating system) has been installed in the computing device, when another target operating system (such as the UOS operating system) needs to be installed, it can be Before installing the target operating system, automatic partitioning is realized, and a target partition suitable for installing the target operating system is automatically created.
  • the operation is simpler and more convenient, so that the user can easily realize the installation of the dual system, experience the dual system, and can switch the two operating systems freely, which improves the user experience. For technicians, it is possible to install dual systems in batches, which improves the efficiency of system installation.
  • the various techniques described herein can be implemented in conjunction with hardware or software, or a combination thereof.
  • the method and apparatus of the present invention may take the form of an embedded tangible medium, such as a removable hard disk, a USB stick, a floppy disk, a CD-ROM, or any other machine-readable storage medium.
  • program code ie, instructions
  • the machine becomes an apparatus for practicing the invention.
  • the computing device typically includes a processor, a storage medium readable by the processor (including volatile and nonvolatile memory and/or storage elements), at least one input device, and at least one output device.
  • the memory is configured to store program codes; the processor is configured to execute the multilingual garbage text identification method of the present invention according to the instructions in the program codes stored in the memory.
  • readable media include readable storage media and communication media.
  • Readable storage media store information such as computer readable instructions, data structures, program modules or other data.
  • Communication media typically embodies computer readable instructions, data structures, program modules or other data in a modulated data signal such as a carrier wave or other transport mechanism and includes any information delivery media. Combinations of any of the above are also included within the scope of readable media.
  • modules or units or components of the apparatus in the examples disclosed herein may be arranged in the apparatus as described in this embodiment, or alternatively may be positioned differently from the apparatus in this example in one or more devices.
  • the modules in the preceding examples may be combined into one module or further divided into sub-modules.
  • modules in the device in the embodiment can be adaptively changed and arranged in one or more devices different from the embodiment.
  • the modules or units or components in the embodiments may be combined into one module or unit or component, and further they may be divided into multiple sub-modules or sub-units or sub-assemblies. All features disclosed in this specification (including accompanying claims, abstract and drawings) and any method so disclosed may be employed in any combination, unless at least some of such features and/or procedures or elements are mutually exclusive. All processes or units of equipment are combined.
  • Each feature disclosed in this specification may be replaced by alternative features serving the same, equivalent or similar purpose, unless expressly stated otherwise.

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Security & Cryptography (AREA)
  • Stored Programmes (AREA)

Abstract

本发明公开了一种操作系统安装方法,在计算设备中执行,包括步骤:判断第一磁盘分区是否存在第一操作系统;如果存在第一操作系统,则:确定第一磁盘分区的可用空间,判断可用空间是否足够安装目标操作系统;如果足够安装目标操作系统,则对所述第一磁盘分区进行缩小处理,以便分隔出可用空间;基于分隔出的可用空间,创建适于安装目标操作系统的目标分区;以及基于所述目标分区安装所述目标操作系统。本发明还公开了相应的计算设备。根据本发明的操作系统安装方法,可以实现方便、快捷地安装双系统,提高了用户体验。

Description

一种操作系统安装方法及计算设备 技术领域
本发明涉及操作系统技术领域,特别涉及一种操作系统安装方法及计算设备。
背景技术
目前,在国产化的浪潮下,UOS操作系统逐渐被用户选择使用。在现有硬盘上安装UOS系统并且不破坏原有的操作系统,用户可以自由切换所需的操作系统,对于用户而言更实用,也会逐渐习惯使用UOS系统。
现有技术中,安装Windows和Linux(包括UOS)双系统的步骤较为复杂,普通用户无法自行安装,技术人员也无法批量安装。现有的安装Windows和UOS双系统的方法主要有以下两种:
1.使用虚拟机的方式,在Windows系统上安装vmware、virtualbox等软件,在这些软件上创建虚拟机安装UOS系统,通过启动虚拟机可以运行UOS系统,基于这种方式安装的UOS系统不能独占硬件资源,导致不能充分发挥UOS的性能,也无法在UOS系统上无缝访问Windows系统上的文件,导致用户体验感较差,影响用户对UOS系统的亲切感。
2.使用U盘安装的方式,首先在Windows系统的分区上手动划分出来一块空间,使用U盘引导系统,将UOS安装到这块划分出来的空间上,启动机器的时候可以在启动界面选择启动哪个操作系统,这种方式需要用户手动划分磁盘分区,增加了安装双系统的复杂度。
可见,现有的这些安装方案较为复杂,不够便捷,用户体验感不好。
为此,需要一种操作系统安装方法,以解决上述技术方案中存在的问题。
发明内容
为此,本发明提供一种操作系统安装方法,以力图解决或者至少缓解上 面存在的问题。
根据本发明的一个方面,提供了一种操作系统安装方法,在计算设备中执行,包括步骤:判断第一磁盘分区是否存在第一操作系统;如果存在第一操作系统,则:确定第一磁盘分区的可用空间,判断可用空间是否足够安装目标操作系统;如果足够安装目标操作系统,则对所述第一磁盘分区进行缩小处理,以便分隔出可用空间;基于分隔出的可用空间,创建适于安装目标操作系统的目标分区;以及基于所述目标分区安装所述目标操作系统。
可选地,在根据本发明的操作系统安装方法中,基于分隔出的可用空间,创建适于安装目标操作系统的目标分区的步骤包括:确定所述可用空间的起始扇区号和结束扇区号;在所述起始扇区号与结束扇区号的范围内创建所述目标分区。
可选地,在根据本发明的操作系统安装方法中,基于所述目标分区安装目标操作系统的步骤包括:设置所述目标分区的挂载点,将所述目标操作系统安装到所述目标分区的挂载点。
可选地,在根据本发明的操作系统安装方法中,所述第一磁盘分区是NTFS分区,对所述第一磁盘分区进行缩小处理包括:基于ntfsresize命令对所述第一磁盘分区进行缩小处理。
可选地,在根据本发明的操作系统安装方法中,基于ntfsresize命令对所述第一磁盘分区进行缩小处理的步骤包括:基于ntfsresize命令缩小NTFS分区对应的NTFS文件系统的大小;删除所述NTFS分区,并重新创建较小的新的分区。
可选地,在根据本发明的操作系统安装方法中,判断第一磁盘分区是否存在第一操作系统的步骤包括:遍历第一磁盘分区,以查找第一磁盘分区是否包括第一操作系统的相关文件目录;如果包括相关文件目录,则确定第一磁盘分区存在第一操作系统。
可选地,在根据本发明的操作系统安装方法中,判断可用空间是否足够安装目标操作系统的步骤还包括:如果不够安装目标操作系统,则生成目标操作系统安装失败的消息,并结束安装目标操作系统。
可选地,在根据本发明的操作系统安装方法中,在判断第一磁盘分区是 否存在第一操作系统之前,还包括步骤:挂载目标操作系统的启动盘;启动所述启动盘中的安装器,以便利用所述安装器安装目标操作系统;其中,所述启动盘中包括目标操作系统的镜像文件,所述镜像文件中包括自动分区脚本。
可选地,在根据本发明的操作系统安装方法中,所述第一操作系统为Windows操作系统,所述目标操作系统为UOS操作系统。
可选地,在根据本发明的操作系统安装方法中,所述相关文件目录包括Windows目录、Users目录、Program Files目录中的一种或多种。
根据本发明的一个方面,提供了一种计算设备,包括:至少一个处理器;以及存储器,存储有程序指令,其中,所述程序指令被配置为适于由所述至少一个处理器执行,所述程序指令包括用于执行如上所述的操作系统安装方法的指令。
根据本发明的一个方面,提供了一种存储有程序指令的可读存储介质,当所述程序指令被计算设备读取并执行时,使得所述计算设备执行如上所述方法。
根据本发明的技术方案,提供了一种操作系统安装方法,根据本发明的操作系统安装方法,在计算设备中已经安装了第一操作系统(例如Windows操作系统)的情况下,需要安装另一个目标操作系统(例如UOS操作系统)时,能实现在安装目标操作系统之前,自动进行分区,自动创建适于安装目标操作系统的目标分区。这样,对于用户安装双系统而言,操作更加简单、便捷,使得用户很容易实现双系统的安装、体验双系统,并可以自由切换两种操作系统,提高了用户使用体验感。对于技术人员来说,可以实现批量安装双系统,提高了系统安装的效率。
附图说明
为了实现上述以及相关目的,本文结合下面的描述和附图来描述某些说明性方面,这些方面指示了可以实践本文所公开的原理的各种方式,并且所有方面及其等效方面旨在落入所要求保护的主题的范围内。通过结合附图阅读下面的详细描述,本公开的上述以及其它目的、特征和优势将变得更加明 显。遍及本公开,相同的附图标记通常指代相同的部件或元素。
图1示出了根据本发明一个实施例的计算设备100的示意图;以及
图2示出了根据本发明一个实施例的操作系统安装方法200的流程图。
具体实施方式
下面将参照附图更详细地描述本公开的示例性实施例。虽然附图中显示了本公开的示例性实施例,然而应当理解,可以以各种形式实现本公开而不应被这里阐述的实施例所限制。相反,提供这些实施例是为了能够更透彻地理解本公开,并且能够将本公开的范围完整的传达给本领域的技术人员。
图1是示例计算设备100的示意框图。
如图1所示,在基本的配置102中,计算设备100典型地包括系统存储器106和一个或者多个处理器104。存储器总线108可以用于在处理器104和系统存储器106之间的通信。
取决于期望的配置,处理器104可以是任何类型的处理,包括但不限于:微处理器(UP)、微控制器(UC)、数字信息处理器(DSP)或者它们的任何组合。处理器104可以包括诸如一级高速缓存110和二级高速缓存112之类的一个或者多个级别的高速缓存、处理器核心114和寄存器116。示例的处理器核心114可以包括运算逻辑单元(ALU)、浮点数单元(FPU)、数字信号处理核心(DSP核心)或者它们的任何组合。示例的存储器控制器118可以与处理器104一起使用,或者在一些实现中,存储器控制器118可以是处理器104的一个内部部分。
取决于期望的配置,系统存储器106可以是任意类型的存储器,包括但不限于:易失性存储器(诸如RAM)、非易失性存储器(诸如ROM、闪存等)或者它们的任何组合。系统存储器106可以包括操作系统120、一个或者多个应用122以及程序数据124。在一些实施方式中,应用122可以布置为在操作系统上由一个或多个处理器104利用程序数据124执行指令。
计算设备100还可以包括储存接口总线134。储存接口总线134实现了从储存设备132(例如,可移除储存器136和不可移除储存器138)经由总线/接口控制器130到基本配置102的通信。操作系统120、应用122以及数据 124的至少一部分可以存储在可移除储存器136和/或不可移除储存器138上,并且在计算设备100上电或者要执行应用122时,经由储存接口总线134而加载到系统存储器106中,并由一个或者多个处理器104来执行。
计算设备100还可以包括有助于从各种接口设备(例如,输出设备142、外设接口144和通信设备146)到基本配置102经由总线/接口控制器130的通信的接口总线140。示例的输出设备142包括图形处理单元148和音频处理单元150。它们可以被配置为有助于经由一个或者多个A/V端口152与诸如显示器或者扬声器之类的各种外部设备进行通信。示例外设接口144可以包括串行接口控制器154和并行接口控制器156,它们可以被配置为有助于经由一个或者多个I/O端口158和诸如输入设备(例如,键盘、鼠标、笔、语音输入设备、触摸输入设备)或者其他外设(例如打印机、扫描仪等)之类的外部设备进行通信。示例的通信设备146可以包括网络控制器160,其可以被布置为便于经由一个或者多个通信端口164与一个或者多个其他计算设备162通过网络通信链路的通信。
网络通信链路可以是通信介质的一个示例。通信介质通常可以体现为在诸如载波或者其他传输机制之类的调制数据信号中的计算机可读指令、数据结构、程序模块,并且可以包括任何信息递送介质。“调制数据信号”可以是这样的信号,它的数据集中的一个或者多个或者它的改变可以在信号中以编码信息的方式进行。作为非限制性的示例,通信介质可以包括诸如有线网络或者专线网络之类的有线介质,以及诸如声音、射频(RF)、微波、红外(IR)或者其它无线介质在内的各种无线介质。这里使用的术语计算机可读介质可以包括存储介质和通信介质二者。
计算设备100可以实现为包括桌面计算机和笔记本计算机配置的个人计算机。当然,计算设备100也可以实现为小尺寸便携(或者移动)电子设备的一部分,这些电子设备可以是诸如蜂窝电话、数码照相机、个人数字助理(PDA)、个人媒体播放器设备、无线网络浏览设备、个人头戴设备、应用专用设备、或者可以包括上面任何功能的混合设备。甚至可以被实现为服务器,如文件服务器、数据库服务器、应用程序服务器和WEB服务器等。本发明的实施例对此均不做限制。
在根据本发明的实施例中,计算设备100被配置为执行根据本发明的操 作系统安装方法200。其中,计算设备100中包含执行根据本发明的操作系统安装方法200的多条程序指令,使得本发明的操作系统安装方法200可以在计算设备中执行。
图2示出了根据本发明一个实施例的操作系统安装方法200的流程图。方法200适于在计算设备(例如前述计算设备100)中执行。
需要说的是,用户希望在计算设备的储存设备(硬盘)中安装的操作系统为目标操作系统。在安装目标操作系统之前,计算设备需要获取目标操作系统的镜像文件,以便基于目标操作系统的镜像文件来安装目标操作系统。
在根据本发明的实施例中,目标操作系统的镜像文件中包括自动分区脚本,基于自动分区脚本可以实现本发明的操作系统安装方法200。其中,基于自动分区脚本能够实现对磁盘的自动分区,这样,在计算设备的硬盘中已安装了第一操作系统的情况下,根据本发明的操作系统安装方法200,可以使用户方便快捷地安装目标操作系统,体验双系统。
在一个实施例中,可以基于包括自动分区脚本的目标操作系统的镜像文件来制作目标操作系统的启动盘(例如U盘)。这样,计算设备通过挂载目标操作系统的启动盘,基于启动盘中的包括自动分区脚本的镜像文件来执行本发明的方法200。具体地,计算设备在挂载目标操作系统的启动盘之后,启动启动盘中的安装器,在启动安装器之后,首先执行自动分区脚本,以便基于自动分区脚本执行方法200中实现自动分区的相应步骤。
应当指出,本发明对目标操作系统的具体种类不做限制。在本发明的具体实施例中,仅以UOS操作系统作为目标操作系统为例来对本发明的操作系统安装方法200进行详细说明,但本发明的操作系统安装方案200并不限于UOS操作系统。
如图2所示,方法200始于步骤S210。
在步骤S210中,判断第一磁盘分区是否存在第一操作系统,也即是判断当前计算设备的硬盘上是否已经安装有不同于目标操作系统的其他操作系统。这里,本发明对第一操作系统的具体种类不做限制。
在一种实施方式中,第一操作系统可以实现为Windows操作系统,但不限于此。当第一操作系统为Windows操作系统时,第一磁盘分区可以实现为 NTFS磁盘分区。
在一个实施例中,通过判断第一磁盘分区是否包括第一操作系统的相关文件目录来确定是否存在第一操作系统。具体而言,在判断是否存在第一操作系统时,遍历第一磁盘分区,以便查找第一磁盘分区是否包括第一操作系统的相关文件目录。如果包括相关文件目录,则确定第一磁盘分区存在第一操作系统。如果不包括相关文件目录,说明不存在第一操作系统,则直接基于安装器安装目标操作系统,不再执行自动分区相关的步骤。
这里,当第一操作系统为Windows操作系统时,第一操作系统的相关文件目录可以包括Windows目录、Users目录、Program Files目录中的一种或多种。
应当指出,如果在上述步骤S210中确定第一磁盘分区存在第一操作系统,则跳过安装器原有的磁盘分区步骤,基于自动分区脚本执行下述步骤S220~S240。
其中,在步骤S220中,确定第一磁盘分区的可用空间,判断可用空间是否足够安装目标操作系统。这里,在一个实施例中,目标操作系统例如为UOS操作系统,但本发明不限于此。在其他实施例中,目标操作系统也可以实现为基于Linux内核的其他类型的操作系统。
如果第一磁盘分区的可用空间不够安装目标操作系统,则生成目标操作系统安装失败的消息,以便提示用户系统安装失败,并结束安装目标操作系统。
如果第一磁盘分区的可用空间足够安装目标操作系统,则执行步骤S230。在步骤S230中,对第一磁盘分区进行缩小处理,以便分隔出可用空间。这样,可以基于第一磁盘分区释放的可用空间来安装目标操作系统。
在一个实施例中,通过执行Linux系统下的ntfsresize命令来对第一磁盘分区(即NTFS分区)进行缩小处理。需要说明的是,ntfsresize命令可用于缩小或扩大位于磁盘分区上的任何NTFS文件系统,并且不会丢失数据,新文件系统将具有指定的大小。
在基于ntfsresize命令对第一磁盘分区(NTFS分区)进行缩小处理时,具体是将第一磁盘分区中的数据基于第一磁盘分区的开始位置按顺序存放, 以便将剩余的可用空间释放出来。并且,需确保不能破坏第一磁盘分区中的文件内容。
根据一种实施方式,在缩小NTFS分区时,首先基于ntfsresize命令缩小NTFS分区对应的NTFS文件系统的大小。随后,基于实用程序(例如fdisk(1M))删除原始的NTFS分区,并重新创建较小的新的分区,以实现缩小NTFS分区大小。这里,需保证缩小处理后的新的分区大小不小于缩小后的NTFS文件系统的大小。并且,在重新创建新的分区时,需确保是基于与所替换的原始分区中相同的起始扇区和分区类型,否则,无法访问文件系统。
应当指出,在将第一磁盘分区的可用空间分隔出来后,执行步骤S240。
在步骤S240中,基于分隔出的可用空间,创建适于安装目标操作系统的目标分区。具体地,在分隔出可用空间之后,确定可用空间的起始扇区号和结束扇区号,基于起始扇区号和结束扇区号,在起始扇区号与结束扇区号的范围内创建目标分区。
这样,本发明基于自动分区脚本执行上述步骤S210~S240,便实现了在安装目标操作系统之前的自动分区功能,自动创建适于安装目标操作系统的目标分区。
根据一种实施方式,可以基于parted命令来创建目标分区。最终创建的目标分区包括EFI、Boot、Roota、Rootb、swap、Backup、_dde_data。
最后,在步骤S250中,利用安装器基于目标分区安装目标操作系统。在一个实施例中,在安装目标操作系统时,首先设置目标分区的挂载点,进而,将目标操作系统安装到目标分区的挂载点。
根据一种实施方式,通过执行以下命令来实现创建目标分区的挂载点:
DI_MOUNTPOINTS="/dev/sda1=/boot/efi;/dev/sda2=/boot;/dev/sda3=/;/dev/sda5=/data;/dev/sda6=/recovery;/dev/sda7=swap;/dev/sda7=swap"
另外,还需要说明的是,步骤S240中在创建适于安装目标操作系统的目标分区时,需要先确定硬盘的分区格式。硬盘的分区格式例如包括GPT和MBR。具体地,确定硬盘的分区格式是GPT还是MBR。如果是GPT格式,则不需要考虑创建的分区是逻辑分区还是主分区。如果是MBR格式,则需要确定所要创建的目标分区是逻辑分区、扩展分区还是主分区,进而,创建目标分区。
根据一种实施方式,在执行本发明的方法200之前,通过预先在目标操作系统的镜像文件中注入自动分区脚本,例如可以在解压后的镜像文件的oem/before_install目录下添加自动分区脚本。这样,可以基于自动分区脚本实现对磁盘的自动分区,即基于自动分区脚本能实现上述步骤S210~S240中的自动分区方法,并配合目标操作系统的安装器实现本发明的操作系统安装方法200。根据本发明的操作系统安装方法200,在计算设备中已安装了第一操作系统的情况下,用户可以方便快捷地安装目标操作系统,实现双系统的安装。
综上,根据本发明的操作系统安装方法200,在计算设备中已经安装了第一操作系统(例如Windows操作系统)的情况下,需要安装另一个目标操作系统(例如UOS操作系统)时,能实现在安装目标操作系统之前,自动进行分区,自动创建适于安装目标操作系统的目标分区。这样,对于用户安装双系统而言,操作更加简单、便捷,使得用户很容易实现双系统的安装、体验双系统,并可以自由切换两种操作系统,提高了用户使用体验感。对于技术人员来说,可以实现批量安装双系统,提高了系统安装的效率。
这里描述的各种技术可结合硬件或软件,或者它们的组合一起实现。从而,本发明的方法和设备,或者本发明的方法和设备的某些方面或部分可采取嵌入有形媒介,例如可移动硬盘、U盘、软盘、CD-ROM或者其它任意机器可读的存储介质中的程序代码(即指令)的形式,其中当程序被载入诸如计算机之类的机器,并被所述机器执行时,所述机器变成实践本发明的设备。
在程序代码在可编程计算机上执行的情况下,计算设备一般包括处理器、处理器可读的存储介质(包括易失性和非易失性存储器和/或存储元件),至少一个输入装置,和至少一个输出装置。其中,存储器被配置用于存储程序代码;处理器被配置用于根据该存储器中存储的所述程序代码中的指令,执行本发明的多语言垃圾文本的识别方法。
以示例而非限制的方式,可读介质包括可读存储介质和通信介质。可读存储介质存储诸如计算机可读指令、数据结构、程序模块或其它数据等信息。通信介质一般以诸如载波或其它传输机制等已调制数据信号来体现计算机可读指令、数据结构、程序模块或其它数据,并且包括任何信息传递介质。以 上的任一种的组合也包括在可读介质的范围之内。
在此处所提供的说明书中,算法和显示不与任何特定计算机、虚拟系统或者其它设备固有相关。各种通用系统也可以与本发明的示例一起使用。根据上面的描述,构造这类系统所要求的结构是显而易见的。此外,本发明也不针对任何特定编程语言。应当明白,可以利用各种编程语言实现在此描述的本发明的内容,并且上面对特定语言所做的描述是为了披露本发明的最佳实施方式。
在此处所提供的说明书中,说明了大量具体细节。然而,能够理解,本发明的实施例可以在没有这些具体细节的情况下被实践。在一些实例中,并未详细示出公知的方法、结构和技术,以便不模糊对本说明书的理解。
类似地,应当理解,为了精简本公开并帮助理解各个发明方面中的一个或多个,在上面对本发明的示例性实施例的描述中,本发明的各个特征有时被一起分组到单个实施例、图、或者对其的描述中。然而,并不应将该公开的方法解释成反映如下意图:即所要求保护的本发明要求比在每个权利要求中所明确记载的特征更多特征。更确切地说,如下面的权利要求书所反映的那样,发明方面在于少于前面公开的单个实施例的所有特征。因此,遵循具体实施方式的权利要求书由此明确地并入该具体实施方式,其中每个权利要求本身都作为本发明的单独实施例。
本领域那些技术人员应当理解在本文所公开的示例中的设备的模块或单元或组件可以布置在如该实施例中所描述的设备中,或者可替换地可以定位在与该示例中的设备不同的一个或多个设备中。前述示例中的模块可以组合为一个模块或者此外可以分成多个子模块。
本领域那些技术人员可以理解,可以对实施例中的设备中的模块进行自适应性地改变并且把它们设置在与该实施例不同的一个或多个设备中。可以把实施例中的模块或单元或组件组合成一个模块或单元或组件,以及此外可以把它们分成多个子模块或子单元或子组件。除了这样的特征和/或过程或者单元中的至少一些是相互排斥之外,可以采用任何组合对本说明书(包括伴随的权利要求、摘要和附图)中公开的所有特征以及如此公开的任何方法或者设备的所有过程或单元进行组合。除非另外明确陈述,本说明书(包括伴 随的权利要求、摘要和附图)中公开的每个特征可以由提供相同、等同或相似目的的替代特征来代替。
此外,本领域的技术人员能够理解,尽管在此所述的一些实施例包括其它实施例中所包括的某些特征而不是其它特征,但是不同实施例的特征的组合意味着处于本发明的范围之内并且形成不同的实施例。例如,在下面的权利要求书中,所要求保护的实施例的任意之一都可以以任意的组合方式来使用。
此外,所述实施例中的一些在此被描述成可以由计算机系统的处理器或者由执行所述功能的其它装置实施的方法或方法元素的组合。因此,具有用于实施所述方法或方法元素的必要指令的处理器形成用于实施该方法或方法元素的装置。此外,装置实施例的在此所述的元素是如下装置的例子:该装置用于实施由为了实施该发明的目的的元素所执行的功能。
如在此所使用的那样,除非另行规定,使用序数词“第一”、“第二”、“第三”等等来描述普通对象仅仅表示涉及类似对象的不同实例,并且并不意图暗示这样被描述的对象必须具有时间上、空间上、排序方面或者以任意其它方式的给定顺序。
尽管根据有限数量的实施例描述了本发明,但是受益于上面的描述,本技术领域内的技术人员明白,在由此描述的本发明的范围内,可以设想其它实施例。此外,应当注意,本说明书中使用的语言主要是为了可读性和教导的目的而选择的,而不是为了解释或者限定本发明的主题而选择的。因此,在不偏离所附权利要求书的范围和精神的情况下,对于本技术领域的普通技术人员来说许多修改和变更都是显而易见的。对于本发明的范围,对本发明所做的公开是说明性的,而非限制性的,本发明的范围由所附权利要求书限定。

Claims (12)

  1. 一种操作系统安装方法,在计算设备中执行,包括步骤:
    判断第一磁盘分区是否存在第一操作系统;
    如果存在第一操作系统,则:
    确定第一磁盘分区的可用空间,判断可用空间是否足够安装目标操作系统;
    如果足够安装目标操作系统,则对所述第一磁盘分区进行缩小处理,以便分隔出可用空间;
    基于分隔出的可用空间,创建适于安装目标操作系统的目标分区;以及
    基于所述目标分区安装所述目标操作系统。
  2. 如权利要求1所述的方法,其中,基于分隔出的可用空间,创建适于安装目标操作系统的目标分区的步骤包括:
    确定所述可用空间的起始扇区号和结束扇区号;
    在所述起始扇区号与结束扇区号的范围内创建所述目标分区。
  3. 如权利要求1所述的方法,其中,基于所述目标分区安装目标操作系统的步骤包括:
    设置所述目标分区的挂载点,将所述目标操作系统安装到所述目标分区的挂载点。
  4. 如权利要求1-3任一项所述的方法,其中,所述第一磁盘分区是NTFS分区,对所述第一磁盘分区进行缩小处理包括:
    基于ntfsresize命令对所述第一磁盘分区进行缩小处理。
  5. 如权利要求4所述的方法,其中,基于ntfsresize命令对所述第一磁盘分区进行缩小处理的步骤包括:
    基于ntfsresize命令缩小NTFS分区对应的NTFS文件系统的大小;
    删除所述NTFS分区,并重新创建较小的新的分区。
  6. 如权利要求1-3任一项所述的方法,其中,判断第一磁盘分区是否存 在第一操作系统的步骤包括:
    遍历第一磁盘分区,以查找第一磁盘分区是否包括第一操作系统的相关文件目录;
    如果包括相关文件目录,则确定第一磁盘分区存在第一操作系统。
  7. 如权利要求1-3任一项所述的方法,其中,判断可用空间是否足够安装目标操作系统的步骤还包括:
    如果不够安装目标操作系统,则生成目标操作系统安装失败的消息,并结束安装目标操作系统。
  8. 如权利要求1-3任一项所述的方法,其中,在判断第一磁盘分区是否存在第一操作系统之前,还包括步骤:
    挂载目标操作系统的启动盘;
    启动所述启动盘中的安装器,以便利用所述安装器安装目标操作系统;
    其中,所述启动盘中包括目标操作系统的镜像文件,所述镜像文件中包括自动分区脚本。
  9. 如权利要求1-3任一项所述的方法,其中,
    所述第一操作系统为Windows操作系统,所述目标操作系统为UOS操作系统。
  10. 如权利要求6所述的方法,其中,所述相关文件目录包括Windows目录、Users目录、Program Files目录中的一种或多种。
  11. 一种计算设备,包括:
    至少一个处理器;以及
    存储器,存储有程序指令,其中,所述程序指令被配置为适于由所述至少一个处理器执行,所述程序指令包括用于执行如权利要求1-10中任一项所述的方法的指令。
  12. 一种存储有程序指令的可读存储介质,当所述程序指令被计算设备读取并执行时,使得所述计算设备执行如权利要求1-10中任一项所述方法。
PCT/CN2021/118422 2021-04-19 2021-09-15 一种操作系统安装方法及计算设备 WO2022222351A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202110420259.1 2021-04-19
CN202110420259.1A CN113138778A (zh) 2021-04-19 2021-04-19 一种操作系统安装方法及计算设备

Publications (1)

Publication Number Publication Date
WO2022222351A1 true WO2022222351A1 (zh) 2022-10-27

Family

ID=76812703

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/118422 WO2022222351A1 (zh) 2021-04-19 2021-09-15 一种操作系统安装方法及计算设备

Country Status (2)

Country Link
CN (1) CN113138778A (zh)
WO (1) WO2022222351A1 (zh)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113138778A (zh) * 2021-04-19 2021-07-20 统信软件技术有限公司 一种操作系统安装方法及计算设备

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1686468A1 (en) * 2005-01-26 2006-08-02 Intervideo Inc Computer architecture with multiple operating systems using a common disc partition
CN103473102A (zh) * 2013-09-18 2013-12-25 中标软件有限公司 多操作系统的系统启动引导方法和工具
CN108647034A (zh) * 2018-04-09 2018-10-12 南京百敖软件有限公司 一种单移动硬盘安装多个操作系统的方法
CN110399159A (zh) * 2019-07-23 2019-11-01 广州夏达信息科技有限公司 操作系统的部署方法、装置、计算机设备和存储介质
CN113138778A (zh) * 2021-04-19 2021-07-20 统信软件技术有限公司 一种操作系统安装方法及计算设备

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8607039B2 (en) * 2010-08-17 2013-12-10 International Business Machines Corporation Isolation of device namespace to allow duplicate/common names in root volume group workload partitions
CN102184248B (zh) * 2011-05-20 2013-06-19 深圳万兴信息科技股份有限公司 一种在Windows下调整磁盘分区的方法及装置
CN105824678A (zh) * 2016-05-17 2016-08-03 浪潮电子信息产业股份有限公司 一种操作系统安装方法及装置

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1686468A1 (en) * 2005-01-26 2006-08-02 Intervideo Inc Computer architecture with multiple operating systems using a common disc partition
CN103473102A (zh) * 2013-09-18 2013-12-25 中标软件有限公司 多操作系统的系统启动引导方法和工具
CN108647034A (zh) * 2018-04-09 2018-10-12 南京百敖软件有限公司 一种单移动硬盘安装多个操作系统的方法
CN110399159A (zh) * 2019-07-23 2019-11-01 广州夏达信息科技有限公司 操作系统的部署方法、装置、计算机设备和存储介质
CN113138778A (zh) * 2021-04-19 2021-07-20 统信软件技术有限公司 一种操作系统安装方法及计算设备

Also Published As

Publication number Publication date
CN113138778A (zh) 2021-07-20

Similar Documents

Publication Publication Date Title
US8555017B2 (en) In-place physical to virtual (P2V) migration of an existing operating system during installation of a new operating system
CN112988252B (zh) 一种操作系统启动方法及计算设备
US8468334B1 (en) Efficient initial RAM disk creation
US8752039B1 (en) Dynamic upgrade of operating system in a network device
CN114398318B (zh) 用户空间文件系统的文件操作方法及用户空间文件系统
CN113032032B (zh) 一种系统管理方法、装置、计算设备及可读存储介质
CN113568787A (zh) 一种掉电保护方法、计算设备及存储介质
CN113157290B (zh) 一种多系统安装方法、计算设备及存储介质
US10185573B2 (en) Caching based operating system installation
CN102053848A (zh) Linux操作系统的自动安装方法
CN112988464A (zh) 一种断电保护方法及计算设备
WO2022222351A1 (zh) 一种操作系统安装方法及计算设备
CN115390996A (zh) 虚拟机迁移方法和装置、计算设备和存储介质
CN114691226A (zh) 一种多操作系统切换运行方法、计算设备及存储介质
US8499142B1 (en) UEFI boot loader for loading non-UEFI compliant operating systems
CN111913753A (zh) 一种windows系统云迁移中启动方式的变更方法及系统
CN113791873B (zh) 一种虚拟机创建方法、计算设备及存储介质
CN112989427B (zh) 一种文件保护方法、计算设备及存储介质
CN114546678A (zh) 一种复制粘贴数据的方法、计算设备及可读存储介质
CN114691549A (zh) 一种文件写入方法、装置及计算设备
TW201530432A (zh) 多重作業環境服務的管理系統及管理方法
CN113742140B (zh) 一种文件备份方法、装置及计算设备
CN113867825B (zh) 一种多系统运行方法、计算设备及存储介质
US11392389B2 (en) Systems and methods for supporting BIOS accessibility to traditionally nonaddressable read-only memory space
JP7087087B2 (ja) オペレーティングシステムをコンピュータ可読媒体上に記憶するためのbiosコード

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 21937573

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE