centos7下xfs文件系统的备份和恢复:完全备份,增量备份,差异备份
一.关于xfs文件系统
XfS文件系统是SGI开发的高级日志文件系统,XFS极具伸缩性,非常健壮。centos7选择xfs格式作为默认文件系统,而且不再使用以前
的ext,仍然支持ext4,xfs专为大数据产生,每个单个文件系统最大可以支持8eb,单个文件可以支持16tb,不仅数据量大,而且扩展性
高。
XfS文件系统可以通过xfsdump,xfsrestore来进行文件的备份和恢复。xfsdump 按inode顺序备份一个XFS文件系统。与传统的UNIX
文件系统不同,XFS不需要在备份前被卸载;对使用中的XFS文件系统做备份就可以保证镜像的一致性。XFS的备份和恢复的过程是可以被
中断然后继续的,无须冻结文件系统。xfsdump 甚至提供了高性能的多线程备份操作(它把一次dump拆分成多个数据流,每个数据流可
以被发往不同的目的地)。
二.xfsdump的备份级别和注意事项
1.首先介绍一下各种文件备份的定义:
- 完全备份:每次都把指定的备份目录完整的复制一遍,不管目录下的文件有没有变化;
- 增量备份:每次将之前(第一次、第二次、直到前一次)做过备份之后有变化的文件进行备份;
- 差异备份:每次都将第一次完整备份以来有变化的文件进行备份。
2.xfsdump作为文件备份工具,备份级别有两种(备份级别使用数字表示),默认为0(即完全备份)
- 0级别代表完全备份
- 1到9级别代表增量备份
3.xfsdump的限制
- xfsdump 不支持没有挂载的文件系统备份,所以只能备份已挂载的;
- xfsdump 必须使用 root 的权限才能操作 (涉及文件系统的关系);
- xfsdump 只能备份 XFS 文件系统;
- xfsdump 备份下来的数据 (档案或储存媒体) 只能让 xfsrestore 解析;
- xfsdump 是透过文件系统的 UUID 来分辨各个备份文档的,因此不能备份两个具有相同 UUID 的文件系统。
三.完全备份整个目录/分区,然后恢复数据
1.首先需要进行环境准备,添加一块硬盘,然后对硬盘进行分区,格式化分区,对分区进行挂载。如果对于以上步骤不了解,请查看磁盘分区工具章节https://www.cnblogs.com/renshengdezheli/p/13941563.html。
2.准备需要备份的文件
[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
#我们可以看出/dev/sdb6分区已经挂载,并且文件系统是xfs文件系统,我们在/sdb6目录下创建文件,并进行备份,然后恢复数据
[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
#使用tree命令可以可视化的查看/sdb6目录结构
[root@node5 sdb6]# tree /sdb6
/sdb6
├── a
│ ├── b
│ │ └── c
│ │ └── test2.txt
│ └── test.txt
└── shadow
3 directories, 3 files
3.备份整个分区,命令格式为:xfsdump -f 备份存放位置 要备份路径或设备文件,注意:备份的路径这里不能写成/sdb6/。 可以是/dev/sdb6 或/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 #指定备份会话标签
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 #指定设备标签,就是对要备份的设备做一个描述
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
#此时整个/sdb6 目录备份成功
[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
#注意如上方式使用交互式方式备份目录,但是如果需要进行定时备份,则需要使用免交互备份方式。
#下面介绍备份/sdb6目录的免交互备份命令
[root@node5 sdb6]# xfsdump -f /opt/xfsdump_sdb6 /dev/sdb6 -L xfsdump_sdb6 -M sdb6
-L:xfsdump记录每次备份的 session 标头,这里可以填写针对此文件系统的简易说明
-M:xfsdump可以记录储存媒体的标头,这里可以填写此媒体的简易说明
4.查看备份信息和内容,备份成功后,我们就可以在/var/lib/xfsdump/inventory目录下看到生成的档案信息
[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.删除/sdb6目录的文件并恢复数据
#首先删除/sdb6目录的所有数据
[root@node5 sdb6]# pwd
/sdb6
[root@node5 sdb6]# ls
a shadow
[root@node5 sdb6]#
[root@node5 sdb6]# rm -rf ./*
[root@node5 sdb6]# ls
#现在所有数据都被删除,开始恢复数据
#恢复数据的命令为:xfsrestore -f 指定恢复文件的位置 指定存放恢复后的文件的路径
[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
#可以看到数据恢复如初
四.完全备份分区中某个目录,然后恢复某个文件/文件夹
1.只备份/sdb6目录下的shadow文件
#还是这个测试目录,但是只备份shadow文件
[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
#参数:-s 文件路径 只对指定的文件进行备份,-s指定时,路径写的是相对路径(-s可以是文件或目录)
[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
#查看备份信息与内容
[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.删除数据,然后恢复指定文件
#删除数据
[root@node5 sdb6]# pwd
/sdb6
[root@node5 sdb6]# ls
a shadow
[root@node5 sdb6]# rm -rf ./*
[root@node5 sdb6]# ls
#语法:xfsrestore -f 指定恢复文件的位置 指定存放恢复后的文件的路径
#-s指定需要恢复的单个文件或者目录
[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
#查看目录,发现只恢复了指定文件
[root@node5 sdb6]# pwd
/sdb6
[root@node5 sdb6]# ls
shadow
五.增量备份
1.增量备份是指在一次完全备份或上一次增量备份后,以后每次的备份只需备份与前一次相比增加或者被修改的文件。这就意味着,第一
次增量备份的对象是进行全备后所产生的增加和修改的文件;第二次增量备份的对象是进行第一次增量备份后所产生的增加和修改的文
件,以此类推。
- 优点:没有重复的备份数据,因此备份的数据量不大,备份所需的时间很短。
- 缺点:数据恢复相对比较麻烦,它需要上一次全备份和所有增量备份的内容才能够完全恢复成功,并且它们必须沿着从全备份到依次增量备份的时间顺序逐个反推恢复,因此可能会延长恢复时间
2.准备测试文件,进行第一次完全备份
[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.增加内容,进行第一次增量备份
[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> 做一个等级为1的增量备份
[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.继续增加数据,进行第二次增量备份
[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
#进行level 2级别的增量备份
[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.删除数据,然后进行数据恢复
[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
#恢复数据的思路:
#先恢复完全备份
#情况1: 恢复最后一次增量备份(如果两次增量备份都是1级的,所以只需要恢复最后一个增量就可以了。
#情况2:如果你做的是第一次是1级备,第二次是2级备,那么你在恢复的时候就需要先恢复完全备份,然后是1级备,最后是2级备)
#先恢复完全备份
[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
#接着恢复一级增量备份
[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
#最后恢复二级增量备份
[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
可以看到数据被依次恢复如初。
centos7下xfs文件系统的备份和恢复:完全备份,增量备份,差异备份的更多相关文章
- Centos7下Mysql通过.frm和.ibd恢复数据
通过.frm和.ibd文件恢复表结构和数据 这里以hue数据库中的desktop_document2表为例 分成两步骤,先去表结构,再取数据,最好在一个用完就可以删除的数据库中进行 取表结构篇: 1. ...
- MySQL备份和恢复[2]-基于LVM的快照备份
准备工作 请求锁定所有表 mysql> FLUSH TABLES WITH READ LOCK; 记录二进制日志文件及事件位置 mysql> FLUSH LOGS; mysql> S ...
- XFS文件系统的备份和恢复
1.工具 XFS文件系统提供了xfsdump和xfsrestore来协助备份.恢复XFS文件系统中的数据,xfsdump按inode顺序来备份XFS文件系统,备份时不需要卸载文件系统,备份和恢复的过程 ...
- 云与备份之(1):VMware虚机备份和恢复
本系列文章会介绍云与备份之间的关系,包括: (1)VMware 虚机备份和恢复 (2)KVM 虚机备份和恢复 (3)云与备份 (4)OpenStack 与备份 (5)公有云与备份 1. 与备份有关的V ...
- Sql Server数据库备份和恢复:原理篇
本文与您探讨为什么Sql Server有完整备份.差异备份和事务日志备份三种备份方式,以及为什么数据库又有简单模式.完整模式和大容量日志模式这三种恢复模式.本文内容适用于2005以上所有版本的Sql ...
- MongoDB整库备份与还原以及单个collection备份、恢复方法
mongodb数据库维护离不开必要的备份.恢复操作,而且一般不会出错,所以我们在使用的时候大部分时候使用备份和恢复操作就可以了 mongodump.exe备份的原理是通过一次查询获取当前服务器快照 ...
- Oracle基础 数据库备份和恢复
一.为什么需要数据备份 造成数据丢失的主要原因: 1.介质故障. 2.用户的错误操作. 3.服务器的彻底崩溃. 4.计算机病毒. 5.不可预料的因素. Oracle中故障类型分为以下4种. 1.语句故 ...
- SQL数据库的备份和恢复
SQL数据库的备份和恢复 一.SQL数据库的备份: 1.依次打开 开始菜单 → 程序 → Microsoft SQL Server 2008 → SQL Server Management Studi ...
- 7.1 Backup and Recovery Types 备份和恢复类型
7.1 Backup and Recovery Types 备份和恢复类型 这个章节描述 不同备份类型的特点: 物理(raw)与逻辑备份 物理备份有raw 副本组成,存储数据库内容,这种类型的备份是适 ...
- MariaDB/MySQL备份和恢复(三):xtrabackup用法和原理详述
本文目录: 1.安装xtrabackup 2.备份锁 3.xtrabackup备份原理说明 3.1 备份过程(backup阶段) 3.2 准备过程(preparing阶段) 3.3 恢复过程(copy ...
随机推荐
- C# 继承、多态性、抽象和接口详解:从入门到精通
C# 继承 在 C# 中,可以将字段和方法从一个类继承到另一个类.我们将"继承概念"分为两类: 派生类(子类) - 从另一个类继承的类 基类(父类) - 被继承的类 要从一个类继承 ...
- Python 简介和用途
什么是Python? Python是一种流行的编程语言,由Guido van Rossum创建,并于1991年发布. 它用于以下领域: 网页开发(服务器端) 软件开发 数学 系统脚本编写 Python ...
- 第一篇:Python入门基础
主要内容 1.Python简介 2.变量 3.字符编码 4.用户交互 5.if 流程判断 6.while循环 7.for循环 一.Python简介 1.python的创始人为吉多·范罗苏姆(Guido ...
- jenkins 持续集成和交付 —— 触发器(六)
前言 什么是触发器呢?当某种条件达到的时候将会触发某个机关. 正文 jenkins 内置4种触发器: 1.触发远程构建 2.其他工程构建后触发 3.定时触发 4.轮询SCM 那么就来介绍一下这几种吧. ...
- 【Azure APIM】列举几种在APIM 策略中的主动生产的错误语句
问题描述 在为APIM服务配置了诊断日志(Diagnostic Setting),把日志收集在Log A Workspace中,需要验证日志中是否能查看到请求的错误信息. 所以想人为的来制造一些错误. ...
- KubeOperator技术方案
KubeOperator技术方案 总体介绍︎ KubeOperator 是一个开源的轻量级 Kubernetes 发行版,专注于帮助企业规划.部署和运营生产级别的 Kubernetes 集群. Kub ...
- 力扣477(java)-汉明距离总和(中等)
题目: 两个整数的 汉明距离 指的是这两个数字的二进制数对应位不同的数量. 给你一个整数数组 nums,请你计算并返回 nums 中任意两个数之间 汉明距离的总和 . 示例 1: 输入:nums = ...
- 从KPI到OKR,高阶产品人如何推动业务高速增长
简介: 不管是核心大目标,还是O(Objectives),或者北极星指标,奇妙等式等等,最后都需要核心组织协同方式来推动整个目标聚焦以及过程的落地. 作为产品经理人,相信很多人都遇到过以下的灵魂拷问: ...
- EDA 事件驱动架构与 EventBridge 二三事
简介: 事件驱动型架构 (EDA) 方兴未艾,作为一种 Serverless 化的应用概念对云原生架构具有着深远影响.当我们讨论到一个具体架构时,首当其冲的是它的发展是否具有技术先进性.这里从我们熟 ...
- [公链观点] BTC 1.0, ETH 2.0, EOS 3.0, Dapp, WASM, DOT, ADA, VNT
Dapp 发展史 WASM 兼容Web的编码方式 Cardano(ADA 艾达币) 权益挖矿 VNT chain 解决联盟链和公链的跨链基础项目 跨链项目 Polkadot (DOT 波卡币) 是不是 ...