AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / server / 问题 / 118791
Accepted
Tim Abell
Tim Abell
Asked: 2010-03-04 07:25:37 +0800 CST2010-03-04 07:25:37 +0800 CST 2010-03-04 07:25:37 +0800 CST

你如何让 e2fsck 显示进度信息?

  • 772

我在一个非常大 (1TB+) 的 ext3 磁盘上运行 e2fsk

e2fsck -v /dev/sda1

从使用 PXE 引导的 RIPLinux。

我明白了

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。

linux ext3 fsck
  • 4 4 个回答
  • 75992 Views

4 个回答

  • Voted
  1. Best Answer
    Warner
    2010-03-04T07:28:56+08:002010-03-04T07:28:56+08:00

    该-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.
    
    • 84
  2. Tim Abell
    2010-03-04T07:45:03+08:002010-03-04T07:45:03+08:00

    来自版本 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
    
    • 22
  3. ben
    2012-12-08T17:10:57+08:002012-12-08T17:10:57+08:00

    ps -ef | grep fsck

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

    使用进程 ID,

    杀死-USR1 5079

    • 5
  4. Dmitry Ilyin
    2016-06-21T06:40:13+08:002016-06-21T06:40:13+08:00

    为什么?

    BSD 系统及其后代具有 SIGINFO 信号。它使程序将其当前状态输出到控制台。许多基本的 BSD 工具都知道这个信号并支持它。您可以使用 Ctrl+T 将此信号发送到当前进程。

    SysV 系统没有这样的信号,也没有 Ctrl+T。一些 Linux 工具支持 SIGUSR1。我只知道“dd”和“e2fsck”,但还有更多。没有Ctrl+?发送它的快捷方式,因此您必须在进程的 pid 上使用“kill -USR1”手动完成。

    大多数其他程序对 SIGUSR1 的反应与对 SIGTERM(退出)的反应方式相同,因此除非您知道它受支持,否则不要发送此信号。

    • 3

相关问题

  • 多操作系统环境的首选电子邮件客户端

  • 你最喜欢的 Linux 发行版是什么?[关闭]

  • 更改 PHP 的默认配置设置?

  • 保护新的 Ubuntu 服务器 [关闭]

  • (软)Ubuntu 7.10 上的 RAID 6,我应该迁移到 8.10 吗?

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    新安装后 postgres 的默认超级用户用户名/密码是什么?

    • 5 个回答
  • Marko Smith

    SFTP 使用什么端口?

    • 6 个回答
  • Marko Smith

    从 IP 地址解析主机名

    • 8 个回答
  • Marko Smith

    如何按大小对 du -h 输出进行排序

    • 30 个回答
  • Marko Smith

    命令行列出 Windows Active Directory 组中的用户?

    • 9 个回答
  • Marko Smith

    什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同?

    • 3 个回答
  • Marko Smith

    如何确定bash变量是否为空?

    • 15 个回答
  • Martin Hope
    MikeN 在 Nginx 中,如何在维护子域的同时将所有 http 请求重写为 https? 2009-09-22 06:04:43 +0800 CST
  • Martin Hope
    Tom Feiner 如何按大小对 du -h 输出进行排序 2009-02-26 05:42:42 +0800 CST
  • Martin Hope
    0x89 bash中的双方括号和单方括号有什么区别? 2009-08-10 13:11:51 +0800 CST
  • Martin Hope
    Kyle Brandt IPv4 子网如何工作? 2009-08-05 06:05:31 +0800 CST
  • Martin Hope
    Noah Goodrich 什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同? 2009-05-19 18:24:42 +0800 CST
  • Martin Hope
    Brent 如何确定bash变量是否为空? 2009-05-13 09:54:48 +0800 CST
  • Martin Hope
    cletus 您如何找到在 Windows 中打开文件的进程? 2009-05-01 16:47:16 +0800 CST

热门标签

linux nginx windows networking ubuntu domain-name-system amazon-web-services active-directory apache-2.4 ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve