当前位置:网站首页>The backup and recovery of XFS file system under centos7: full backup, incremental backup and differential backup

The backup and recovery of XFS file system under centos7: full backup, incremental backup and differential backup

2020-11-10 11:31:11 Philosophy of life

One . About xfs file system

​ XfS The file system is SGI Developed advanced log file system ,XFS Very scalable , Very robust .centos7 choice xfs Format as the default file system , And it's no longer used before

Of ext, Still supported ext4,xfs For big data , Each single file system can support up to 8eb, A single file can support 16tb, It's not just a lot of data , And extensibility

high .

​ XfS The file system can be accessed through xfsdump,xfsrestore To backup and restore files .xfsdump Press inode Back up one... In sequence XFS file system . With the traditional UNIX

File systems are different ,XFS Do not need to be uninstalled before backup ; For the in use XFS File system backup can ensure the consistency of image .XFS The process of backup and recovery can be

Interrupted and then continued , No need to freeze file system .xfsdump Even provides high-performance multithreaded backup operations ( It takes one dump Split into multiple data streams , Each data stream can be

To be sent to different destinations ).

Two .xfsdump Backup levels and considerations for

1. First of all, introduce the definition of various file backup :

  • Full backup : Copy the specified backup directory completely every time , No matter whether the files in the directory are changed or not ;
  • Incremental backup : Every time before ( for the first time 、 The second time 、 Until the last time ) After the backup, the changed files are backed up ;
  • Differential backup : Every time the files that have changed since the first full backup are backed up .

2.xfsdump As a file backup tool , There are two levels of backup ( Backup levels are represented by numbers ), The default is 0( Full backup )

  • 0 Level stands for full backup
  • 1 To 9 Level represents incremental backup

3.xfsdump The limitation of

  • ​ xfsdump Does not support unmounted file system backup , So you can only back up the mounted ;
  • ​ xfsdump You have to use root Permission to operate ( Relationships involving file systems );
  • ​ xfsdump Backup only XFS file system ;
  • ​ xfsdump Backed up data ( Archives or storage media ) Only by xfsrestore analysis ;
  • ​ xfsdump Through the file system UUID To distinguish between backup documents , Therefore, two cannot be backed up with the same UUID File system .

3、 ... and . Full backup of the entire directory / Partition , Then recover the data

1. First of all, environmental preparation is needed , Add a hard disk , Then partition the hard disk , format partition , Mount the partition . If you don't know the above steps , Please check out 14 Chapter disk partitioning tool .

2. Prepare the files that need to be backed up

[root@node5 ~]# df -hT
Filesystem              Type      Size  Used Avail Use% Mounted on
/dev/mapper/centos-root xfs        17G   11G  6.1G  65% /
devtmpfs                devtmpfs  3.9G     0  3.9G   0% /dev
tmpfs                   tmpfs     3.9G  8.0K  3.9G   1% /dev/shm
tmpfs                   tmpfs     3.9G  8.8M  3.9G   1% /run
tmpfs                   tmpfs     3.9G     0  3.9G   0% /sys/fs/cgroup
/dev/sda1               xfs      1014M  125M  890M  13% /boot
tmpfs                   tmpfs     785M     0  785M   0% /run/user/0
/dev/sdb1               xfs        47M  2.7M   45M   6% /sdb1
/dev/sdb5               ext4      190M  1.6M  175M   1% /sdb5
/dev/sdb6               xfs       295M   16M  280M   6% /sdb6

# We can see that /dev/sdb6 The partition is already mounted , And the file system is xfs file system , We are /sdb6 Create files in directory , And make a backup , Then recover the data 
[root@node5 ~]# cd /sdb6
[root@node5 sdb6]# cp /etc/shadow ./
[root@node5 sdb6]# mkdir -p a/b/c
[root@node5 sdb6]# touch a/test.txt
[root@node5 sdb6]# touch a/b/c/test2.txt

# Use tree Commands can be viewed visually /sdb6 Directory structure 
[root@node5 sdb6]# tree /sdb6
/sdb6
├── a
│   ├── b
│   │   └── c
│   │       └── test2.txt
│   └── test.txt
└── shadow

