Linux 挂载 NTFS 移动硬盘报错:mount: wrong fs type, bad option, bad superblock

使用 dmesg | tail 命令查看最新的日志:

root@debian:/home/linxin# dmesg | tail
[799922.637697] ntfs3(sda1): It is recommened to use chkdsk.
[799922.643453] ntfs3(sda1): volume is dirty and "force" flag is not set!
[799944.456400] ntfs3(sda1): It is recommened to use chkdsk.
[799944.462180] ntfs3(sda1): volume is dirty and "force" flag is not set!
[799962.495381] ntfs3(sda1): It is recommened to use chkdsk.
[799962.501035] ntfs3(sda1): volume is dirty and "force" flag is not set!
[799979.101860] ntfs3(sda1): It is recommened to use chkdsk.
[799979.106927] ntfs3(sda1): volume is dirty and "force" flag is not set!
[800154.305179] ntfs3(sda1): It is recommened to use chkdsk.
[800154.310856] ntfs3(sda1): volume is dirty and "force" flag is not set!

日志中反复出现的 volume is dirty 是核心问题。较新的 Linux 内核默认使用 ntfs3 驱动来挂载 NTFS 分区,这个驱动非常注重数据安全。如果这块移动硬盘之前在 Windows 上没有安全弹出(直接拔掉),或者 Windows 开启了“快速启动(Fast Startup)”导致处于休眠状态,NTFS 文件系统就会留下一个“脏标记(dirty flag)”。Linux 为了防止数据损坏,会拒绝挂载并提示你去 Windows 下运行 chkdsk 修复。

如果你手头没有 Windows 电脑,或者不想来回插拔,我们可以直接在 Linux 下使用 ntfsfix 工具来清除这个脏标记。

确认出问题的分区名称(我的设备是 /dev/sda1),然后执行修复命令:

root@debian:/home/linxin# ntfsfix -d /dev/sda1
Mounting volume... OK
Processing of $MFT and $MFTMirr completed successfully.
Checking the alternate boot sector... OK
NTFS volume version is 3.1.
NTFS partition /dev/sda1 was processed successfully.

看到 processed successfully 就说明修复成功

阿里云512M ECS由于内存不足导致FRP频繁502

一开始感觉是源服务器到阿里云的网络问题导致的中转502,后面一看log发现频繁OOM:

应该是因为阿里云云盾占用的内存过多,导致FRP经常被杀

按下面的流程卸载掉云盾就行了:https://www.alibabacloud.com/help/zh/security-center/user-guide/uninstall-the-security-center-agent

最开始没往内存的方向去想是因为已经挂了2G的SWAP,结果现在看来还是因为内存不足的原因(就这样在天天被杀的情况下用了快半年)