Búsqueda Imágenes Maps Play YouTube Noticias Gmail Drive Más »
Iniciar sesión
Usuarios de lectores de pantalla: deben hacer clic en este enlace para utilizar el modo de accesibilidad. Este modo tiene las mismas funciones esenciales pero funciona mejor con el lector.

Patentes

  1. Búsqueda avanzada de patentes
Número de publicaciónCN105138431 A
Tipo de publicaciónSolicitud
Número de solicitudCN 201510532051
Fecha de publicación9 Dic 2015
Fecha de presentación27 Ago 2015
Fecha de prioridad27 Ago 2015
Número de publicación201510532051.3, CN 105138431 A, CN 105138431A, CN 201510532051, CN-A-105138431, CN105138431 A, CN105138431A, CN201510532051, CN201510532051.3
Inventores刘庆灶
Solicitante厦门市美亚柏科信息股份有限公司
Exportar citaBiBTeX, EndNote, RefMan
Enlaces externos:  SIPO, Espacenet
Linux system back-up and restoring method
CN 105138431 A
Resumen
The invention belongs to the field of computer and information technology, particularly relates to a Linux system back-up and restoring method. According to the linux system back-up and restoring method, a Linux system is manufactured on a storage medium to serve as a startup disk, and a master boot record, a partition table and system files of the Linux system of a mainframe are backed up in the storage medium; when the Linux system of the mainframe breaks down, the Linux system is restored or reset through the storage medium, and the data backed up in the storage medium are restored into the Linux system of the mainframe. The Linux system backed up through the method can be used for restoring Linux systems of multiple mainframes, and operation is convenient.
Reclamaciones(7)  traducido del chino
1.一种Linux系统的备份方法,其特征在于:提供一个存储介质,并在存储介质上制作一个Linux系统,将主机Linux系统的主引导记录和分区表备份到存储介质里,还将主机Linux系统分区里的文件进行选择性备份到存储介质里,所选的备份的文件包括boot、etc、home、root、usr 和var。 1. A backup method Linux system, characterized by: providing a storage medium, and create a Linux system on a storage medium, the primary host Linux system boot record and partition table backed up to a storage medium, the host will be Linux the file system partition selective backup to a storage medium, the selected backup file includes boot, etc, home, root, usr, and var.
2.如权利要求1所述的Linux系统的备份方法,其特征在于:如果主机Linux系统的引导程序安装在MBR上,则将MBR的主引导记录备份到存储介质里;如果主机Linux系统的引导程序没有安装在MBR上,而是安装在分区的引导扇区上,则将分区的引导扇区的主引导记录备份到存储介质里。 If the host Linux system boot; if the host Linux system boot program installed on the MBR, the master boot record MBR will be backed up to a storage medium where: 2. Linux system backup method of claim 1, characterized in that program is not installed on the MBR, but mounted on the partition boot sector, partition boot sector will be the primary boot record to the storage medium in the backup.
3.如权利要求1所述的Linux系统的备份方法,其特征在于:备份是通过备份工具进行备份操作的,备份工具包括:dd、cp1、tar、dump、rsync或restore命令。 Linux system backup method according to claim 3, wherein: Backup is backup operation by the backup tool, backup tools include: dd, cp1, tar, dump, rsync or restore command.
4.如权利要求1所述的Linux系统的备份方法,其特征在于:存储介质为光盘、移动硬盘、软盘或U盘。 Linux system backup method according to claim 4, wherein: a storage medium for the CD-ROM, removable hard disk, floppy disk or U disk.
5.如权利要求1所述的Linux系统的备份方法,其特征在于:Linux系统数据里所选的备份的文件还包括opt和srv。 5. Linux system backup method of claim 1, wherein: the backup file system data in the selected Linux also include opt and srv.
6.一种基于上述权利要求1至5任一所述的Linux系统的备份方法进行Linux系统的还原方法,其特征在于:它包括以下步骤: 将基于上述权利要求1至5任一所述的Linux系统的备份方法所得的存储介质接入主机上; 还原主引导记录; 设置磁盘分区并且格式化; 还原主机Linux系统分区文件。 A reduction method based on the Linux system backup method Linux system 1-5 according to any one of the preceding claims, characterized in that: it comprises the steps of: based on said any one of claims 1 to 5, wherein a Linux backup method obtained access to the host system's storage medium; restore the master boot record; set the disk partitioning and formatting; restore host Linux file system partition.
7.如权利要求6所述的Linux系统的还原方法,其特征在于:使用parted命令设置磁盘分区,并调用mkfs命令对分区进行格式化。 7. A method of reducing Linux system as claimed in claim 6, wherein: using the parted command to set the disk partitioning, and calls mkfs command to format the partition.
Descripción  traducido del chino
一种L i nux系统的备份和还原方法 Backup and restore method L nux system