3 directories, 3 files

3. Back up the entire partition , The command format is :xfsdump -f Backup storage location To back up a path or device file , Be careful : The backup path cannot be written here /sdb6/. It can be /dev/sdb6 or /sdb6

[root@node5 sdb6]# xfsdump -f /opt/xfsdump_sdb6 /dev/sdb6
xfsdump: using file dump (drive_simple) strategy
xfsdump: version 3.1.7 (dump format 3.0) - type ^C for status and control

 ============================= dump label dialog ==============================

please enter label for this dump session (timeout in 300 sec)
 -> xfsdump_sdb6                     # Specify the backup session label 
session label entered: "xfsdump_sdb6"

 --------------------------------- end dialog ---------------------------------

xfsdump: level 0 dump of node5:/sdb6
xfsdump: dump date: Fri Oct  9 16:40:43 2020
xfsdump: session id: 25353460-0aac-41c4-9f8e-525ca1ec99d1
xfsdump: session label: "xfsdump_sdb6"
xfsdump: ino map phase 1: constructing initial dump list
xfsdump: ino map phase 2: skipping (no pruning necessary)
xfsdump: ino map phase 3: skipping (only one dump stream)
xfsdump: ino map construction complete
xfsdump: estimated dump size: 26816 bytes

 ============================= media label dialog =============================

please enter label for media in drive 0 (timeout in 300 sec)
 -> sdb6                           # Specify the device label , It is a description of the device to be backed up 
media label entered: "sdb6"

 --------------------------------- end dialog ---------------------------------

xfsdump: creating dump session media file 0 (media 0, file 0)
xfsdump: dumping ino map
xfsdump: dumping directories
xfsdump: dumping non-directory files
xfsdump: ending media file
xfsdump: media file size 23944 bytes
xfsdump: dump size (non-dir files) : 1056 bytes
xfsdump: dump complete: 38 seconds elapsed
xfsdump: Dump Summary:
xfsdump:   stream 0 /opt/xfsdump_sdb6 OK (success)
xfsdump: Dump Status: SUCCESS

# Now the whole /sdb6  Directory backup successful 
[root@node5 sdb6]# ls /opt/ -l
total 24
drwxr-xr-x 10 root root   174 May  7  2019 apache-tomcat-8.0.51
drwxr-xr-x 11 root root   151 Apr 22 16:38 nginx
-rw-r--r--  1 root root 23944 Oct  9 16:41 xfsdump_sdb6


# Note that the above way to use interactive backup directory , But if you need a scheduled backup , You need to use interactive backup mode .
# The following is about backup /sdb6 Interactive backup free command for directory 
[root@node5 sdb6]# xfsdump -f /opt/xfsdump_sdb6 /dev/sdb6 -L xfsdump_sdb6 -M sdb6
-L:xfsdump Record every backup  session  header , Here you can fill in a brief description of this file system 
-M:xfsdump Can record the header of storage media , Here you can fill in a brief description of this media 

4. View backup information and content , After the backup is successful , We can do that /var/lib/xfsdump/inventory Directory to see the generated file information

[root@node5 sdb6]# ls /var/lib/xfsdump/inventory/ -l
total 28
-rw-r--r-- 1 root root 5080 Mar 19  2020 0a395bbd-7471-4f81-b6d8-88de226f5380.StObj
-rw-r--r-- 1 root root  312 Oct  9 16:48 457d31a7-28d8-424d-87fe-cca3fe9b907c.InvIndex
-rw-r--r-- 1 root root 5760 Oct  9 16:48 4800a3be-1de7-4017-992f-1360553ccb05.StObj
-rw-r--r-- 1 root root  312 Mar 19  2020 94396e17-4821-4957-aa76-d41f33958ff5.InvIndex
-rw-r--r-- 1 root root 1120 Oct  9 16:41 fstab

