XFS backup and restore from a remote host
Posted on March 6, 2017
To backup or dump an XFS file system, use the xfsdump utility. Centos supports backups to tape drives or regular file images, and also allows multiple dumps to be written to the same tape. The xfsdump utility also allows a dump to span multiple tapes, although only one dump can be written to a regular file. In addition, xfsdump supports incremental backups, and can exclude files from a backup using size, subtree, or inode flags to filter them.
install XFS dump
$ yum install xfsdump
Backup while running
Dump xfs local:
$ xfsdump -l0 -f /sda4_full_backup.xfsdump /dev/sda4
Dump xfs to a remote host:
$ xfsdump -l0 - / | gzip -c | ssh user@host dd of=/backup.dgz
Restore xfs from remote host:
$ ssh user@host "dd if=/somewhere/backup.dgz" | gunzip -c | xfsrestore - /mnt