特殊:Badtitle/NS100:BackupYourSystem:修订间差异
小无编辑摘要 |
小无编辑摘要 |
||
第1行: | 第1行: | ||
{{From|https://help.ubuntu.com/community/BackupYourSystem}} | {{From|https://help.ubuntu.com/community/BackupYourSystem}} | ||
{{Languages|UbuntuHelp:BackupYourSystem}} | {{Languages|UbuntuHelp:BackupYourSystem}} | ||
== Introduction == | |||
Backing up your | Backup is essential. Without it, data is entirely exposed to loss under a number of circumstances such as drive failure or data corruption. Users often only learn this lesson after critical information they require is permanently lost. Attempting to [[UbuntuHelp:DataRecovery|| recover]] from such data loss can be both time consuming and extremely troublesome. So learn from others mistakes, and ensure beforehand that you have a system in place that protects your data and suits your needs. | ||
== | Backing up files can be accomplished either from a graphical user interface (GUI) or by issuing commands to the command line interface (CLI). It doesn't matter which method you employ, so long as it works for you and you do it on a regular basis. To make sure it's regular, it's best to ensure your method is scheduled so you don't need to remember to do it. | ||
=== | == Types of Backup == | ||
It is important to note that there are several means of backup. One is the bare-metal backup/recovery sometimes also called disaster recovery. After you lost your notebook or hardrive you can buy a new one of the same type, but where are your operating systems, software installations and data. With this type of backup you can restore everything to the state it was at the time of backup! This type of backup can be done with a system like clonezilla. It saves your linux operating systems, your windows operating systems, your master boot record, your partition tables and your hardware informations. You have to boot on another operating system, normally a live CD but it can also be done with an USB-Stick or over network. But this type of backup requires hours. So it is not possible every day. You need to complement this with a backup of your important changes on a more regular basis. | |||
==== | === synchronization & archives === | ||
Simple Backup Suite is a program | For this regular backups the two primary means are folder synchronization (method 1) and the creation of archives (method 2). | ||
Folder synchronization is a means to ensure two different folders at two locations hold the same data. The synchronization is usually modified by certain rules, such as directing the program to only write new files. It is most useful for multimedia files that will not benefit from compression. The reason for this is that during encoding of such media near maximal compression is usually achieved with the codec. | |||
For | Creating an archive is mainly used for long-term storage, primarily of configuration files and documents. These will benefit greatly from the compression of gzip or bzip2 because the documents aren't stored in compressed formats. Since the size required on disk is much smaller than storing copies of multimedia files, users often create numerous full backups allowing them to go back and restore files from certain dates. | ||
=== imaging (with dd or the like) === | |||
A third alternative is called drive imaging. Drive imaging is similar to the creation of archives, except that instead of copying just folders and files, the entire [[UbuntuHelp:HowtoPartition|partition]] that is selected is backed up to an archive byte for byte. Such archives are useful, in the case of a hard drive failure, entire partitions can be restored quickly to a new hard drive and work resumed. | |||
'''WARNING''': Backups such as drive imaging work at a low level and if improperly used can result in severe data loss, especially with a command line program like dd. Ensure you understand what is being done! But dd is the fastest tool available. It works on a sector basis. | |||
=== full/incremental backup (for example with dump/restore) === | |||
A fourth alternative is the dump/restore command, which exists on unix since ever. It is a little outfashioned now. It is not for beginners, but it is (after dd) the fastest tool available. It also works not on the filesystem level but on the sector level. It can do full backups (as dd) but it also can do incremental backups (only the changed data is saved), which speeds up backup drastically (restore is slowd down, but hopefully not used so much as backup). dump is not available on every filesystem, especially not on windows file systems, but it is available on the most important unix filesystems. Linus Thorwald has warned on using dump on journaling filesystems, which are standard now. But there are no problems if you have the partition to backup mounted readonly. You can accomplish this by booting on annother system. But for most bar-metal backup's you have to do this. For the average user clonezilla is the easier approach. For the advanced user full and incremental backups with dump is possibly the best and fastest tool available. | |||
=== snapshooting (for servers) === | |||
The fifth method would be to use snapshooting technologies, as available by commercial tools and by lvm (logical volume manager). But this is possibly overkill for desktop use. But nevertheless it is installed on a lot of servers, and therefore shall be mentioned here. | |||
== Final Note == | |||
One final note, some file systems support versioning, which allows you to see all changes to a file. This is a local backup, but will do nothing in the case of drive failure. See the appropriate section for a discussion. | |||
== Backup From a Graphical User Interface == | |||
GUIs offer a graphical interface from which a user can choose from a limited selection of options to customize operation. There are also usually configured defaults and guides that help in selecting the right options. There are a few to choose from, below you'll find several good choices that work well. | |||
=== Clonezilla === | |||
It can save your linux operating systems, your windows operating systems, your master boot record, your partition tables and your hardware informations. You have to boot on another operating system, easiest with a live CD but it can also be done with an USB-Stick or over network. The homepage is: http://clonezilla.org/ | |||
=== Simple Backup Suite === | |||
Simple Backup Suite is a program designed for desktop users. It's purpose is succinctly summarized by it's title, to be a simple backup suite. It is easily installed from the repositories and comes with defaults already loaded and configured. From there you can customize what directories it backs up, what it excludes, schedule it to certain times and manage old archives. This suite creates archives, keep that in mind during use. | |||
For a thorough guide to installation and general use, please see [[UbuntuHelp:BackupYourSystem/SimpleBackupSuite|SimpleBackupSuite]]. | |||
=== grsync === | |||
The program grsync is simply a GUI front end for the CLI utility rsync. It presents a clean yet simple interface for controlling the synchronization between two folders. It also supports multiple sessions (otherwise called profiles) and many of the commonly used basic and advanced options for modifying the synchronization. | |||
For more information see the [[UbuntuHelp:rsync#grsync|rsync|page]]. | |||
== Backup From the Command Line == | |||
CLI's primary advantage over a GUI is that it exposes directly to you many more options. With that however comes the obligation of knowing exactly before hand what you want to do. There are no defaults with commands it's entirely up to the user to set the desired options. To better acquaint yourself beforehand, it is advisable that you read [[UbuntuHelp:UsingTheTerminal|UsingTheTerminal]]. | |||
=== Creating an Archive === | |||
When backing up from the command line '''tar''' is often used. The tar command creates an archive file, which can then be further compressed by gzip or bzip2 to decrease the size it occupies on the disk. | |||
A full explanation of this command, including how to backup, restore and how to operate over a network among other things can be found at [[UbuntuHelp:BackupYourSystem/TAR|BackupYourSystem/TAR]]. | |||
=== rsync === | |||
Rsync updates and copies the files that have changed and even then only transfers the parts of those files that have changed. That is useful for saving bandwidth when backing up over the network. For safety, transfer between two machines is done via SSH. Rsync is especially good for backing up home directories. | |||
For a full explanation, there is a separate page about [[UbuntuHelp:rsync|rsync]]. As a companion, the article on [[UbuntuHelp:SSH|SSH]] is worthwhile reading for those wanting to backup over a network. | |||
=== dump/restore === | |||
homepage: http://dump.sourceforge.net/ | |||
[[UbuntuWiki:]] http://en.wikipedia.org/wiki/Dump_%28program%29 | |||
== Backup Destination on a Remote Machine == | |||
=== Simple Backup Suite === | |||
[[UbuntuHelp:BackupYourSystem/SimpleBackupSuite#|SimpleBackupSuite]] | |||
=== Duplicity === | |||
[[UbuntuHelp:DuplicityBackupHowto|DuplicityBackupHowto]] | [[UbuntuHelp:DuplicityBackupHowto|DuplicityBackupHowto]] | ||
=== BackupPC === | |||
[[UbuntuHelp:BackupPC|BackupPC]] | [[UbuntuHelp:BackupPC|BackupPC]] | ||
== | == Drive Imaging == | ||
[[UbuntuHelp:DriveImaging|Drive Imaging]] is a complex topic, and a new article has been created for it. Please see that page for background information and instructions on how to create and restore images of folders or whole partitions. | |||
== Alternatives == | |||
=== Versioning File Systems === | |||
These will be very useful when they mature. For example, ext3cow file system states it, "provides a time-shifting interface that allows a real-time and continuous view of the past. This allows users to access their file system as it appeared at any point in time." This feature is automatic -- nothing (meaning no backups, manual copies, etc.) need be done to have this benefit when using a copy-on-write file system. | |||
* [http://www.ext3cow.com/Welcome.html ext3cow] | |||
* [http://wayback.sourceforge.net/ Wayback] | |||
* [http://n0x.org/copyfs/ CopyFS] | |||
* [http://en.wikipedia.org/wiki/Btrfs B-tree FS] | |||
* [http://en.wikipedia.org/wiki/ZFS ZFS] | |||
They let you see ''every'' change to a file over it's life span, but offer no protection against a hard drive that fails. These projects are therefore complimentary to the backups described above, which offer snapshots or synchronization that can be stored on other hard drives or even other locations on a network. | |||
Versioning tools such as [[UbuntuHelp:Subversion|Subversion]] could also be useful while we wait for versioning file systems to become mature and fully supported. | |||
=== Early Stage Ideas === | |||
In addition to that already discussed, there are projects still in development that you may wish to keep appraised of or even participate in. | |||
* Ubuntu:ContinuousBackups | |||
* Ubuntu:HomeUserBackup | |||
* Ubuntu:MigrateAndBackup | |||
* Ubuntu:BackupOfPackageUserData | |||
* Ubuntu:UbuntuDownUnder/BOFs/SimpleBackupSolution | |||
* Ubuntu:SessionBackup | |||
== Related Links == | |||
/ | |||
/ | |||
* [http:// | |||
[ | |||
= | |||
== | |||
You might also want to check out these backup programs which will help you to make automated backups of your system: | You might also want to check out these backup programs which will help you to make automated backups of your system: | ||
* [[UbuntuWiki:TimeVault|TimeVault]]. | * [[UbuntuWiki:TimeVault|TimeVault]]. | ||
第94行: | 第73行: | ||
* [http://backintime.le-web.org/ Back In Time]. | * [http://backintime.le-web.org/ Back In Time]. | ||
* [http://amanda.zmanda.com/ Amanda]. | * [http://amanda.zmanda.com/ Amanda]. | ||
* [http://www.mondorescue.org/ Mondo Rescue]. | * [http://www.mondorescue.org/ Mondo Rescue]. | ||
* [http://www.rsnapshot.org/ rsnapshot]. | * [http://www.rsnapshot.org/ rsnapshot]. | ||
* [http://www.bacula.org/ Bacula]. | * [http://www.bacula.org/ Bacula]. | ||
* [http://www.nongnu.org/storebackup/ storeBackup -- it has unique features]. | * [http://www.nongnu.org/storebackup/ storeBackup -- it has unique features]. | ||
Other wiki discussing various Linux backup techniques: | Other wiki discussing various Linux backup techniques: | ||
第110行: | 第87行: | ||
A personal blog listing many open source backup solutions: | A personal blog listing many open source backup solutions: | ||
[http://davestechshop.net/ListOfFreeOpenSourceLinuxUbuntuBackupSoftware List of Free Open Source Linux and Ubuntu Backup Software] | [http://davestechshop.net/ListOfFreeOpenSourceLinuxUbuntuBackupSoftware List of Free Open Source Linux and Ubuntu Backup Software] | ||
---- | ---- | ||
[[category:CategoryBackupRecovery]] | [[category:CategoryBackupRecovery]] [[category:CategoryCommandLine]] | ||
[[category:UbuntuHelp]] | [[category:UbuntuHelp]] |
2009年11月17日 (二) 18:36的版本
文章出处: |
{{#if: | {{{2}}} | https://help.ubuntu.com/community/BackupYourSystem }} |
点击翻译: |
English {{#ifexist: {{#if: UbuntuHelp:BackupYourSystem | UbuntuHelp:BackupYourSystem | {{#if: | :}}BackupYourSystem}}/af | • {{#if: UbuntuHelp:BackupYourSystem|Afrikaans| [[::BackupYourSystem/af|Afrikaans]]}}|}} {{#ifexist: {{#if: UbuntuHelp:BackupYourSystem | UbuntuHelp:BackupYourSystem | {{#if: | :}}BackupYourSystem}}/ar | • {{#if: UbuntuHelp:BackupYourSystem|العربية| [[::BackupYourSystem/ar|العربية]]}}|}} {{#ifexist: {{#if: UbuntuHelp:BackupYourSystem | UbuntuHelp:BackupYourSystem | {{#if: | :}}BackupYourSystem}}/az | • {{#if: UbuntuHelp:BackupYourSystem|azərbaycanca| [[::BackupYourSystem/az|azərbaycanca]]}}|}} {{#ifexist: {{#if: UbuntuHelp:BackupYourSystem | UbuntuHelp:BackupYourSystem | {{#if: | :}}BackupYourSystem}}/bcc | • {{#if: UbuntuHelp:BackupYourSystem|جهلسری بلوچی| [[::BackupYourSystem/bcc|جهلسری بلوچی]]}}|}} {{#ifexist: {{#if: UbuntuHelp:BackupYourSystem | UbuntuHelp:BackupYourSystem | {{#if: | :}}BackupYourSystem}}/bg | • {{#if: UbuntuHelp:BackupYourSystem|български| [[::BackupYourSystem/bg|български]]}}|}} {{#ifexist: {{#if: UbuntuHelp:BackupYourSystem | UbuntuHelp:BackupYourSystem | {{#if: | :}}BackupYourSystem}}/br | • {{#if: UbuntuHelp:BackupYourSystem|brezhoneg| [[::BackupYourSystem/br|brezhoneg]]}}|}} {{#ifexist: {{#if: UbuntuHelp:BackupYourSystem | UbuntuHelp:BackupYourSystem | {{#if: | :}}BackupYourSystem}}/ca | • {{#if: UbuntuHelp:BackupYourSystem|català| [[::BackupYourSystem/ca|català]]}}|}} {{#ifexist: {{#if: UbuntuHelp:BackupYourSystem | UbuntuHelp:BackupYourSystem | {{#if: | :}}BackupYourSystem}}/cs | • {{#if: UbuntuHelp:BackupYourSystem|čeština| [[::BackupYourSystem/cs|čeština]]}}|}} {{#ifexist: {{#if: UbuntuHelp:BackupYourSystem | UbuntuHelp:BackupYourSystem | {{#if: | :}}BackupYourSystem}}/de | • {{#if: UbuntuHelp:BackupYourSystem|Deutsch| [[::BackupYourSystem/de|Deutsch]]}}|}} {{#ifexist: {{#if: UbuntuHelp:BackupYourSystem | UbuntuHelp:BackupYourSystem | {{#if: | :}}BackupYourSystem}}/el | • {{#if: UbuntuHelp:BackupYourSystem|Ελληνικά| [[::BackupYourSystem/el|Ελληνικά]]}}|}} {{#ifexist: {{#if: UbuntuHelp:BackupYourSystem | UbuntuHelp:BackupYourSystem | {{#if: | :}}BackupYourSystem}}/es | • {{#if: UbuntuHelp:BackupYourSystem|español| [[::BackupYourSystem/es|español]]}}|}} {{#ifexist: {{#if: UbuntuHelp:BackupYourSystem | UbuntuHelp:BackupYourSystem | {{#if: | :}}BackupYourSystem}}/fa | • {{#if: UbuntuHelp:BackupYourSystem|فارسی| [[::BackupYourSystem/fa|فارسی]]}}|}} {{#ifexist: {{#if: UbuntuHelp:BackupYourSystem | UbuntuHelp:BackupYourSystem | {{#if: | :}}BackupYourSystem}}/fi | • {{#if: UbuntuHelp:BackupYourSystem|suomi| [[::BackupYourSystem/fi|suomi]]}}|}} {{#ifexist: {{#if: UbuntuHelp:BackupYourSystem | UbuntuHelp:BackupYourSystem | {{#if: | :}}BackupYourSystem}}/fr | • {{#if: UbuntuHelp:BackupYourSystem|français| [[::BackupYourSystem/fr|français]]}}|}} {{#ifexist: {{#if: UbuntuHelp:BackupYourSystem | UbuntuHelp:BackupYourSystem | {{#if: | :}}BackupYourSystem}}/gu | • {{#if: UbuntuHelp:BackupYourSystem|ગુજરાતી| [[::BackupYourSystem/gu|ગુજરાતી]]}}|}} {{#ifexist: {{#if: UbuntuHelp:BackupYourSystem | UbuntuHelp:BackupYourSystem | {{#if: | :}}BackupYourSystem}}/he | • {{#if: UbuntuHelp:BackupYourSystem|עברית| [[::BackupYourSystem/he|עברית]]}}|}} {{#ifexist: {{#if: UbuntuHelp:BackupYourSystem | UbuntuHelp:BackupYourSystem | {{#if: | :}}BackupYourSystem}}/hu | • {{#if: UbuntuHelp:BackupYourSystem|magyar| [[::BackupYourSystem/hu|magyar]]}}|}} {{#ifexist: {{#if: UbuntuHelp:BackupYourSystem | UbuntuHelp:BackupYourSystem | {{#if: | :}}BackupYourSystem}}/id | • {{#if: UbuntuHelp:BackupYourSystem|Bahasa Indonesia| [[::BackupYourSystem/id|Bahasa Indonesia]]}}|}} {{#ifexist: {{#if: UbuntuHelp:BackupYourSystem | UbuntuHelp:BackupYourSystem | {{#if: | :}}BackupYourSystem}}/it | • {{#if: UbuntuHelp:BackupYourSystem|italiano| [[::BackupYourSystem/it|italiano]]}}|}} {{#ifexist: {{#if: UbuntuHelp:BackupYourSystem | UbuntuHelp:BackupYourSystem | {{#if: | :}}BackupYourSystem}}/ja | • {{#if: UbuntuHelp:BackupYourSystem|日本語| [[::BackupYourSystem/ja|日本語]]}}|}} {{#ifexist: {{#if: UbuntuHelp:BackupYourSystem | UbuntuHelp:BackupYourSystem | {{#if: | :}}BackupYourSystem}}/ko | • {{#if: UbuntuHelp:BackupYourSystem|한국어| [[::BackupYourSystem/ko|한국어]]}}|}} {{#ifexist: {{#if: UbuntuHelp:BackupYourSystem | UbuntuHelp:BackupYourSystem | {{#if: | :}}BackupYourSystem}}/ksh | • {{#if: UbuntuHelp:BackupYourSystem|Ripoarisch| [[::BackupYourSystem/ksh|Ripoarisch]]}}|}} {{#ifexist: {{#if: UbuntuHelp:BackupYourSystem | UbuntuHelp:BackupYourSystem | {{#if: | :}}BackupYourSystem}}/mr | • {{#if: UbuntuHelp:BackupYourSystem|मराठी| [[::BackupYourSystem/mr|मराठी]]}}|}} {{#ifexist: {{#if: UbuntuHelp:BackupYourSystem | UbuntuHelp:BackupYourSystem | {{#if: | :}}BackupYourSystem}}/ms | • {{#if: UbuntuHelp:BackupYourSystem|Bahasa Melayu| [[::BackupYourSystem/ms|Bahasa Melayu]]}}|}} {{#ifexist: {{#if: UbuntuHelp:BackupYourSystem | UbuntuHelp:BackupYourSystem | {{#if: | :}}BackupYourSystem}}/nl | • {{#if: UbuntuHelp:BackupYourSystem|Nederlands| [[::BackupYourSystem/nl|Nederlands]]}}|}} {{#ifexist: {{#if: UbuntuHelp:BackupYourSystem | UbuntuHelp:BackupYourSystem | {{#if: | :}}BackupYourSystem}}/no | • {{#if: UbuntuHelp:BackupYourSystem|norsk| [[::BackupYourSystem/no|norsk]]}}|}} {{#ifexist: {{#if: UbuntuHelp:BackupYourSystem | UbuntuHelp:BackupYourSystem | {{#if: | :}}BackupYourSystem}}/oc | • {{#if: UbuntuHelp:BackupYourSystem|occitan| [[::BackupYourSystem/oc|occitan]]}}|}} {{#ifexist: {{#if: UbuntuHelp:BackupYourSystem | UbuntuHelp:BackupYourSystem | {{#if: | :}}BackupYourSystem}}/pl | • {{#if: UbuntuHelp:BackupYourSystem|polski| [[::BackupYourSystem/pl|polski]]}}|}} {{#ifexist: {{#if: UbuntuHelp:BackupYourSystem | UbuntuHelp:BackupYourSystem | {{#if: | :}}BackupYourSystem}}/pt | • {{#if: UbuntuHelp:BackupYourSystem|português| [[::BackupYourSystem/pt|português]]}}|}} {{#ifexist: {{#if: UbuntuHelp:BackupYourSystem | UbuntuHelp:BackupYourSystem | {{#if: | :}}BackupYourSystem}}/ro | • {{#if: UbuntuHelp:BackupYourSystem|română| [[::BackupYourSystem/ro|română]]}}|}} {{#ifexist: {{#if: UbuntuHelp:BackupYourSystem | UbuntuHelp:BackupYourSystem | {{#if: | :}}BackupYourSystem}}/ru | • {{#if: UbuntuHelp:BackupYourSystem|русский| [[::BackupYourSystem/ru|русский]]}}|}} {{#ifexist: {{#if: UbuntuHelp:BackupYourSystem | UbuntuHelp:BackupYourSystem | {{#if: | :}}BackupYourSystem}}/si | • {{#if: UbuntuHelp:BackupYourSystem|සිංහල| [[::BackupYourSystem/si|සිංහල]]}}|}} {{#ifexist: {{#if: UbuntuHelp:BackupYourSystem | UbuntuHelp:BackupYourSystem | {{#if: | :}}BackupYourSystem}}/sq | • {{#if: UbuntuHelp:BackupYourSystem|shqip| [[::BackupYourSystem/sq|shqip]]}}|}} {{#ifexist: {{#if: UbuntuHelp:BackupYourSystem | UbuntuHelp:BackupYourSystem | {{#if: | :}}BackupYourSystem}}/sr | • {{#if: UbuntuHelp:BackupYourSystem|српски / srpski| [[::BackupYourSystem/sr|српски / srpski]]}}|}} {{#ifexist: {{#if: UbuntuHelp:BackupYourSystem | UbuntuHelp:BackupYourSystem | {{#if: | :}}BackupYourSystem}}/sv | • {{#if: UbuntuHelp:BackupYourSystem|svenska| [[::BackupYourSystem/sv|svenska]]}}|}} {{#ifexist: {{#if: UbuntuHelp:BackupYourSystem | UbuntuHelp:BackupYourSystem | {{#if: | :}}BackupYourSystem}}/th | • {{#if: UbuntuHelp:BackupYourSystem|ไทย| [[::BackupYourSystem/th|ไทย]]}}|}} {{#ifexist: {{#if: UbuntuHelp:BackupYourSystem | UbuntuHelp:BackupYourSystem | {{#if: | :}}BackupYourSystem}}/tr | • {{#if: UbuntuHelp:BackupYourSystem|Türkçe| [[::BackupYourSystem/tr|Türkçe]]}}|}} {{#ifexist: {{#if: UbuntuHelp:BackupYourSystem | UbuntuHelp:BackupYourSystem | {{#if: | :}}BackupYourSystem}}/vi | • {{#if: UbuntuHelp:BackupYourSystem|Tiếng Việt| [[::BackupYourSystem/vi|Tiếng Việt]]}}|}} {{#ifexist: {{#if: UbuntuHelp:BackupYourSystem | UbuntuHelp:BackupYourSystem | {{#if: | :}}BackupYourSystem}}/yue | • {{#if: UbuntuHelp:BackupYourSystem|粵語| [[::BackupYourSystem/yue|粵語]]}}|}} {{#ifexist: {{#if: UbuntuHelp:BackupYourSystem | UbuntuHelp:BackupYourSystem | {{#if: | :}}BackupYourSystem}}/zh | • {{#if: UbuntuHelp:BackupYourSystem|中文| [[::BackupYourSystem/zh|中文]]}}|}} {{#ifexist: {{#if: UbuntuHelp:BackupYourSystem | UbuntuHelp:BackupYourSystem | {{#if: | :}}BackupYourSystem}}/zh-hans | • {{#if: UbuntuHelp:BackupYourSystem|中文(简体)| [[::BackupYourSystem/zh-hans|中文(简体)]]}}|}} {{#ifexist: {{#if: UbuntuHelp:BackupYourSystem | UbuntuHelp:BackupYourSystem | {{#if: | :}}BackupYourSystem}}/zh-hant | • {{#if: UbuntuHelp:BackupYourSystem|中文(繁體)| [[::BackupYourSystem/zh-hant|中文(繁體)]]}}|}} |
{{#ifeq:UbuntuHelp:BackupYourSystem|:BackupYourSystem|请不要直接编辑翻译本页,本页将定期与来源同步。}} |
{{#ifexist: :BackupYourSystem/zh | | {{#ifexist: BackupYourSystem/zh | | {{#ifeq: {{#titleparts:BackupYourSystem|1|-1|}} | zh | | }} }} }} {{#ifeq: {{#titleparts:BackupYourSystem|1|-1|}} | zh | | }}
Introduction
Backup is essential. Without it, data is entirely exposed to loss under a number of circumstances such as drive failure or data corruption. Users often only learn this lesson after critical information they require is permanently lost. Attempting to | recover from such data loss can be both time consuming and extremely troublesome. So learn from others mistakes, and ensure beforehand that you have a system in place that protects your data and suits your needs. Backing up files can be accomplished either from a graphical user interface (GUI) or by issuing commands to the command line interface (CLI). It doesn't matter which method you employ, so long as it works for you and you do it on a regular basis. To make sure it's regular, it's best to ensure your method is scheduled so you don't need to remember to do it.
Types of Backup
It is important to note that there are several means of backup. One is the bare-metal backup/recovery sometimes also called disaster recovery. After you lost your notebook or hardrive you can buy a new one of the same type, but where are your operating systems, software installations and data. With this type of backup you can restore everything to the state it was at the time of backup! This type of backup can be done with a system like clonezilla. It saves your linux operating systems, your windows operating systems, your master boot record, your partition tables and your hardware informations. You have to boot on another operating system, normally a live CD but it can also be done with an USB-Stick or over network. But this type of backup requires hours. So it is not possible every day. You need to complement this with a backup of your important changes on a more regular basis.
synchronization & archives
For this regular backups the two primary means are folder synchronization (method 1) and the creation of archives (method 2). Folder synchronization is a means to ensure two different folders at two locations hold the same data. The synchronization is usually modified by certain rules, such as directing the program to only write new files. It is most useful for multimedia files that will not benefit from compression. The reason for this is that during encoding of such media near maximal compression is usually achieved with the codec. Creating an archive is mainly used for long-term storage, primarily of configuration files and documents. These will benefit greatly from the compression of gzip or bzip2 because the documents aren't stored in compressed formats. Since the size required on disk is much smaller than storing copies of multimedia files, users often create numerous full backups allowing them to go back and restore files from certain dates.
imaging (with dd or the like)
A third alternative is called drive imaging. Drive imaging is similar to the creation of archives, except that instead of copying just folders and files, the entire partition that is selected is backed up to an archive byte for byte. Such archives are useful, in the case of a hard drive failure, entire partitions can be restored quickly to a new hard drive and work resumed. WARNING: Backups such as drive imaging work at a low level and if improperly used can result in severe data loss, especially with a command line program like dd. Ensure you understand what is being done! But dd is the fastest tool available. It works on a sector basis.
full/incremental backup (for example with dump/restore)
A fourth alternative is the dump/restore command, which exists on unix since ever. It is a little outfashioned now. It is not for beginners, but it is (after dd) the fastest tool available. It also works not on the filesystem level but on the sector level. It can do full backups (as dd) but it also can do incremental backups (only the changed data is saved), which speeds up backup drastically (restore is slowd down, but hopefully not used so much as backup). dump is not available on every filesystem, especially not on windows file systems, but it is available on the most important unix filesystems. Linus Thorwald has warned on using dump on journaling filesystems, which are standard now. But there are no problems if you have the partition to backup mounted readonly. You can accomplish this by booting on annother system. But for most bar-metal backup's you have to do this. For the average user clonezilla is the easier approach. For the advanced user full and incremental backups with dump is possibly the best and fastest tool available.
snapshooting (for servers)
The fifth method would be to use snapshooting technologies, as available by commercial tools and by lvm (logical volume manager). But this is possibly overkill for desktop use. But nevertheless it is installed on a lot of servers, and therefore shall be mentioned here.
Final Note
One final note, some file systems support versioning, which allows you to see all changes to a file. This is a local backup, but will do nothing in the case of drive failure. See the appropriate section for a discussion.
Backup From a Graphical User Interface
GUIs offer a graphical interface from which a user can choose from a limited selection of options to customize operation. There are also usually configured defaults and guides that help in selecting the right options. There are a few to choose from, below you'll find several good choices that work well.
Clonezilla
It can save your linux operating systems, your windows operating systems, your master boot record, your partition tables and your hardware informations. You have to boot on another operating system, easiest with a live CD but it can also be done with an USB-Stick or over network. The homepage is: http://clonezilla.org/
Simple Backup Suite
Simple Backup Suite is a program designed for desktop users. It's purpose is succinctly summarized by it's title, to be a simple backup suite. It is easily installed from the repositories and comes with defaults already loaded and configured. From there you can customize what directories it backs up, what it excludes, schedule it to certain times and manage old archives. This suite creates archives, keep that in mind during use. For a thorough guide to installation and general use, please see SimpleBackupSuite.
grsync
The program grsync is simply a GUI front end for the CLI utility rsync. It presents a clean yet simple interface for controlling the synchronization between two folders. It also supports multiple sessions (otherwise called profiles) and many of the commonly used basic and advanced options for modifying the synchronization. For more information see the rsync|page.
Backup From the Command Line
CLI's primary advantage over a GUI is that it exposes directly to you many more options. With that however comes the obligation of knowing exactly before hand what you want to do. There are no defaults with commands it's entirely up to the user to set the desired options. To better acquaint yourself beforehand, it is advisable that you read UsingTheTerminal.
Creating an Archive
When backing up from the command line tar is often used. The tar command creates an archive file, which can then be further compressed by gzip or bzip2 to decrease the size it occupies on the disk. A full explanation of this command, including how to backup, restore and how to operate over a network among other things can be found at BackupYourSystem/TAR.
rsync
Rsync updates and copies the files that have changed and even then only transfers the parts of those files that have changed. That is useful for saving bandwidth when backing up over the network. For safety, transfer between two machines is done via SSH. Rsync is especially good for backing up home directories. For a full explanation, there is a separate page about rsync. As a companion, the article on SSH is worthwhile reading for those wanting to backup over a network.
dump/restore
homepage: http://dump.sourceforge.net/ UbuntuWiki: http://en.wikipedia.org/wiki/Dump_%28program%29
Backup Destination on a Remote Machine
Simple Backup Suite
Duplicity
BackupPC
Drive Imaging
Drive Imaging is a complex topic, and a new article has been created for it. Please see that page for background information and instructions on how to create and restore images of folders or whole partitions.
Alternatives
Versioning File Systems
These will be very useful when they mature. For example, ext3cow file system states it, "provides a time-shifting interface that allows a real-time and continuous view of the past. This allows users to access their file system as it appeared at any point in time." This feature is automatic -- nothing (meaning no backups, manual copies, etc.) need be done to have this benefit when using a copy-on-write file system.
They let you see every change to a file over it's life span, but offer no protection against a hard drive that fails. These projects are therefore complimentary to the backups described above, which offer snapshots or synchronization that can be stored on other hard drives or even other locations on a network. Versioning tools such as Subversion could also be useful while we wait for versioning file systems to become mature and fully supported.
Early Stage Ideas
In addition to that already discussed, there are projects still in development that you may wish to keep appraised of or even participate in.
- Ubuntu:ContinuousBackups
- Ubuntu:HomeUserBackup
- Ubuntu:MigrateAndBackup
- Ubuntu:BackupOfPackageUserData
- Ubuntu:UbuntuDownUnder/BOFs/SimpleBackupSolution
- Ubuntu:SessionBackup
Related Links
You might also want to check out these backup programs which will help you to make automated backups of your system:
- TimeVault.
- FlyBack.
- Back In Time.
- Amanda.
- Mondo Rescue.
- rsnapshot.
- Bacula.
- storeBackup -- it has unique features.
Other wiki discussing various Linux backup techniques:
See the full discussion in these threads on the Ubuntu forums:
- http://ubuntuforums.org/showthread.php?t=868244
- http://www.ubuntuforums.org/showthread.php?t=70566
- http://www.ubuntuforums.org/showthread.php?t=35087 Howto: Backup and restore your system! (very long thread; but all the good bits have (hopefully) already been summarized on this page.)
- http://ubuntuforums.org/showthread.php?t=295
"Backup and Restore Your Ubuntu System using Sbackup" has nice step-by-step instructions (with screenshots) of using sbackup. A personal blog listing many open source backup solutions: List of Free Open Source Linux and Ubuntu Backup Software