[root@node5 sdb6]# xfsdump -I
file system 1:
	fs id:		457d31a7-28d8-424d-87fe-cca3fe9b907c
	session 0:
		mount point:	node5:/sdb6
		device:		node5:/dev/sdb6
		time:		Fri Oct  9 16:40:43 2020
		session label:	"xfsdump_sdb6"
		session id:	25353460-0aac-41c4-9f8e-525ca1ec99d1
		level:		0
		resumed:	NO
		subtree:	NO
		streams:	1
		stream 0:
			pathname:	/opt/xfsdump_sdb6
			start:		ino 67 offset 0
			end:		ino 531202 offset 0
			interrupted:	NO
			media files:	1
			media file 0:
				mfile index:	0
				mfile type:	data
				mfile size:	23944
				mfile start:	ino 67 offset 0
				mfile end:	ino 531202 offset 0
				media label:	"sdb6"
				media id:	a2e68e3c-32e4-4bef-8af7-0b3162891184
xfsdump: Dump Status: SUCCESS

5. Delete /sdb6 Directory files and recover data

# First of all to delete /sdb6 All the data in the catalog 
[root@node5 sdb6]# pwd
/sdb6
[root@node5 sdb6]# ls
a  shadow
[root@node5 sdb6]# 
[root@node5 sdb6]# rm -rf ./*
[root@node5 sdb6]# ls

# Now all the data is deleted , Start restoring data 
# The command to recover data is :xfsrestore -f  Specify the location of the recovery file   Specify the path to store the recovered files 
[root@node5 sdb6]# xfsrestore -f /opt/xfsdump_sdb6 /sdb6
xfsrestore: using file dump (drive_simple) strategy
xfsrestore: version 3.1.7 (dump format 3.0) - type ^C for status and control
xfsrestore: searching media for dump
xfsrestore: examining media file 0
xfsrestore: dump description: 
xfsrestore: hostname: node5
xfsrestore: mount point: /sdb6
xfsrestore: volume: /dev/sdb6
xfsrestore: session time: Fri Oct  9 16:40:43 2020
xfsrestore: level: 0
xfsrestore: session label: "xfsdump_sdb6"
xfsrestore: media label: "sdb6"
xfsrestore: file system id: 457d31a7-28d8-424d-87fe-cca3fe9b907c
xfsrestore: session id: 25353460-0aac-41c4-9f8e-525ca1ec99d1
xfsrestore: media id: a2e68e3c-32e4-4bef-8af7-0b3162891184
xfsrestore: using online session inventory
xfsrestore: searching media for directory dump
xfsrestore: reading directories
xfsrestore: 4 directories and 6 entries processed
xfsrestore: directory post-processing
xfsrestore: restoring non-directory files
xfsrestore: restore complete: 0 seconds elapsed
xfsrestore: Restore Summary:
xfsrestore:   stream 0 /opt/xfsdump_sdb6 OK (success)
xfsrestore: Restore Status: SUCCESS

[root@node5 sdb6]# pwd
/sdb6
[root@node5 sdb6]# ls
a  shadow

[root@node5 sdb6]# tree /sdb6
/sdb6
├── a
│   ├── b
│   │   └── c
│   │       └── test2.txt
│   └── test.txt
└── shadow

3 directories, 3 files

# You can see that the data is restored as before 

Four . Full backup of a directory in the partition , And then restore a file / Folder

1. Backup only /sdb6 In the catalog shadow file

# Or this test directory , But only backup shadow file 
[root@node5 ~]# cd /sdb6
[root@node5 sdb6]# cp /etc/shadow ./
[root@node5 sdb6]# mkdir -p a/b/c
[root@node5 sdb6]# 
[root@node5 sdb6]# touch a/test.txt
[root@node5 sdb6]# touch a/b/c/test2.txt
[root@node5 sdb6]# 
[root@node5 sdb6]# tree /sdb6
/sdb6
├── a
│   ├── b
│   │   └── c
│   │       └── test2.txt
│   └── test.txt
└── shadow

3 directories, 3 files

