1

This is with OSX. When I run this in a terminal

scottcarlson$ sudo dd if=Downloads/CentOS-7-x86_64-Everything-1511.iso of=/dev/disk2 2> Desktop/out.txt

and then this in another

tail -f Desktop/out.txt

it only updates the log when I press Ctlt in the first terminal with the dd. Is this because of the nature of dd?

I don't know exactly how it writes to devices, but could it be too demanding for the process to take a break and write to the log?

6
  • @jlliagre I believe I'm asking more precisely why it outputs when I press cntl+t. Commented Jul 23, 2016 at 1:19
  • Which is precisely explained here: unix.stackexchange.com/a/59076/2594 Commented Jul 23, 2016 at 1:32
  • See also askubuntu.com/questions/215505/… Commented Jul 23, 2016 at 1:35
  • Maybe I am misunderstanding that explanation, so is cntl+t a macro for kill -INFO $PID? Commented Jul 23, 2016 at 1:36
  • Kind of. It is actually directly sending the SIGINFO signal, just like Ctrl-C is sending the SIGQUIT one. On Linux you would send SIGUSR1 for the same effect, but there is no keyboard shortcut. Commented Jul 23, 2016 at 1:56

3 Answers 3

1

It only updates the log when I press Ctlt in the first terminal with the dd. Is this because of the nature of dd?

Yes. It is in the nature of dd to output its current status when it receives a given signal. Under most OSes, this signal is SIGUSR1, a standard signal but on OS X, it uses for the same a non standard signal named SIGINFO. Moreover, OS X has a tty driver setting that allows to send that specific signal with a key combination, CtrlT, just like CtrlC sends SIGQUIT on all OSes.

I don't know exactly how it writes to devices, but could it be too demanding for the process to take a break and write to the log?

You are precisely asking it to do that with the shortcut. Should you want to have regular automatic updates, nothing forbids you to do a simple shell loop like that one:

while kill -INFO $(pgrep dd); do sleep 5; done

This assumes pgrep is available on OS X. Otherwise, pick the pid of your dd command and use it as kill second argument.

1

What you're seeing with ctlt is a summary of the running process information, not dd's output.

dd does not output any progress information, unlike what you seem to expect.

If you want to see the actual progress from another terminal window, look at the output file size changing. In this case you're writing to a raw disk, so patience is probably your best friend here.

11
  • Ok thank you. I originally did not think dd output anything based on my experience, but a Google search led me to think otherwise. Can you suggest a good method to see information about the transfer (like percent of transfer completed) for OS X? I have brew installed. In rhel I know how to do it but the same method does not work in OS X. Commented Jul 23, 2016 at 1:13
  • Not in your current case where you're writing to a device, not a file. If it was a file, you could look at the size changing but with a device or partition, there is no way to monitor its progress. I can imagine many ways that it could be done but not as efficiently and since it's probably very slow already, just let it run until it finishes. Commented Jul 23, 2016 at 1:14
  • Well here's to waiting around for 12 hours.. It's a 26gb file haha Commented Jul 23, 2016 at 1:23
  • That does seem quite slow. Are you reading and writing on the same device? What type of drive is the output device? Commented Jul 23, 2016 at 1:27
  • Only writing and it's a 16gb usb 2.0 drive, I'm writing a very large iso. Commented Jul 23, 2016 at 2:04
0

On OS-X, if you run stty -a you'll see that ^T is the key combination for status

% stty -a | grep '\^T'
        min = 1; quit = ^\; reprint = ^R; start = ^Q; status = ^T;

From man dd

 If dd receives a SIGINFO (see the status argument for stty(1)) signal,
 the current input and output block counts will be written to the standard
 error output in the same format as the standard completion message.  If

The two together mean that while dd is running, hitting ^T will cause a summary display to be written.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.