技术领域 TECHNICAL FIELD

[0001] 本发明属于计算机与信息技术领域,具体涉及一种Linux系统的备份和还原方法。 [0001] The present invention belongs to the field of computer technology and information, which relates to a method for backing up and restoring Linux system.

背景技术 Background technique

[0002] Linux是一套免费使用和自由传播的类Unix操作系统,是一个基于可移植操作系统接口(Portable Operating System Interface,简称P0SIX)和多用户、多任务、支持多线程和多CPU的操作系统。 [0002] Linux is a free Unix-like operating system to use and free dissemination, is based on a Portable Operating System Interface (Portable Operating System Interface, referred P0SIX) and multi-user, multi-tasking, multi-threading and multi-CPU support operations system. Linux可运行于多种平台(电脑、工作站等)之上,其源代码不仅是公开的,还是免费的,该系统遵循通用公共许可证(General Public License,简称GPL)精神、遵守POSIX标准、且与Unix系统兼容。 Linux can run on multiple platforms (PCs, workstations, etc.) on top of the source code is not open, or free, the system follows the General Public License (General Public License, referred to as the GPL) spirit, to comply with the POSIX standard, and compatible with Unix systems.

[0003] 随着电子硬件设备的迅猛发展,现在开发的设备越来越多的都带有操作系统。 [0003] With the rapid development of electronic hardware, and now more and more developing device comes with the operating system. 而Linux系统以其可任意裁剪、开源、免费等特点受到了广泛的应用。 The Linux system for its can arbitrarily cut, open source, free and so on have been widely used. 操作系统是一切应用软件运行的基础,所以对操作系统的保护与还原就显得尤为重要。 The operating system is the basis for all applications running, so the operating system protection and recovery is particularly important.

[0004] “系统还原”的目的是在不需要重新安装操作系统,也不会破坏数据文件的前提下使系统回到工作状态。 [0004] "System Restore" is aimed at the premise does not need to reinstall the operating system, it will not destroy data files to make the system back to working condition. 相比Windows操作系统下通用硬件导向系统转移(General HardwareOriented System Transfer,简称Ghost)—统天下,Linux下系统还原还是一片盲区。 Compared to Windows operating systems under a common hardware-oriented system transfer (General HardwareOriented System Transfer, referred to as the Ghost) - ClickTracks, Linux system restore or a blind spot. 目前比较常见的办法是用户自己备份系统关键文件,当出现问题的时候,进行手动恢复。 Currently the more common approach is to back up the user's own system-critical files, when problems arise, manual recovery.

[0005] 用户自己备份与还原Linux系统对用户要求很高,要知道该备份哪些数据,怎样备份,出问题了后怎样恢复,此操作繁琐,容易出错,而且一旦系统启动不起来,需要借助其它东西才能启动系统。 [0005] the user's own backup and restore Linux system users demanding to know what data to back up, how to backup, how to restore a problem after this operation tedious, error-prone, and once the system starts up, you need the help of other something to start the system. 另外此方案无法对系统进行分区,且不同的用户备份的系统文件不同,具有个性化的特点,无法实现对Linux系统进行批量生产。 In addition to this scenario, the system can not be partitioned, and different users different backup system files, with personalized features can not be achieved on the Linux system for mass production.

发明内容 SUMMARY

[0006] 针对现有技术的不足之处,本发明重新设计了一种新的Linux系统的备份和还原方法。 [0006] for the deficiencies of the prior art, the present invention is to redesign the backup and restore methods, a new Linux system. 该方法免去了用户繁琐的操作,操作简单,且对用户要求不高。 This method eliminates the cumbersome user operation, simple operation, and less demanding on the user. 该方法还可以动态设置分区,选择要还原的内容,并且不会存在系统分区损坏,系统无法还原的问题。 The method also can be set dynamically partition, select the content you want to restore, and there will be no damage to the system partition, the system can not restore problems. 此方案同时支持批量克隆,从而实现批量生产。 This program also supports batch cloning, in order to achieve mass production.

[0007] 本发明采用如下技术方案: [0007] The present invention adopts the following technical solution:

