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 许可协议。转载请注明出处!
相关文章
Debian系Linux:获取指定应用的快捷方式文件地址
快捷方式 就是 *.desktop 文件咯 dpkg -L application-name | grep desktop
2025-10-27 · FAQ & Tips · 约 1 分钟
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 分钟
轻松解决Linux+Windows双系统时间不一致问题
前言 Linux用户很多都是使用双系统的吧,毕竟很多Linux下没有的软件还是需要打开Windows。 但是一直以来有个困扰,Linux下时间显示是正常的,但是回到Windows下时间就会慢了8个小时 = = 这是因为Windows默认使用硬件时钟,而Linux使用网络时间,现在只需要一条命令就能搞定这个问题。 解决 在Linux下打开终端,输入命令: timedatectl set-local-
2025-10-27 · FAQ & Tips · 约 1 分钟
ModuleNotFoundError--No-module-named-'apt_pkg'-错误解决
前言 今天在安装docker的时候遇到这个问题了,通过搜索解决方案解决了,所以记录一下。 猜测原因应该是今天升级了系统的Python版本,然后python3的软链接也被我改成指向最新版本了。 解决方法 sudo apt-get remove --purge python-apt sudo apt-get install python-apt -f cd /usr/lib/python3/dist
2025-10-27 · FAQ & Tips · 约 1 分钟
讨论
共 0 条加载评论中…