# Parameters :-s  File path    Backup only the specified files ,-s When specified , Paths are relative paths (-s It can be a file or a directory )
[root@node5 sdb6]# xfsdump -f /opt/xfsdump_shadow -s shadow /sdb6 -L xfsdump_shadow -M sdb6_shadow
xfsdump: using file dump (drive_simple) strategy
xfsdump: version 3.1.7 (dump format 3.0) - type ^C for status and control
xfsdump: level 0 dump of node5:/sdb6
xfsdump: dump date: Fri Oct  9 16:48:08 2020
xfsdump: session id: 8dfa7afd-4d05-48ca-8c77-24fca922acab
xfsdump: session label: "xfsdump_shadow"
xfsdump: ino map phase 1: constructing initial dump list
xfsdump: ino map phase 2: skipping (no pruning necessary)
xfsdump: ino map phase 3: skipping (only one dump stream)
xfsdump: ino map construction complete
xfsdump: estimated dump size: 25216 bytes
xfsdump: creating dump session media file 0 (media 0, file 0)
xfsdump: dumping ino map
xfsdump: dumping directories
xfsdump: dumping non-directory files
xfsdump: ending media file
xfsdump: media file size 22416 bytes
xfsdump: dump size (non-dir files) : 1056 bytes
xfsdump: dump complete: 0 seconds elapsed
xfsdump: Dump Summary:
xfsdump:   stream 0 /opt/xfsdump_shadow OK (success)
xfsdump: Dump Status: SUCCESS
[root@node5 sdb6]# 
[root@node5 sdb6]# ls /opt/
apache-tomcat-8.0.51  nginx  xfsdump_sdb6  xfsdump_shadow

# View backup information and content 
[root@node5 sdb6]# xfsdump -I
file system 1:
	fs id:		457d31a7-28d8-424d-87fe-cca3fe9b907c
	session 1:
		mount point:	node5:/sdb6
		device:		node5:/dev/sdb6
		time:		Fri Oct  9 16:48:08 2020
		session label:	"xfsdump_shadow"
		session id:	8dfa7afd-4d05-48ca-8c77-24fca922acab
		level:		0
		resumed:	NO
		subtree:	YES
		streams:	1
		stream 0:
			pathname:	/opt/xfsdump_shadow
			start:		ino 67 offset 0
			end:		ino 68 offset 0
			interrupted:	NO
			media files:	1
			media file 0:
				mfile index:	0
				mfile type:	data
				mfile size:	22416
				mfile start:	ino 67 offset 0
				mfile end:	ino 68 offset 0
				media label:	"sdb6_shadow"
				media id:	067e94a9-6b90-483d-b531-ebe6c1b49fd5
xfsdump: Dump Status: SUCCESS

2. Delete data , Then restore the specified file

# Delete data 
[root@node5 sdb6]# pwd
/sdb6
[root@node5 sdb6]# ls
a  shadow
[root@node5 sdb6]# rm -rf ./*
[root@node5 sdb6]# ls

# grammar :xfsrestore -f  Specify the location of the recovery file   Specify the path to store the recovered files 
#-s Specify a single file or directory to restore 
[root@node5 sdb6]# xfsrestore -f /opt/xfsdump_shadow -s shadow /sdb6
xfsrestore: using file dump (drive_simple) strategy
xfsrestore: version 3.1.7 (dump format 3.0) - type ^C for status and control
xfsrestore: searching media for dump
xfsrestore: examining media file 0
xfsrestore: dump description: 
xfsrestore: hostname: node5
xfsrestore: mount point: /sdb6
xfsrestore: volume: /dev/sdb6
xfsrestore: session time: Fri Oct  9 16:48:08 2020
xfsrestore: level: 0
xfsrestore: session label: "xfsdump_shadow"
xfsrestore: media label: "sdb6_shadow"
xfsrestore: file system id: 457d31a7-28d8-424d-87fe-cca3fe9b907c
xfsrestore: session id: 8dfa7afd-4d05-48ca-8c77-24fca922acab
xfsrestore: media id: 067e94a9-6b90-483d-b531-ebe6c1b49fd5
xfsrestore: using online session inventory
xfsrestore: searching media for directory dump
xfsrestore: reading directories
xfsrestore: 1 directories and 2 entries processed
xfsrestore: directory post-processing
xfsrestore: restoring non-directory files
xfsrestore: restore complete: 0 seconds elapsed
xfsrestore: Restore Summary:
xfsrestore:   stream 0 /opt/xfsdump_shadow OK (success)
xfsrestore: Restore Status: SUCCESS

# View directory , Only the specified file was recovered 
[root@node5 sdb6]# pwd
/sdb6
[root@node5 sdb6]# ls
shadow

5、 ... and . Incremental backup

1. Incremental backup refers to after a full backup or the last incremental backup , In the future, each backup only needs to back up the files added or modified compared with the previous one . That means , First of all

The objects of the second incremental backup are the files added and modified after full backup ; The object of the second incremental backup is the text added and modified after the first incremental backup

Pieces of , And so on .

  • advantage : No duplicate backup data , So the amount of data backed up is not large , The backup time is very short .
  • shortcoming : Data recovery is relatively troublesome , It requires the contents of the last full backup and all incremental backups to be able to recover successfully , And they have to be restored one by one in a chronological order from full to incremental , So it may extend the recovery time

2. Prepare test files , Make the first full backup

[root@node5 sdb6]# pwd
/sdb6
[root@node5 sdb6]# ls
grub  profile.d  shadow
[root@node5 sdb6]# 
[root@node5 sdb6]# tree ./
./
├── grub
│   └── splash.xpm.gz
├── profile.d
│   ├── 256term.csh
│   ├── 256term.sh
│   ├── colorgrep.csh
│   ├── colorgrep.sh
│   ├── colorls.csh
│   ├── colorls.sh
│   ├── jdk8.sh
│   ├── lang.csh
│   ├── lang.sh
│   ├── less.csh
│   ├── less.sh
│   ├── vim.csh
│   ├── vim.sh
│   ├── which2.csh
│   └── which2.sh
└── shadow

2 directories, 17 files
[root@node5 sdb6]# xfsdump -f /opt/sdb6_fulldump /sdb6 -L fulldump -M sdb6
xfsdump: using file dump (drive_simple) strategy
xfsdump: version 3.1.7 (dump format 3.0) - type ^C for status and control
xfsdump: level 0 dump of node5:/sdb6
xfsdump: dump date: Sat Oct 10 01:02:56 2020
xfsdump: session id: b28b76f0-752c-423b-82d2-83d999e0d477
xfsdump: session label: "fulldump"
xfsdump: ino map phase 1: constructing initial dump list
xfsdump: ino map phase 2: skipping (no pruning necessary)
xfsdump: ino map phase 3: skipping (only one dump stream)
xfsdump: ino map construction complete
xfsdump: estimated dump size: 96512 bytes
xfsdump: creating dump session media file 0 (media 0, file 0)
xfsdump: dumping ino map
xfsdump: dumping directories
xfsdump: dumping non-directory files
xfsdump: ending media file
xfsdump: media file size 46048 bytes
xfsdump: dump size (non-dir files) : 18976 bytes
xfsdump: dump complete: 0 seconds elapsed
xfsdump: Dump Summary:
xfsdump:   stream 0 /opt/sdb6_fulldump OK (success)
xfsdump: Dump Status: SUCCESS
[root@node5 sdb6]# 
[root@node5 sdb6]# 
[root@node5 sdb6]# ls /opt/sdb6_fulldump -l
-rw-r--r-- 1 root root 46048 Oct 10 01:02 /opt/sdb6_fulldump

3. add to the content , Make the first incremental backup

[root@node5 sdb6]# pwd
/sdb6
[root@node5 sdb6]# ls
grub  profile.d  shadow

[root@node5 sdb6]# cp /etc/profile ./
[root@node5 sdb6]# ls
grub  profile  profile.d  shadow

