如果底层磁盘发生 IO 错误,是否有办法卸载卷(其中有打开的文件)或导致内核崩溃?操作系统是 Linux。这是在出现存储可用性问题时防止数据损坏所必需的。
答案1
设置适当的errors
挂载选项,例如/etc/fstab
。请参阅mount(8)
手册页。
errors={continue|remount-ro|panic}
Define the behaviour when an error is encountered. (Either
ignore errors and just mark the filesystem erroneous and con‐
tinue, or remount the filesystem read-only, or panic and halt
the system.) The default is set in the filesystem superblock,
and can be changed using tune2fs(8).
例如:
/dev/mapper/storage-libvirt /var/lib/libvirt ext4 errors=panic 1 2