我在一个非常大的(1TB +)ext3磁盘上运行e2fsk
e2fsck -v /dev/sda1
从RIPLinux引导与PXE。
我明白了
e2fsck 1.41.6 (30-May-2009) /dev/sda1 contains a file system with errors, check forced. Pass 1: Checking inodes, blocks, and sizes
然后很长的停顿…
我如何得到一些活动的想法?
理想情况下,完成项目总数和某种ETA。
-C
标志将显示一个进度条。 性能差异取决于如何调用fsck。
非常酷,如果e2fsck
已经在运行,你可以发送一个USR1
信号来开始显示进度条。 USR2
停止。 例:
killall -USR1 e2fsck
来自FSCK(8):
-C Display completion/progress bars for those filesys- tems checkers (currently only for ext2) which sup- port them. Fsck will manage the filesystem check- ers so that only one of them will display a progress bar at a time.
来自E2FSCK(8):
-C fd This option causes e2fsck to write completion information to the specified file descriptor so that the progress of the filesystem check can be monitored. This option is typically used by pro- grams which are running e2fsck. If the file descriptor specified is 0, e2fsck will print a com- pletion bar as it goes about its business. This requires that e2fsck is running on a video console or terminal.
从版本1.41的手册页
-C fd This option causes e2fsck to write completion information to the specified file descriptor so that the progress of the filesystem check can be monitored. This option is typically used by programs which are running e2fsck. If the file descriptor number is negative, then absolute value of the file descriptor will be used, and the progress information will be suppressed initially. It can later be enabled by sending the e2fsck process a SIGUSR1 signal. If the file descriptor specified is 0, e2fsck will print a completion bar as it goes about its business. This requires that e2fsck is running on a video console or terminal.
所以我想答案是
e2fsck -C 0 /dev/sda1
ps -ef | grep fsck
5079 5007 47 00:55 pts/1 00:08:25 /sbin/fsck.ext3 -yv /dev/hda2
用进程ID,
杀死-USR1 5079
为什么?
BSD系统及其后代拥有SIGINFO信号。 它使程序将其当前状态输出到控制台。 许多基本的BSD工具知道这个信号并且支持它。 您可以使用Ctrl + T将此信号发送到当前进程。
SysV系统没有这样的信号,也没有Ctrl + T。 一些Linux工具支持SIGUSR1。 我只知道“dd”和“e2fsck”,但可以有更多。 没有Ctrl +? 发送它的快捷方式,所以你必须通过在进程的PID上使用“kill -USR1”手动完成。
大多数其他程序对SIGUSR1的反应与SIGTERM(退出)相同,所以除非知道它支持,否则不要发送这个信号。