#-l <level>   Make a grade of 1 Incremental backup of 
[root@node5 sdb6]# xfsdump -l 1 -f /opt/sdb6_incredump1 /sdb6 -L incredump1 -M sdb6
xfsdump: using file dump (drive_simple) strategy
xfsdump: version 3.1.7 (dump format 3.0) - type ^C for status and control
xfsdump: level 1 incremental dump of node5:/sdb6 based on level 0 dump begun Sat Oct 10 01:02:56 2020
xfsdump: dump date: Sat Oct 10 01:06:44 2020
xfsdump: session id: c8e103f5-916a-41d4-8c5a-05522527c40f
xfsdump: session label: "incredump1"
xfsdump: ino map phase 1: constructing initial dump list
xfsdump: ino map phase 2: pruning unneeded subtrees
xfsdump: ino map phase 3: skipping (only one dump stream)
xfsdump: ino map construction complete
xfsdump: estimated dump size: 25216 bytes
xfsdump: creating dump session media file 0 (media 0, file 0)
xfsdump: dumping ino map
xfsdump: dumping directories
xfsdump: dumping non-directory files
xfsdump: ending media file
xfsdump: media file size 23504 bytes
xfsdump: dump size (non-dir files) : 2080 bytes
xfsdump: dump complete: 0 seconds elapsed
xfsdump: Dump Summary:
xfsdump:   stream 0 /opt/sdb6_incredump1 OK (success)
xfsdump: Dump Status: SUCCESS

4. Keep adding data , Make a second incremental backup

[root@node5 sdb6]# pwd
/sdb6
[root@node5 sdb6]# ls
grub  profile  profile.d  shadow

[root@node5 sdb6]# mkdir -p a/b/c/d/e/f
[root@node5 sdb6]# touch a/b/c/test.txt

# Conduct level 2 Level incremental backup 
[root@node5 sdb6]# xfsdump -l 2 -f /opt/sdb6_incredump2 /sdb6 -L incredump2 -M sdb6
xfsdump: using file dump (drive_simple) strategy
xfsdump: version 3.1.7 (dump format 3.0) - type ^C for status and control
xfsdump: level 2 incremental dump of node5:/sdb6 based on level 1 dump begun Sat Oct 10 01:06:44 2020
xfsdump: dump date: Sat Oct 10 01:09:15 2020
xfsdump: session id: 6b0720e5-8c37-4284-877f-ba3b3d29013f
xfsdump: session label: "incredump2"
xfsdump: ino map phase 1: constructing initial dump list
xfsdump: ino map phase 2: pruning unneeded subtrees
xfsdump: ino map phase 3: skipping (only one dump stream)
xfsdump: ino map construction complete
xfsdump: estimated dump size: 23040 bytes
xfsdump: creating dump session media file 0 (media 0, file 0)
xfsdump: dumping ino map
xfsdump: dumping directories
xfsdump: dumping non-directory files
xfsdump: ending media file
xfsdump: media file size 23280 bytes
xfsdump: dump size (non-dir files) : 0 bytes
xfsdump: dump complete: 0 seconds elapsed
xfsdump: Dump Summary:
xfsdump:   stream 0 /opt/sdb6_incredump2 OK (success)
xfsdump: Dump Status: SUCCESS

5. Delete data , And then data recovery

[root@node5 sdb6]# pwd
/sdb6
[root@node5 sdb6]# ls
a  grub  profile  profile.d  shadow
[root@node5 sdb6]# 
[root@node5 sdb6]# rm -rf ./*
[root@node5 sdb6]# ls

# How to recover data :
# Restore full backup first     
# situation 1:  Restore the last incremental backup ( If both incremental backups are 1 Class , So just restore the last increment .
# situation 2: If you do it for the first time, it's 1 Secondary equipment , The second, 2 Secondary equipment , Then you need to restore the full backup first , And then there was 1 Secondary equipment , And finally 2 Secondary equipment )

