Ubuntu14.04 how to back up and restore your system

Source: Internet
Author: User

This article is compiled by the captain of the Devil.
Install wellUbuntuAfter that, don't forget to installFor LinuxFirewalls and anti-virus software.
Before backing up the system, make sure the system is clean and error-free:
My operating system isubuntu14.04, do not know whether the system has a problem or install the software has a problem, each boot appears:System Program Problem detectedMy initial feeling is that the graphics driver is a problem.
Look very upset, Close method:
Administrator Privileges Open/etc/default/apport
# Set this to 0 to disable Apport, or to 1 to enable it
# can temporarily override this with
# sudo service apport start force_start=1
Enabled=1
Put the original1Change into0You can do it.

CleanUbuntu14.04The system of Garbage:
First empty the Recycle Bin, software upgrade to the latest.
UbuntuSystem andWindowsThe system uses a different file system,UbuntuThe system does not generate file fragments and junk files during the use or update process, so use theUbuntuThe system does not have to consider cleaning up the system's file garbage and defragmenting the files.
If you really want to clean it up,UbuntuSystem, then please refer to the following methods to do it:
1By"Ctrl+alt+t"To bring up the terminal.
2, enter the following command in the terminal (Copy to terminal window)--Press ENTER--Enter your account password--Press ENTER.
sudo apt-get autoclean(Clean up old version of software cache)
sudo apt-get clean(Clean up all software caches)
sudo apt-get autoremove(remove orphaned software that is no longer used by the system)

In the backupWindowsSystem when you might have thought that I could put the wholeCThe plates are placed in aZIPFile. This inWindowsThe next is impossible, because inWindowsThere are many files that are not allowed to be copied or overwritten when they are run, so you need a dedicated backup tool toWindowsSystem for special processing.
and backupWindowsSystem is different if you want to back upUbuntuSystem(or any otherLinuxSystem), you no longer need to be likeGhostThis type of backup tool. In factGhostThis type of backup tool is forLinuxFile system support is bad, such as someGhostVersion can only be fully supported byExt2File system, if you use it to back upExt3AndEXT4File system, you may lose some valuable data.

1.Backup system
How do I back up myUbuntuWhat about the system? It's simple, just like you're backing up or compressing something else, usingTAR。 AndWindowsDifferentLinuxdoes not limitRootAccess anything and you can put everything on the partition into aTARIn the file!
Backup first step: Open a terminal and runsudo su(Enter password after carriage return)
Step two: Continue to enter in the terminalCD/(Notice there's a space in the middle.)
Step three: (Start backup system)
In the terminal, enter:
# tar Cvpzf ubuntu.tgz–exclude=/proc–exclude=/lost+found–exclude=/ubuntu.tgz–exclude=/mnt–exclude=/sys/
Let's take a brief look at this command:
' tar 'is the program used to back up
C-Create a new backup document
V-Verbose mode,TarThe program will output all the information in real time on the screen.
P-Save the license and apply it to all files.
Z-Using' gzip 'Compress the backup file to reduce the size of the backup file.
F-Describes the path where the backup file is stored,ubuntu.tgzIs the backup file name in this example.
"/"Is the directory we want to back up, here is the entire file system.
In the file file name"Ubuntu.gz"and the name of the directory to be backed up"/"The directories that must be excluded from the backup are given. Some directories are useless, such as"/proc"、"/lost+ found"、"/sys"。 Of course"Ubuntu.gz"The file itself must be excluded, otherwise you may get some out of the ordinary results. If you do not put"/mnt"Row In addition to the outside, it is mounted on"/mnt"The other partitions on the backup will also be backed up. Also need to confirm"/media"It's not mounted on anything.(such as CD-ROM, removable hard disk), if there is something mounted, Must put"/media"Also excluded.
Someone might suggest you put"/dev"The catalogue is excluded, but I think it is inappropriate to do so, and the specific reason is not discussed here.
Before you execute the backup command, confirm that the command you typed is what you want. The backup command may take a short time to execute.
After the backup is complete, the root directory of the file system will generate a name of"Ubuntu.tgz"The size of the file, it may be very large. Now you can burn it toDVDOr put it where you think it's safe.
You can also useBzip2To compress the file,Bzip2ThangzipThe compression rate is high, but the speed is slower. If the compression rate is important to you, then you should useBzip2Use"J"In place of the command"Z", and give the file a correct extension"bz2"。 The complete command is as follows:
# tar Cvpjf ubuntu.tar.bz2–exclude=/proc–exclude=/lost+found–exclude=/ubuntu.tar.bz2–exclude=/mnt–exclude=/ SYS/

2.Recovery system
Switch toRootUser, and put the file"Ubuntu.tgz"Copy to the root directory of the partition.
InLinuxOne of the wonderful things about it is that you can restore the system in a running system without needingBOOT-CDTo specifically guide. Of course, if your system has been hung off and cannot be started, you can useLive CDTo start, the effect is the same.
Use the following command to restore the system:
# tar Xvpfz ubuntu.tgz-c/
If your profile is in useBzip2Compressed, should be used:
# tar XVPFJ ubuntu.tar.bz2-c/
Note: The above command overwrites all files on the partition with the files in the archive file.
Parametersxis to telltar program unzip the backup file.  -C  parameter is specified tar the directory to which the program was extracted. in this case /  ), which can take a while. Just make sure to recreate your excluded directories before you do anything else:   (/proc,/lost +found,/mnt,/sys,  and so on.
# Mkdir/proc/lost+found/mnt/sys
or this:
# mkdir proc
# mkdir lost+ Found
# mkdir mnt
# mkdir sys
before you perform a restore command, confirm that the command you typed is what you want, and it may take a short time to execute the restore command. Comprehend by analogy, proficient in the above operation, the user and some of the upgrade files for regular backup, you can save a lot of time and improve security.

Ubuntu14.04 how to back up and restore the system

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.