使用如下命令备份元数据
[root@rd1 hd-8T]# xfs_metadump /dev/centos/opt ./centos-opt.metadump
使用 xfs_mdrestore 恢复数据
[root@rd1 hd-8T]# xfs_mdrestore ./centos-opt.metadump /mnt/hd-4T-part2/centos-opt.dump
[root@rd1 hd-8T]# uuidgen
dc081837-a436-4b66-a952-66e2b1143771
[root@rd1 hd-8T]# xfs_admin -U dc081837-a436-4b66-a952-66e2b1143771 /dev/loop0
Clearing log and setting UUID
writing all SBs
new UUID = dc081837-a436-4b66-a952-66e2b1143771
显示该系统的文件和文件夹,出现乱码
[root@rd1 hd-8T]# mount /dev/loop0 /mnt/opt-old/
[root@rd1 hd-8T]# ls /mnt/opt-old/
3?ogiC h9c?w0?D nGpzR_KspN6ry7jG8CU?[P?< rh UryNGb0UROC0B??CN@ XYpe??Qw?
4bonN2aujzfJamy?R??" Hwp?u4cF N?mmre ?stet xYjaldF?Vf?] zoom
乱码原因:xfs_metadump 参数未加上,应使用 -o
xfs_metadump -o /dev/centos/opt ./centos-opt.metadump
挂载以后
[rdu@nd1 hd-8T]$ ls /mnt/opt-new
ansys_inc code_saturne lammps recoverX SALOME-9.3.0-CO7-SRC WindowsImageBackup
aster google recoverB rh SALOME-9.3.0-CO7-SRC.tgz zoom
xfs_metadump 仅备份元数据,xfs_mdrestore 恢复的也只有文件夹和文件名,文件无实质内容。