"One of Linux backup and restore" 3.19 dump (file system backup)

Source: Internet
Author: User

"Linux instructions from beginner to proficient" in the 3rd chapter of document management, this chapter introduces many common commands, such as CP, LN, chmod, Chown, diff, Tar, MV, etc., because these are related to file management, used in daily use, so this chapter is the key chapter of this book. This section introduces you to dump (file system backup).

AD:

3.19 Dump (file system backup)

(1) Frequency level: ☆

(2) Function Description:

Dump is a backup utility that backs up a directory or entire file system to a specified device, or back up to a large file.

(3) Syntax:

    1. Dump[-cnu][-0123456789][-b < chunk size >][-b
      < number of blocks >][-d < density >][-f < device name >][-h < layer
    2. Level >][-s < tape length >][-t < date >][directory or file system]
    3. Dump [-WW]

(4) Owning package:

    1. Dump # yum-y Install dump

(5) Tips for use:

Specify the backup file name or target device file to be generated, using the parameter "-F".

The first time you back up a file, the backup level is 0, and incremental backups are used later to reduce backup time and save space.

(6) Related commands:

    1. Restore //Recovery

(7) Parameters:

The dump main parameters are shown in table 3-21.

Table 3-21 dump Parameter table

(8) Typical example:

Example 1: Use the dump command to back up the specified directory.

For example, using the "-F" parameter to back up the specified "/etc" directory, use the following command:

    1. Dump-f etc.bak/etc/#备份 All files in the/etc/directory

The following information is output:

    1. [Email protected]:~$ dump-f etc.bak/etc/#备份 All files under the/etc/directory
  1. Dump:date of this level Dump:sun SEP 14:47:35 #备份输出信息
  2. DUMP:Label:none
  3. Dump:writing Kilobyte Records
  4. Dump:mapping (Pass I) [Regular files]
  5. Dump:mapping (Pass II) [directories]
  6. dump:estimated 14472 blocks.
  7. Dump:volume 1 started with block 1 At:sun Sep 20 14:47:36 2009
  8. Dump:dumping (Pass III) [directories]
  9. Dump:dumping (Pass IV) [Regular files]
  10. Dump:closing Etc.bak
  11. Dump:volume 1 completed At:sun Sep 20 14:47:38 2009
  12. Dump:volume 1 14870 blocks (14.52MB)
  13. Dump:volume 1 took 0:00:02
  14. Dump:volume 1 Transfer rate:7435 kb/s
  15. dump:14870 blocks (14.52MB) on 1 volume (s)
  16. Dump:finished in 2 seconds, throughput 7435 kbytes/sec
  17. Dump:date of this level Dump:sun SEP 20 14:47:35 2009
  18. Dump:date This dump Completed:sun Sep 20 14:47:38 2009
  19. Dump:average Transfer rate:7435 kb/s
  20. Dump:dump is done

    eg

    [Email protected] ~]# du-sh/etc
    37M /etc

  21. [Email protected] ~]# ll-h Etc.bak
    -rw-r--r--. 1 root root 44M Jul 1 05:22 etc.bak

Using the file command to view the information of the files, you can get the following results:

    1. [Email protected]:~$ file Etc.bak #查看备份文件信息
    2. Etc.bak:new-fs dump file (little endian), this
      Dump Sun Sep 14:47:35, Previous
    3. Dump Thu Jan 1 08:00:00 1970, Volume 1, level
      Zero, Type:tape header, Label none, Filesystem
    4. /(dir etc), device/dev/sda1, Host hdd-desktop,
      Flags 3 #备份文件的详细信息

Example 2: Use the dump command to back up the entire root file system. Use this command to back up the entire root file system to a specified peripheral, using the following command:

    1. dump-0f/dev/nst0/ #将整个根文件系统备份到SCSI equipment/dev/nst0

This command backs up the entire root file system to the peripheral "/dev/nst0".

--------------------------------------------------------------------------------------------------------------- ----------------------------

Full Backup tool: Dump,restore

Dump: You can also set a hierarchy in addition to backing up the entire file system.   Dump supports the entire file system or a single directory, but there is insufficient support for the directory.  When the data to be backed up is a single file system: You can use the full dump feature, including the ability to back up with several level 0~9. When the data to be backed up is only a directory, not a single file system:all backup data must be under this directory;and only with level 0, which supports only full backups;The- u parameter is not supported, that is, you cannot create a time log file/etc/dumpdates this level backup. #dump [-SUVJ] [-level] [-f backup file] data to be backed up #dump-w-S: List only the amount of disk space that is required to back up the data to be backed up you can: Log the dump time to the/etc/dumpdates file-V: the Du MP file process is displayed-j: Join BZIP2 Support, the data compression, the default bzip2 compression level of 2-level: compression level, -0~-9 10 levels-F: a bit similar to tar, followed by the resulting file, can be connected such as/dev/st0 device file name, etc.-W: Lists whether the partition with the dump setting in/etc/fstab has been backed up for example: #df-H #dump-S/dev/sda1 #dump -0u-f/root/boot.dump/boot #ll/root/b Oot.dump/etc/dumpdates #cat/etc/dumpdates See if there is a dump file system #dump-W with dump backup non-file system, that is, a single directory method-u,level 1~9 is not Backup with/etc entire Directory via dump with compression #dump -0j-f/root/etc.dump.bz2/etc restore: Restore Dump backup #restore-t [-F DumpFile] [-h]==> used to view dump files#restore-C [-F dumpfile] [-D mount Point]==> comparing dump with actual file#restore-I [-f dumpfile]==> into interactive mode#restore-R [-F DumpFile]==> Restoring the entire file systemVarious modes cannot be mixed, such as non-writable-TC.  -T: This mode uses the important data contained in the backup file to view the dump. Similar to the TAR-T function.   C: This mode can be used to compare the data in the dump with the actual file system, and will eventually list the file "recorded in the dump file,       and the file system is not the same".  -I: Into interactive mode, you can restore only a subset of the files used in the dump directory.  -R: A mode of restoring the entire file system, used to restore dump backups against files.   H: View information such as Inode and file system label in the full backup data.  -F: The dump file you want to handle is followed.  -D: With-C, you can find the following mount point and dump have different files.   Example:  1. Use Restore to view the contents of the backup data after dump     display the contents of the Boot.dump file to see     #restore-T-f/root/ boot.dump  2. Compare differences and restore the entire file system     dump can query the difference between the file system and the backup file, and back up the analyzed differential data.     #cd/boot     #mv config-2.6.18-128.el5 config-2.6.18-128.e15-back    #restore-C -f/root/boot.dump     (by backing up data to find data that is different from the current actual file system)      because dump is recording the entire file system, So you should also give a new file system when you restore.     #fdisk/dev/sda    ....    #partprobe     #mkfs-T ext3/dev/sda8    #mount/dev/sda8/mnt    #cd/mnt    #restore-R-f/root/boot.dump   Restore interactive mode for only partial files #cd/mnt#restore-i-f/root/etc.dump This is where the interactive mode comes in.Press Help will be helpfulyou can use Ls,cd,pwd and other commands .>add passwd Shadow Group ==> add unzip list>delete Group ==> added the wrong, delete group >ls passwd Shadow*passwd to be decompressed is preceded by **shadow>extract ==> to begin decompression >quit#ll-D etc#ll etcCitation: http://blog.chinaunix.net/uid-28216282-id-3366865.html

"One of Linux backup and restore" 3.19 dump (file system backup)

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.