挂载移动硬盘的xfs分区时,出现如下报错:
Unable to mount xfs
Error mounting /dev/sdc3 at /mnt/xfs: Command-line `mount -t "xfs" -o "uhelper=udisks2,nodev,nosuid" "/dev/sdc3" "/mnt/xfs"' exited with non-zero exit status 32: mount: wrong fs type, bad option, bad superblock on /dev/sdc3,
missing codepage or helper program, or other error
In some cases useful info is found in syslog - try
dmesg | tail or so.
通过journalctl -xb或者dmesg可以看到错误原因是:
7月 24 10:03:22 Latitude-5490 kernel: XFS (sdc3): Filesystem has duplicate UUID c2b23d6d-ffe2-4575-8963-cd1cf4c295f2 - can't mount
如果只是挂载一次的话,可以添加如下选项进行挂载:
$ sudo mount -o nouuid /dev/sdc3 /mnt/xfs
一劳永逸的方法是重新生成UUID:
$ sudo xfs_admin -U generate /dev/sdc3
Clearing log and setting UUID
writing all SBs
new UUID = c6998b15-3f79-44ad-b63d-274f5388e9e1
然后就可以直接mount了:
$ sudo mount /dev/sdc3 /mnt/xfs