一种Linux系统的备份方法,提供一个存储介质,并在存储介质上制作一个Linux系统,将主机Linux系统的主引导记录和分区表备份到存储介质里,还将主机Linux系统分区里的文件进行选择性备份到存储介质里,所选的备份的文件包括boot、etc、home、root、usr和var0 Linux system backup method of providing a storage medium, and create a Linux system on a storage medium, the primary host Linux system boot record and partition table backed up to storage media, the system will also host Linux partition's file selective backup to a storage medium, the selected backup file includes boot, etc, home, root, usr and var0

[0008] 进一步的,如果主机Linux系统的引导程序安装在MBR上,则将MBR的主引导记录备份到存储介质里;如果主机Linux系统的引导程序没有安装在MBR上,而是安装在分区的引导扇区上,则将分区的引导扇区的主引导记录备份到存储介质里。 [0008] Further, if the host Linux system boot program installed on the MBR, the master boot record MBR will be backed up to a storage medium in; if the host Linux system boot program is not installed on the MBR, but installed in the partition the boot sector, partition boot sector will be the primary boot record to the storage medium in the backup.

[0009] 进一步的,备份是通过备份工具进行备份操作的,备份工具包括:dd、cp1、tar、dump、rsync 或restore 命令。 [0009] Further, the backup operation is backed up by the backup tool, backup tools include: dd, cp1, tar, dump, rsync or restore command.

[0010] 进一步的,存储介质为光盘、移动硬盘、软盘或U盘。 [0010] Further, the storage medium is a CD-ROM, removable hard disk, floppy disk or U disk.

[0011] 进一步的,Linux系统数据里所选的备份的文件还包括opt和srv。 [0011] Further, the backup file system data in the selected Linux also include opt and srv.

[0012] 进一步的,一种基于上述的Linux系统的备份方法进行Linux系统的还原方法,它包括以下步骤: [0012] Further, a progressive reduction method based on the Linux system backup method of the Linux system, comprising the steps of:

将用上述Linux系统的备份方法所得的存储介质接入主机上; The access method with the backup obtained in the above Linux systems storage medium on the host;

还原主引导记录; Restore master boot record;

设置磁盘分区并且格式化; Set the disk partitioning and formatting;

还原主机Linux系统分区文件。 Restore host Linux file system partition.

[0013] 进一步的,使用parted命令设置磁盘分区,并调用mkfs命令对分区进行格式化。 [0013] Further, using the parted command to set the disk partitioning, and calls mkfs command to format the partition.

[0014] 本发明提出了一种Linux系统的备份和还原方法,利用存储介质制作启动盘,并将主机Linux系统的主引导记录、分区表以及系统文件备份到该光盘里去。 [0014] The present invention provides a method for backing up and restoring a Linux system, the use of storage media make a boot disk, the master boot record and the host Linux system, partition table and file system backup to the disc go. 当主机Linux系统崩溃时,利用存储介质对系统进行修复或者重装,并将存储介质里备份的数据进行还原。 When the host Linux system crashes, the use of storage media to reinstall or repair the system, and the data storage medium in the backup to restore. 该方法用于Linux系统的备份和还原,且利用该备份方法的存储介质可批量克隆生产,用于还原Linux系统。 The method of storage media for backups and restores Linux systems, and can use this backup method clone batch production, used to restore the Linux system.

附图说明 BRIEF DESCRIPTION

[0015] 图1是硬盘存储结构示意图; [0015] FIG. 1 is a schematic view of hard disk storage structure;

图2是ExtX文件系统第一个块组结构分布图。 Figure 2 is a block ExtX File System group structure map.

具体实施方式 detailed description

[0016] 为进一步说明各实施例,本发明提供有附图。 [0016] To further illustrate the various embodiments, the present invention is provided with the accompanying drawings. 这些附图为本发明揭露内容的一部分,其主要用以说明实施例,并可配合说明书的相关描述来解释实施例的运作原理。 These figures reveal the contents of a part of the present invention, which is mainly for illustrative embodiment, and with the relevant description of the specification to explain how it works embodiment. 配合参考这些内容,本领域普通技术人员应能理解其他可能的实施方式以及本发明的优点。 With reference to these, those of ordinary skill in the art can understand other possible embodiments and advantages of the present invention. 图中的组件并未按比例绘制,而类似的组件符号通常用来表示类似的组件。 Components in the figures not drawn to scale, and like components are often used to represent symbols similar components.

[0017] 现结合附图和具体实施方式对本发明进一步说明。 [0017] are combined with drawings and specific embodiments of the present invention is further illustrated.

