博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Linux系统之备份数据
阅读量:4225 次
发布时间:2019-05-26

本文共 8081 字,大约阅读时间需要 26 分钟。

System Backup and Recovery

Rsync

 is the directory backup and transfer tool for Linux. It is installed by default in Ubuntu. It can provide any type of backup, and options are extensive. Several GUI frontends for Rsync are listed .

GRsync

 is a GTK-based GUI front-end for Rsync. Install:

sudo apt-get install grsync

Bacula

 is the most widely-used GTK-based open source (GPL-licensed) network backup utility that is used in both server and desktop installations. A catalogue of backups can be maintained using MySQL, PostgreSQL, or SQLite. For more info see the . Both text-based and GUI frontends are available. Install the MySQL version:

sudo apt-get install bacula

SBackup

 is a simple backup and restore utility for the GTK-desktop. Install:

sudo apt-get install sbackup

Keep (Backup and Recovery)

 is a QT/KDE based backup utility used in previous versions of Ubuntu. It is no longer maintained and is not included in Ubuntu by default. Install:

sudo apt-get install keep

Run:

  • Menu -> Applications -> System Tools -> Keep (Backup System)
  • Backup:
Click "Add a Directory to Backup"
Select directories you wish to backup
Select a location to place the backup
Set how often you wish the backups to take place, and how long to keep them
Click "Backup Now"
Select the directory groups you wish to backup.
  • Recover:
Click "Restore a Backup"
Select the directory groups you wish to restore.

Partimage (Partition backup)

 is a free open-source utility to back up an entire partition into an .iso image. It can be used across a network, as well. Install and run:

sudo apt-get install partimagesudo partimage

Partimage cannot be used from within the partition you wish to backup. You will either have to run it from a different partition or from a . (A serious limitation of Partimage is its inability to backup/restore split image files to/from multiple media (e.g. spanned DVDs/CDs), limiting its usefulness as an inexpensive cloning and distribution solution. Partition image backup/restoration must be to/from a single hard drive, large capacity USB stick, or networked storage space.)

cp

An entire partition's filesystem can easily be copied to another partition using the cp -a command. (However, this cannot be done for the partition of a filesystem that is running. Use the (K)Ubuntu LiveCD to copy partitions when necessary.) Obviously the destination partition should be as large or larger than the source partition, and while not necessary, probably is best if both partitions are of the same filesystem type (e.g. ext4). Use  to create or manipulate the destination partition, if necessary. To copy the entire filesystem, for example, from the ext4 partition /dev/sda6 into the ext4 partition at/dev/sda7, mount both partitions:

sudo mkdir /media/partsda6sudo mkdir /media/partsda7sudo mount /dev/sda6 -t ext4 /media/partsda6sudo mount /dev/sda7 -t ext4 /media/partsda7

Then merely copy the contents from one partition to the other:

