xfs文件系统元数据损坏修复

XfS文件系统是SGI开发的高级日志文件系统,XFS极具伸缩性,非常健壮。

关于其安装和使用和ext4都是一样,就是格式化不一样。

其次是格式化都是一样的,它可以支持ext4单个文件超过16T的限制。

#/sbin/mkfs.xfs –f /dev/sda6

#mount –t xfs /dev/sda6 /xfs

 

关于其经常会出现错误,进行修复

 $ cd /data3

$ ls

ls: cannot open directory .: Input/output error

修改包括三步:卸载,修复和检查

 

 

[root@gpsg32 ~]# xfs_repair /dev/sdd
Phase 1 - find and verify superblock...
Phase 2 - using internal log
        - zero log...
ERROR: The filesystem has valuable metadata changes in a log which needs to
be replayed.  Mount the filesystem to replay the log, and unmount it before
re-running xfs_repair.  If you are unable to mount the filesystem, then use
the -L option to destroy the log and attempt a repair.
Note that destroying the log may cause corruption -- please attempt a mount
of the filesystem before doing this.

[root@gpsg32 ~]# mount /data3
mount: 结构需要清理
[root@gpsg32 ~]# mount -f /data3
[root@gpsg32 ~]# xfs_repair -L /dev/sdd
Phase 1 - find and verify superblock...
Phase 2 - using internal log
        - zero log...
ALERT: The filesystem has valuable metadata changes in a log which is being
destroyed because the -L option was used.
        - scan filesystem freespace and inode maps...
sb_icount 128, counted 4922112
sb_ifree 123, counted 25707
sb_fdblocks 731556628, counted 438595794
        - found root inode chunk
Phase 3 - for each AG...

[root@gpsg32 ~]# xfs_check /dev/sdd      检查后重新挂载OK

[root@gpsg32 ~]# mount /data3
[root@gpsg32 ~]# df -h
文件系统              容量  已用  可用 已用%% 挂载点
/dev/mapper/VolGroup-lv_root
                       50G  3.1G   44G   7% /
tmpfs                  79G     0   79G   0% /dev/shm
/dev/sda1             485M   63M  397M  14% /boot
/dev/mapper/VolGroup-lv_home
                       20G   15G  4.3G  78% /home
/dev/mapper/VolGroup-lv_tmp
                       50G  180M   47G   1% /tmp
/dev/sdb              2.8T  1.1T  1.7T  40% /data1
/dev/sdc              2.8T  1.1T  1.7T  40% /data2
/dev/sdd              2.8T  1.1T  1.7T  41% /data3

你可能感兴趣的:(xfs文件系统元数据损坏修复)