1

I am trying to create a new file (blank file) with:

dd if=/dev/zero of=file.txt count=10240 bs=10240

I also want to use dialog output --gauge, something like this:

dd if=/dev/zero | pv | dd of=output.dat count=10240 bs=102400 iflag=fullblock | dialog --gauge "testing" 10 70 0

I have also tried variations of:

(pv -n /dev/zero | dd if=/dev/zero of=output.dat  bs=1000M  count=1) | dialog --guage "Creating a file..." 10 70 0

However it doesn't work, is just lets me know when the file is completed.

Thanks.

  • Try unbuffer. – Arkadiusz Drabczyk Jun 18 '18 at 13:47
  • Never knew about unbuffer, but tried it now same result – warhansen Jun 18 '18 at 13:54
  • dialogis not a UNIX command. Please explain what you are interested in. – schily Jun 18 '18 at 14:20
0

Slightly off-topic, but you can use the status=progress operand in dd and you'll get something like this:

748901888 bytes (749 MB, 714 MiB) copied, 3 s, 250 MB/s
  • dd if=/dev/zero of=/dev/null status=progress count=10240 bs=10240results in: dd: bad argument: "status=progress" – schily Jun 18 '18 at 14:19
  • @schily Then your version of dd doesn't support it. – Tomasz Jun 18 '18 at 14:23
  • If you mention a feature that is not supported by the standard dd then you should name that special dd clone. – schily Jun 18 '18 at 14:32
  • @schily It's a standard GNU on Debian 9. But man dd on my FreeBSD says status is an extension to POSIX. – Tomasz Jun 18 '18 at 14:38
  • So you are not using a standard UNIX implementation. The FreeBSD implementation does not support it as well and other dd implementations (like e.g. sdd) use a different command line argument for that feature since 38 years which is approx., 12 years longer than GNU dd exists. – schily Jun 18 '18 at 14:47
0

I suggest that you skip dialog and use a 'plain' pv progress view in the command line like so

# dd if=/dev/zero bs=10240 count=102400| bash -c 'pv -s 1g  > /media/sudodus/usbdata/output.dat'
 320MiB 0:00:07 [39,2MiB/s] [=========>                        ] 31% ETA 0:00:15
...
1000MiB 0:00:34 [29,1MiB/s] [===============================>  ] 97%            
102400+0 records in
102400+0 records out
1048576000 bytes (1,0 GB, 1000 MiB) copied, 34,4327 s, 30,5 MB/s

I wrote to a USB pendrive to make things slower and easier to 'see'.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.