sudo cp -a /media/partsda6/* /media/partsda7
  • Of course, once the partition's filesystem is copied, a bootmanager (Grub2 or Grub Legacy) will have to be updated/reconfigured to recognize the new partition's OS in order to enable it to boot. Also, the /etc/fstab file of the new partition's filesystem may need to be edited (in regards to the UUIDs of the various partitions), to prevent conflicts. To determine the UUIDs of all current partitions on a hard drive:
sudo blkid

Edit fstab so that the UUIDs are correctly reflected there.

  • To confirm that the file copy has completed, the Linux command  (also see ) can be used to calculate the disk usage for both the source and destination folders in order to compare the values (to ensure that they are the same). For example, the values should be the same for both partitions after copying has completed:
sudo du /media/partsda6sudo du /media/partsda7

dd

 is a *nix command that enables the copying of files or an entire disk using a single command. Parameters must be precisely specified to avoid risk of accidentally erasing data. See  or  for detailed options. You cannot copy a hard drive that contains the operating system you are currently running. Instead, boot into a LiveCD and run the dd command that way. An example command to copy Hard drive X to Hard drive Y is:

dd if=/dev/hdx of=/dev/hdy
  •  is a variation of the dd command that allows working with potentially corrupted datasets, partitions, or hard drives.

FSArchiver (Filesystem Archiver)

 is a utility to backup the filesystem by files (instead of by partition blocks). A filesystem backed up in this way can be moved to a different sized partition or another disk filesystem altogether (e.g. from ext3 to ext4). Backups can be split and stored on (and restored from) spanned media (e.g. multiple DVDs/CDs). It is included in the . Install:

sudo apt-get install fsarchiver

System Rescue and Cloning Utilities

System Rescue CD

 is a LiveCD that includes important utilities such as , , ddrescue, , and. Several of these utilities cannot be used from within a running partition, so using them from a LiveCD is often necessary.  and  the LiveCD from the website.

Clonezilla

 allows the backup or duplication of a partition for a single machine or for multiple machines over a network. (It is similar to Norton Ghost.) It includes , , and other utilities. It is  as a LiveCD which can then be . (A serious limitation of Clonezilla is its inability to backup/restore split image files to/from multiple media (e.g. spanned DVDs/CDs), limiting its usefulness as an inexpensive cloning and distribution solution. Partition image backup/restoration must be to/from a single hard drive, large capacity USB stick, or networked storage space.)

Disk Imaging software

  •  is a utility to image a disk bit by bit.
  •  is a utility to image a disk bit by bit. It includes a GUI interface.

Ubuntu Customization Kit

  •  is a utility to customize a (K)Ubuntu LiveCD. Install:
sudo apt-get install uck

Remastering software

Debian and (K)Ubuntu Linux operating systems can be "remastered" and customized (using one of a number of utilities) for re-distribution. (See .) This enables an organization to pre-load desired applications and customizations for distribution among its members, while preserving the intrinsic architecture and function of (K)Ubuntu. The customized (K)Ubuntu OS can then be distributed on a CD or on a USB flashdrive. Users are then free to further customize the OS, or even to revert back to the original default (K)Ubuntu settings. Also see the .

  • oem-config-gtk
sudo apt-get install oem-config-gtk
  • . For tips, see .
  • . The open source engine can be  and installed as a .deb package.

Run (K)Ubuntu LiveCD from a USB pendrive

The (K)Ubuntu LiveCD can be installed on and run from a USB pendrive. Settings can be "persistently" saved (but the LiveCD kernel modules can not be upgraded). Programs can be installed and run, however, and files saved to the USB drive. (The installed programs will remain installed). A  is needed to do the installation. For additional info, see the , the  or the .

The USB "LiveCD" can be used to install (K)Ubuntu on computers (including ) that do not have CD-ROM/DVD drives. See these instructions to .

USB pendrives to be used to run (K)Ubuntu should have a minimum of 2 Gb (preferably 4 Gb). If you wish to install a fast, fully functional Linux system on a pendrive that has less memory than that, use  or .

USB Creator

You can make a "LiveCD" on a USB pendrive using USB Creator and either a LiveCD or an .iso version of the LiveCD stored on your hard drive. USB Creator is installed by default in (K)Ubuntu. If not, install:

sudo apt-get install usb-creator-gtk
  • Run:
Menu -> System -> Startup Disk Creator

Create a boot CD to allow booting from the USB drive

Many computers do not allow booting from a USB drive (but they do allow booting from the CD-ROM). You can create a CD-ROM using  and set your BIOS to boot from this CD-ROM. When you boot from this CD-ROM, it will use the bootup files on the (K)Ubuntu USB drive you previously created (in the step above).

原文链接:http://ubuntuguide.org/wiki/Ubuntu_Trusty_System_Backup

转载地址:http://umzqi.baihongyu.com/

你可能感兴趣的文章
经典论文复现 | LSGAN:最小二乘生成对抗网络
查看>>
报名 | 第二届网上行为社会网分析学术研讨会
查看>>
独家 | 用Python Featuretools库实现自动化特征工程(附链接)
查看>>
报名 | 二值化网络 & 基于素描图的图像检索论坛
查看>>
干货 | 清华大学郑方:语音技术用于身份认证的理论与实践
查看>>
近期活动盘点:2018数据与媒介发展论坛、大数据应用中日交流论坛(11.04-11.15)...
查看>>
干货 | 476个PyTorch资源大合集推荐,GitHub超过3600星
查看>>
清华本科生最高荣誉:图说十年特奖得主(附历年名单)
查看>>
报名 | data Artisans、腾讯、阿里、滴滴、美团专家带你认识Flink!
查看>>
Yoshua:深度学习AI迈向人类水平的挑战(附PPT下载)
查看>>
阿里、京东、去哪儿等大厂技术专家齐聚北京,Flink China Meetup再度归来!
查看>>
独家 | 一文盘点数据集市和数据仓库的差异(附链接)
查看>>
独家 | 一文了解强化学习的商业应用2
查看>>
近期活动盘点:大数据应用中日交流论坛、几位专家带你认识Flink、青年自强AI计划 CV免费公开课!(11.12-11.23)...
查看>>
清华出品 | 人脸识别最全知识图谱
查看>>
张钹院士:从少年郎到白发翁,水木清华60载,智能人生谱华章
查看>>
独家 | 利用Auto ARIMA构建高性能时间序列模型(附Python和R代码)
查看>>
医工智能 创享未来—— “医工科研数据平台”与“医工结合科研创新支持计划”发布!...
查看>>
手把手教你用Kaggle开启机器学习之旅(附资源链接)
查看>>
手把手教你用Python处理非平稳时间序列(附代码)
查看>>