How do you get e2fsck to show progress information?

by Tim Abell   Last Updated February 01, 2018 04:00 AM

I'm running e2fsk on a very large (1TB+) ext3 disk with

e2fsck -v /dev/sda1

from RIPLinux booted with PXE.

I get

e2fsck 1.41.6 (30-May-2009)
/dev/sda1 contains a file system with errors, check forced.
Pass 1: Checking inodes, blocks, and sizes

and then a very long pause...

How do I get some idea of activity?

Ideally a count of completed items vs total and some kind of ETA.

Tags : linux ext3 fsck


Answers 4


The -C flag will display a progress bar. Performance differences depending on how fsck is called.

And very cool, if e2fsck is already running, you can send a USR1 signal for it to start displaying a progress bar. USR2 to stop. Example:

killall -USR1 e2fsck

From 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.

From 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.
Warner
Warner
March 03, 2010 15:28 PM

from man page for version 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.

so I guess the answer is

e2fsck -C 0 /dev/sda1
Tim Abell
Tim Abell
March 03, 2010 15:45 PM

ps -ef | grep fsck

  5079  5007 47 00:55 pts/1    00:08:25 /sbin/fsck.ext3 -yv /dev/hda2

with the process ID,

kill -USR1 5079

ben
ben
December 08, 2012 01:10 AM

Why?

BSD Systems and their descendants have SIGINFO signal. It makes programs to output their current status to the console. A lot of basic BSD tools know about this signal and support it. You can send this signal to a current process using Ctrl+T.

SysV systems have no such signal and no Ctrl+T too. Some of the Linux tools support SIGUSR1 instead. I know only about "dd" and "e2fsck" but there can be more. There is no Ctrl+? shortcut to send it, so you have to do it manually by using "kill -USR1" on the pid of the process.

Most other programs will react to SIGUSR1 the same way they react to SIGTERM (exit) so don't send this signal unless you know that it's supported.

Dilyin
Dilyin
June 20, 2016 14:40 PM

Related Questions


e2fsck / resize2fs problems

Updated April 01, 2015 19:00 PM

Monitoring XFS filesystem health in Linux

Updated December 06, 2017 03:00 AM

How to responsibly avoid "fsck forced"?

Updated January 20, 2018 20:00 PM

Using fsck to check and repair LUKS encrypted disk?

Updated March 11, 2018 14:00 PM

Behaviour of ext3 filesystem when it hits %100

Updated June 07, 2017 19:00 PM