Differences
This shows you the differences between two versions of the page.
linux_wiki:dd [2015/03/09 22:54] billdozor |
linux_wiki:dd [2019/05/25 23:50] |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== dd ====== | ||
- | **General Information** | ||
- | |||
- | Using dd to create a USB bootable image. | ||
- | |||
- | **Checklist** | ||
- | * Distros: All | ||
- | |||
- | ---- | ||
- | |||
- | ===== The command ===== | ||
- | <code bash> | ||
- | dd if=~/ | ||
- | </ | ||
- | |||
- | ==== Explanation ==== | ||
- | |||
- | * if = in file, the location of source image | ||
- | * of = output file, the location of the USB device. x is the drive letter. | ||
- | * oflag direct = bypass the cache and write direct to disk | ||
- | * bs = write in the specified block size | ||
- | |||
- | ---- | ||
- | |||
- | ===== Get DD status ===== | ||
- | |||
- | To get a progress report while dd is running, you need to open another virtual terminal, and then send a special USR1 signal to the dd process. | ||
- | |||
- | First, find out the process id of the dd process by running the following in the new virtual terminal. | ||
- | <code bash> | ||
- | pgrep -l ' | ||
- | 8789 dd | ||
- | </ | ||
- | |||
- | To send the USR1 signal to the dd prcoess: | ||
- | <code bash> | ||
- | kill -USR1 8789 | ||
- | </ | ||
- | |||
- | As soon as the USR1 signal is detected, dd will print out the current statistics to its STDERR. | ||
- | <code bash> | ||
- | $ dd if=/ | ||
- | 0+14 records in | ||
- | 0+14 records out | ||
- | 204 bytes (204 B) copied, 24.92 seconds, 0.0 kB/s | ||
- | </ | ||
- | |||
- | Use the watch command to execute kill at a set interval. (every 10 seconds in this case) | ||
- | <code bash> | ||
- | watch -n 10 kill -USR1 8789 | ||
- | </ | ||
- | |||
- | ---- | ||
- | |||
- | ===== Alternative DD status ===== | ||
- | |||
- | Another method of getting dd status is using pv. | ||
- | PV " | ||
- | |||
- | The dd command then becomes: | ||
- | <code bash> | ||
- | dd if=~/ | ||
- | </ | ||
- | |||
- | pv options | ||
- | |||
- | * -p : show progress bar | ||
- | * -e : estimated time remaining | ||
- | * -t : timer on, show total time running | ||
- | * -r : rate of data transfer |