[0018] 现代Linux操作系统大部分都是基于主引导记录(Master Boot Record,简称MBR)的,由引导加载程序(GRand Unified Bootloader,简称GRUB)进行引导。 [0018] Most modern Linux operating systems are based on the master boot record (Master Boot Record, referred to as the MBR) by the boot loader (GRand Unified Bootloader, called GRUB) boot. 当计算机加电自检后,基本输入输出系统(Basic Input/Output System,简称B1S)加载MBR中的代码到内存中,参阅图1所示,为硬盘存储结构示意图,MBR即硬盘第一扇区,图1中的主引导记录,这个扇区一共512字节,前446字节内容存放GRUB的关键引导程序,接着64字节放置分区表,最后2个字节是固定的标志0x55AA。 When the computer Power On Self Test, the basic input output system (Basic Input / Output System, referred B1S) MBR code loaded into memory, refer to Figure 1 for a schematic view of the structure of hard disk storage, MBR hard disk that is the first sector Figure 1 of the master boot record, this sector a total of 512 bytes, the first 446 bytes of the key content stored GRUB boot loader, then 64 bytes to place the partition table, the last two bytes are the fixed signs 0x55AA. 当B1S把引导程序加载到内存后就把控制权交给GRUB,而后GRUB会寻找boot并加载boot下的一些文件,最后其会加载Linux系统内核映像文件,从而把控制权交给真正的内核运行。 When B1S the boot program is loaded into memory after passes control to GRUB, GRUB will look for some files and then boot and load the boot down, and finally it will load the Linux kernel image file, thereby transferring control to the real kernel runs .

[0019] 参阅图2所示,为ExtX文件系统第一个块组结构分布图,ExtX(ext2,ext3,ext4)是Linux系统下默认文件格式。 [0019] Referring to FIG. 2, the first block of the file system ExtX group structure map, ExtX (ext2, ext3, ext4) is the default Linux file system format. The Second Extended File System (简称Ext2)文件系统是早期Linux系统中的标准文件系统,是通过对Minix的文件系统进行扩展而得到的,Ext3是一种日志文件系统,是对Ext2系统的扩展,它兼容Ext2,而Ext4又是Ext3的扩展,但它存储数据的结构发生了很大变化,直接导致了它支持IEB (1,048,576TB,1EB=1024PB,1PB=1024TB)的文件系统,以及16TB的文件。 The Second Extended File System (referred to Ext2) file system is a system of early Linux standard file system, is through the Minix file system extension obtained, Ext3 is a journaling file system Ext2 system is an extension of it compatible with Ext2, Ext3 and Ext4 is an extension, but it stores the data structure has undergone great changes, a direct result of its support for IEB (1,048,576TB, 1EB = 1024PB, 1PB = 1024TB) file system, and 16TB document.

[0020] 本发明优选一实施例的一种Linux系统的备份方法,首先,使用光盘作为存储介质,在光盘上制作一个Linux系统作为启动盘。 [0020] The present invention is a preferred backup method of an embodiment of a Linux system, first of all, use the CD as a storage medium, making a Linux system on the disk as the startup disk. 该系统包含系统分区命令,及可视化组件,系统分区命令用于还原Linux系统时设置磁盘分区,可视化组件使该实施例具有图形化操作界面,操作方便简单。 The system partition contains the system commands, and visual components, set the disk partition used to restore the system partition Linux system command, so that the visual component embodiment having a graphical user interface, simple and easy to operate.

[0021] 其次,使用dd命令将主机Linux系统的主引导记录和分区表备份到光盘上,还需备份主机Linux系统分区文件,主机Linux系统分区主要包含文件有:bin、dev、home、mnt、proc、root、sbin、sys、boot、etc、lib、opt、tmp 和usr。 [0021] Next, using the dd command will host master Linux system boot record and partition table backup to a disc, the host needs a backup Linux file system partition, the host Linux system partition contains the main file there: bin, dev, home, mnt, proc, root, sbin, sys, boot, etc, lib, opt, tmp and usr.

[0022] 若引导程序没有安装在MBR上,而是安装在分区的引导扇区上,还需要备份分区的主引导扇区。 [0022] If the boot program is not installed on the MBR, but mounted on the partition boot sector, but also need to back up the primary partition boot sector.

