SATAのUSB変換ケーブルとかで指したり抜いたりしてたら、トラブル。
マウントしようとすると、
XFS: Filesystem sdc6 has duplicate UUID - can't mount
とかでる。この場合は、uuidを見ないでマウントすればとりあえずよい。
$ sudo mount -o nouuid /dev/sdc6 /mnt
これで問題なかったと思いきや、しばらくいじくっていると、input/output errorとやらが出てしまった。
XFSの修復に必要なツールを入れる。
$ sudo apt-get install xfsprogs
とりあえず情報をみてみる。
$ sudo mount -r /dev/sdc6 /mnt $ sudo xfs_info /mnt (なんかいろいろ)
チェックしてみる。
$ sudo mount -r /dev/sdc6 /mnt $ sudo xfs_check /dev/sdc6 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_check. If you are unable to mount the filesystem, then use the xfs_repair -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.
メタデータがおかしい様子。
なにやらxfs_repairに-Lオプションをつけてログいじってしまえと言ってるのでやってみる。
$ sudo umount -l /mnt $ sudo xfs_repair -L /dev/sdc6 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... - found root inode chunk Phase 3 - for each AG... - scan and clear agi unlinked lists... - process known inodes and perform inode discovery... - agno = 0 - agno = 1 とかいろいろでて完了。
その後、ファイルをいじくってみているが、とくに問題は起きてない様子。