返回文章列表文章索引阅读全文
STARBLOG / 阅读手记
FAQ & Tips

Check dd command write progress in Linux

Preface In Linux, there is a powerful tool called dd for manipulating disk images, which is absolutely fantastic. The only downside is that it doesn't display the operation progress. However, there are ways to work around this. Below are several methods to check the writing progress. Using the status option to view progress If you are using the GNU version of dd and your coreutils version is higher than 8.24, you can use the status option. For example: `sudo dd if=/dev/sda of=/dev/zero status=progress` The above command on Mac

曦远 (DealiAxy)约 4 分钟
目录5 个章节

Preface

Under Linux, there is a powerful tool called dd used for operating on disk images—it's truly an amazing utility. The only drawback is that it doesn't display progress during operations. However, there are workarounds for this. Below are several methods to check the writing progress.

status Option to Check Progress

If you are using the GNU version of dd and the coreutils version is higher than 8.24, you can use the status option. For example:

sudo dd if=/dev/sda of=/dev/zero status=progress

The command above will result in an error when executed on Mac OS X, because OS X uses the BSD version of the command line, not GNU. You can install GNU coreutils on Mac OS X or use the pv command introduced below.

pv command

sudo pv -tpreb /dev/sda | dd of=/dev/zero
sudo pv -tpreb /dev/sda | dd of=/dev/zero bs=4096 conv=notrunc,noerror

Using pv together with dialog can also display a progress bar dialog box:

 (sudo pv -n /dev/sda | dd of=/dev/zero) 2>&1 | dialog --gauge "dd process bar" 10 70 0

Using pkill to Print Progress

Open a new Shell and execute the following command to output progress information once per second:

watch -n 1 pkill -USR1 -x dd

References

http://blog.topspeedsnail.com/archives/8125 http://blog.topspeedsnail.com/archives/2748 http://blog.topspeedsnail.com/archives/9464 https://www.mobibrw.com/2017/7677

_EOF_

Check dd command write progress in Linux

本文作者:
程序设计实验室
版权声明:
本博客所有文章除特别声明外,均采用 BY-NC-SA 许可协议。转载请注明出处!

相关文章

Manjaro-Linux安装Virtualbox的那些坑与解决方案~

前言 不久之前,由于我的Ubuntu安装盘空间满了,于是想在新的SSD上装另一个系统,于是就又回到了Manjaro的怀抱,KDE桌面真好用,不过很多配置的地方还是要研究一下的,毕竟以前主要用的桌面还是Gtk系的~ 进入正题 安装virtualbox Manjaro的官方源里面是有virtualbox的,直接打开Octopi搜一下就有了~ 或者输入命令安装: sudo pacman -S virtu

2025-10-27 · FAQ & Tips · 约 1 分钟

讨论

共 0 条

良言一句三冬暖,恶语伤人六月寒。

加载评论中…