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
目录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
pvcommand 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 许可协议。转载请注明出处!
相关文章
How-to-Convert-OpenSSH-keys-to-Putty-(-ppk)-on-Linux
On Arch Linux pacman -S putty Then cd to path of key(s): puttygen keyname -o keyname.ppk On Debian/Ubuntu apt-get install putty-tools puttygen keyname -o keyname.ppk Notice! replace the “keyname” with
2025-10-27 · FAQ & Tips · 约 1 分钟
Manjaro-Linux安装Virtualbox的那些坑与解决方案~
前言 不久之前,由于我的Ubuntu安装盘空间满了,于是想在新的SSD上装另一个系统,于是就又回到了Manjaro的怀抱,KDE桌面真好用,不过很多配置的地方还是要研究一下的,毕竟以前主要用的桌面还是Gtk系的~ 进入正题 安装virtualbox Manjaro的官方源里面是有virtualbox的,直接打开Octopi搜一下就有了~ 或者输入命令安装: sudo pacman -S virtu
2025-10-27 · FAQ & Tips · 约 1 分钟
某些软件中无法切换fcitx输入法的问题
gsettings set org.gnome.settings-daemon.plugins.xsettings overrides "{'Gtk/IMModule':<'fcitx'>}"
2025-10-27 · FAQ & Tips · 约 1 分钟
为什么Ubuntu点了关机键变成注销?
最近发现一个奇怪的现象,就是点了关机键变成了注销,神烦,查了一下资料,找到了原因,原来是我安装的plank dock栏有个bug,会阻止系统关机,所以点了关机之后变成注销了,所以要在关机之前退出plank或者是docky这种dock工具。 然后我选择用回Unity的侧边栏了,告辞~ 参考资料 https://linux.cn/article-6265-1.html
2025-10-27 · FAQ & Tips · 约 1 分钟
讨论
共 0 条加载评论中…