当前位置: 首页>>技术教程>>正文


我的 Ubuntu 在每次启动时都运行 fsck

,

问题描述

在每次启动时都是一样的:

/dev/sda1: clean, 908443/38690816 files, 44176803/154733312 blocks

它是 Ubuntu 用来确保文件系统一致性的某种选项,还是我的硬盘有问题? fsck 在引导时最多需要 30 秒,因此大约是其他情况下所需时间的三倍。

完整输出(部分德语):

Begin: Loading essential drivers ... done.
Begin: Running /scripts/init-premount ... done.
Begin: Mounting root file system ... Begin: Running /scripts/local-top ... done.
Begin: Running /scripts/local-premount ... done.
Begin: Running /scripts/local-bottom ... done.
done.
Begin: Running /scripts/init-bottom ... done.
fsck von util-linux 2.20.1
/dev/sda1: sauber, 908443/38690816 Dateien, 44176803/154733312 Blöcke
udevd[623]: unknown key 'SYSFS{idVendor}' in /lib/udev/rules.d/45-libticables.rules:6

udevd[623]: invalid rule '/lib/udev/rules.d/45-libticables.rules:6'

 * Starting mDNS/DNS-SD daemon                                                 [ OK ]
 * Starting Reload cups, upon starting avahi-daemon to make sure remote queues are populated                                                                   [ OK ]
 * Starting configure network device security                                  [ OK ]
 * Starting bluetooth daemon                                                   [ OK ]
 ####* Starting all other stuff

最佳思路

\\n

/dev/sda1: clean, 908443/38690816 Files, 44176803/154733312 Blocks

\\n

产生该消息的行是 this

/* Print the summary message when we're skipping a full check */
log_out(ctx, _("%s: clean, %u/%u files, %llu/%llu blocks"),

它跳过 “full check” 但只是确保对日志的一些快速测试是干净的并且没有孤立的 inode:

cat /var/log/boot.log 
fsck from util-linux 2.20.1
fsck from util-linux 2.20.1
/dev/sda1: clean, 260598/771552 files, 1684682/3080192 blocks
/dev/sdb10: recovering journal
/dev/sdb10: Clearing orphaned inode 142568 (uid=1000, gid=1000, mode=0100664, size=32768)
/dev/sdb10: Clearing orphaned inode 138527 (uid=1000, gid=1000, mode=0100600, size=9580)
/dev/sdb10: clean, 54957/991232 files, 3498365/3958006 blocks

这是正常的,也是意料之中的。如果它是一个真正彻底的检查,它会花费更多的时间,但通常只需要一秒钟或更少。 Systemd systemd-fsck(8) 手册页有触发全面检查的条件:

\\n

systemd-fsck-root.service is responsible for file system checks on the\\n root file system, but only if the root filesystem was not checked\\n in the initramfs. systemd-fsck@.service is used for all other file\\n systems and for the root file system in the initramfs.

\\n

These services are started at boot if passno in /etc/fstab for the\\n file system is set to a value greater than zero. The file system\\n check for root is performed before the other file systems. Other\\n file systems may be checked in parallel, except when they are on\\n the same rotating disk.

\\n

systemd-fsck does not know any details about specific filesystems,\\n and simply executes file system checkers specific to each\\n filesystem type (/sbin/fsck.*). This helper will decide if the\\n filesystem should actually be checked based on the time since last\\n check, number of mounts, unclean unmount, etc.

\\n

您可以简单地检查测试是否几乎没有运行(如果您使用 systemd):

sudo systemd-analyze blame | grep fsck
          1.608s systemd-fsck@dev-disk-by\x2duuid-408535fe\x2d28e6\x2d4d82\x2dbb59\x2d9810ead089a3.service
            87ms systemd-fsck@dev-mapper-vlhome\x2dlvhome.service

参考资料

本文由Ubuntu问答整理, 博文地址: https://ubuntuqa.com/article/13563.html,未经允许,请勿转载。