# Restore full backup first     
[root@node5 sdb6]# xfsrestore -f /opt/sdb6_fulldump /sdb6
xfsrestore: using file dump (drive_simple) strategy
xfsrestore: version 3.1.7 (dump format 3.0) - type ^C for status and control
xfsrestore: searching media for dump
xfsrestore: examining media file 0
xfsrestore: dump description: 
xfsrestore: hostname: node5
xfsrestore: mount point: /sdb6
xfsrestore: volume: /dev/sdb6
xfsrestore: session time: Sat Oct 10 01:02:56 2020
xfsrestore: level: 0
xfsrestore: session label: "fulldump"
xfsrestore: media label: "sdb6"
xfsrestore: file system id: 457d31a7-28d8-424d-87fe-cca3fe9b907c
xfsrestore: session id: b28b76f0-752c-423b-82d2-83d999e0d477
xfsrestore: media id: 782599f6-9d7b-4f94-ba01-91aa73a11d76
xfsrestore: using online session inventory
xfsrestore: searching media for directory dump
xfsrestore: reading directories
xfsrestore: 3 directories and 19 entries processed
xfsrestore: directory post-processing
xfsrestore: restoring non-directory files
xfsrestore: restore complete: 0 seconds elapsed
xfsrestore: Restore Summary:
xfsrestore:   stream 0 /opt/sdb6_fulldump OK (success)
xfsrestore: Restore Status: SUCCESS

[root@node5 sdb6]# ls
grub  profile.d  shadow

# Then restore the level one incremental backup 
[root@node5 sdb6]# xfsrestore -f /opt/sdb6_incredump1 /sdb6
xfsrestore: using file dump (drive_simple) strategy
xfsrestore: version 3.1.7 (dump format 3.0) - type ^C for status and control
xfsrestore: searching media for dump
xfsrestore: examining media file 0
xfsrestore: dump description: 
xfsrestore: hostname: node5
xfsrestore: mount point: /sdb6
xfsrestore: volume: /dev/sdb6
xfsrestore: session time: Sat Oct 10 01:06:44 2020
xfsrestore: level: 1
xfsrestore: session label: "incredump1"
xfsrestore: media label: "sdb6"
xfsrestore: file system id: 457d31a7-28d8-424d-87fe-cca3fe9b907c
xfsrestore: session id: c8e103f5-916a-41d4-8c5a-05522527c40f
xfsrestore: media id: 4434fdb4-513c-43aa-b31d-35560f818b5c
xfsrestore: using online session inventory
xfsrestore: searching media for directory dump
xfsrestore: reading directories
xfsrestore: 1 directories and 4 entries processed
xfsrestore: directory post-processing
xfsrestore: restoring non-directory files
xfsrestore: restore complete: 0 seconds elapsed
xfsrestore: Restore Summary:
xfsrestore:   stream 0 /opt/sdb6_incredump1 OK (success)
xfsrestore: Restore Status: SUCCESS

[root@node5 sdb6]# ls
grub  profile  profile.d  shadow

# Finally, restore the secondary incremental backup 
[root@node5 sdb6]# xfsrestore -f /opt/sdb6_incredump2 /sdb6
xfsrestore: using file dump (drive_simple) strategy
xfsrestore: version 3.1.7 (dump format 3.0) - type ^C for status and control
xfsrestore: searching media for dump
xfsrestore: examining media file 0
xfsrestore: dump description: 
xfsrestore: hostname: node5
xfsrestore: mount point: /sdb6
xfsrestore: volume: /dev/sdb6
xfsrestore: session time: Sat Oct 10 01:09:15 2020
xfsrestore: level: 2
xfsrestore: session label: "incredump2"
xfsrestore: media label: "sdb6"
xfsrestore: file system id: 457d31a7-28d8-424d-87fe-cca3fe9b907c
xfsrestore: session id: 6b0720e5-8c37-4284-877f-ba3b3d29013f
xfsrestore: media id: 9012fd55-692a-44fa-9d60-83d478555852
xfsrestore: using online session inventory
xfsrestore: searching media for directory dump
xfsrestore: reading directories
xfsrestore: 7 directories and 11 entries processed
xfsrestore: directory post-processing
xfsrestore: restoring non-directory files
xfsrestore: restore complete: 0 seconds elapsed
xfsrestore: Restore Summary:
xfsrestore:   stream 0 /opt/sdb6_incredump2 OK (success)
xfsrestore: Restore Status: SUCCESS
[root@node5 sdb6]# ls
a  grub  profile  profile.d  shadow

You can see that the data is restored in turn .

版权声明
本文为[Philosophy of life]所创,转载请带上原文链接,感谢