我有一台虚拟机,上面连接了 4 个磁盘,运行时有一个用 C# 编写的程序,该程序将更多随机磁盘连接到它。我不知道随机连接的磁盘是否会有 FSCK 的间隔和计数,但我不想在它们上运行 FSCK,也不想以任何方式更改它们的数据。有没有办法只在 OS 磁盘上运行 FSCK,而不在连接的(未安装的)磁盘上运行它fstab 文件中也没有提到)? 当操作系统启动完成后,我将在需要进行 FS 检查的磁盘上手动运行它
答案1
要永久禁用fsck
对硬盘分区的检查,您需要编辑
/etc/fstab。
设置为最后一个值0
将告诉 fsck 跳过检查分区。
从手册页中:
The sixth field (fs_passno).
This field is used by fsck(8) to determine the order in which
filesystem checks are done at boot time. The root filesystem
should be specified with a fs_passno of 1. Other filesystems
should have a fs_passno of 2. Filesystems within a drive will
be checked sequentially, but filesystems on different drives
will be checked at the same time to utilize parallelism
available in the hardware. Defaults to zero (don't fsck) if
not present.