[0023] Linux系统文件备份,无需全部备份,只需备份操作系统本身需要备份的文件即可。 [0023] Linux backup system files, all without backup, backup files only to the operating system itself needs to be backed up. 必须要备份的文件为:boot、etc、home、root、usr和var。 The file must be backed up as: boot, etc, home, root, usr, and var. 如果主机Linux系统中自行安装过其他的套件,那么opt最好备份一下。 If the host Linux system to install itself through other packages, then opt back up what is best. 其他在Linux系统主机上面提供的服务之数据库文件也需要备份一下。 Other database files in the Linux system host services provided above also need to be backed out.

[0024] proc在记录目前Linux系统上面正在运行的程序,这个数据根本就不需要备份。 [0024] proc in a program recorded above the current Linux system is running, the data do not need backup. 此外,mnt或media里面都是挂载了其他的硬盘装置、光驱、软盘机等等,这些也不需要备份。 In addition, mnt or other media which are mounted in a hard disk device, CD-ROM, floppy disk drive, etc., which do not need to back up. 不需要备份的系统文件有:dev、proc、mnt、media和tmp。 File system backup is not required there: dev, proc, mnt, media and tmp.

[0025] 需要说明的是,该实施例采用光盘作为存储介质,本领域技术人员可知,还可采用优移动硬盘、软盘或U盘作为存储介质。 [0025] It should be noted that this embodiment employs the optical disk as a storage medium, known to those skilled, it can also be used preferably removable hard disk, floppy disk or U disk as a storage medium. 此外,该实施例备份数据使用的备份工具是dd命令,本领域技术人员可知,还可采用的备份工具有cp1、tar、dump、rsync或restore命令。 In addition, cases of backup data backup tool used in this embodiment is the dd command, known to those skilled in the backup tool can also be used are cp1, tar, dump, rsync or restore command.

[0026] 本发明基于以上方法对主机的Linux系统做了备份,当主机Linux系统崩溃引导不起来的时候,将光盘制作的启动盘接入主机中,对主机的Linux系统进行修复或者重装。 [0026] The present invention is based on the above method to the host Linux system made a backup, when the host Linux system crash does not boot up when the CD-ROM production startup disk connected to the host, the host Linux system repair or reinstall. 还原主机Linux系统的主引导记录和分区表,获取磁盘大小以及用户配置的分区参数。 Restore master host Linux system boot record and partition table to get the disk size and partition parameters configured by the user. 调用parted命令进行设置磁盘分区,并调用相应的mkfs对分区进行格式化。 Calls parted command to set the disk partitioning, and call the appropriate mkfs to format the partition. 将光盘内备份好的Linux系统分区文件解压缩好后,存入主机Linux系统分区中。 Good backup CD-ROM Linux file system partition After decompression, into the host Linux system partition. 若光盘内还备份有除了系统文件以外的其他数据,将这些数据解压缩放入到相应的系统分区中,完成系统数据还原。 If you also have a backup system in addition to other data files within the optical disc, the data will be decompressed into the appropriate system partition to complete the system restore data.

[0027] 尽管结合优选实施方案具体展示和介绍了本发明,但所属领域的技术人员应该明白,在不脱离所附权利要求书所限定的本发明的精神和范围内,在形式上和细节上可以对本发明做出各种变化,均为本发明的保护范围。 [0027] Although the preferred embodiments in conjunction particularly shown and described the present invention, but one of ordinary skill in the art should be understood within the spirit and scope of the appended claims without departing from the invention as defined in the form and details various changes may be made to the present invention, both the scope of the present invention.

Citas de patentes
Patente citada Fecha de presentación Fecha de publicación Solicitante Título
CN1534490A *31 Mar 20036 Oct 2004联想(北京)有限公司Realization method of computer hard disk data restoring and back-up
CN1549131A *6 May 200324 Nov 2004联想(北京)有限公司Repair method for computer operation system
CN101226477A *16 Ene 200723 Jul 2008北京共创开源软件有限公司Method for implementing Linux operating system being suitable for mobile application
CN103106091A *31 Ene 201315 May 2013深圳市开立科技有限公司Start-up system and method of operating system based on removable storage media
CN103207816A *8 Abr 201317 Jul 2013浪潮电子信息产业股份有限公司Linux system repairing method
US6851073 *26 Jul 19991 Feb 2005Microsoft CorporationExtensible system recovery architecture
US20040064610 *17 Sep 20031 Abr 2004Yasuko FukuzawaHeterogeneous computer system, heterogeneous input/output system and data back-up method for the systems
Clasificaciones
Clasificación internacionalG06F11/14
Eventos legales
FechaCódigoEventoDescripción
9 Dic 2015C06Publication
6 Ene 2016C10Entry into substantive examination