LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 06-03-2016, 07:29 AM   #1
kjhambrick
Senior Member
 
Registered: Jul 2005
Location: Round Rock, TX
Distribution: Slackware64 15.0 + Multilib
Posts: 2,159

Rep: Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512
dd and status=progress


All --

I've been burning a few USB thumb drives lately and I've tried to invoke the `dd status=progress` arg.

It does not seem to work.

I expect to see an occasional progress indicator but instead nothing writes to stderr until the dd operation is complete, sometimes several minutes later.

Am I doing it wrong ?

Assume IsoFile and USBDrive are set to 'something relevant':

Code:
dd if=${IsoFile} of=${USBDrive} bs=1M status=progress
Not critical but just wondering ...

Thanks.

-- kjh

Last edited by kjhambrick; 06-03-2016 at 09:06 AM. Reason: misspelled status
 
Old 06-03-2016, 09:16 AM   #2
Skaendo
Senior Member
 
Registered: Dec 2014
Location: West Texas, USA
Distribution: Slackware64-14.2
Posts: 1,445

Rep: Reputation: Disabled
It works for me. This is how I write ISO to USB and it works every time for me:

Code:
dd if=/path/to/filename.iso of=/dev/sdb bs=4M status=progress && sync
Attached Thumbnails
Click image for larger version

Name:	snapshot28.png
Views:	1161
Size:	22.3 KB
ID:	21990   Click image for larger version

Name:	snapshot29.png
Views:	936
Size:	27.3 KB
ID:	21991  

Last edited by Skaendo; 06-03-2016 at 09:23 AM.
 
Old 06-03-2016, 09:27 AM   #3
Alien Bob
Slackware Contributor
 
Registered: Sep 2005
Location: Eindhoven, The Netherlands
Distribution: Slackware
Posts: 8,559

Rep: Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106
I think that depends on what version of Slackware you are trying this on.

Snapshot taken during a "dd" operation:
Code:
root@bear:/# dd if=/mirrors/slackware-live/latest/slackware-live-xfce-current.iso of=/tmp/DUMMY.iso status=progress
178830848 bytes (179 MB, 171 MiB) copied, 3.00001 s, 59.6 MB/s
On Slackware-current the "status=progress" works. Any release before that, dd did not support "status=progress".
 
2 members found this post helpful.
Old 06-03-2016, 09:29 AM   #4
kjhambrick
Senior Member
 
Registered: Jul 2005
Location: Round Rock, TX
Distribution: Slackware64 15.0 + Multilib
Posts: 2,159

Original Poster
Rep: Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512
Quote:
Originally Posted by Skaendo View Post
It works for me. This is how I write ISO to USB and it works every time for me:

Code:
dd if=/path/to/filename.iso of=/dev/sdb bs=4M status=progress && sync
Dang !

I must be doing it wrong

Thanks Skaendo.

I like the && sync that you appended ... I type it manually after a dd but your way is less error-prone.

-- kjh
 
Old 06-03-2016, 10:16 AM   #5
Skaendo
Senior Member
 
Registered: Dec 2014
Location: West Texas, USA
Distribution: Slackware64-14.2
Posts: 1,445

Rep: Reputation: Disabled
Quote:
Originally Posted by Alien Bob View Post
I think that depends on what version of Slackware you are trying this on.

Snapshot taken during a "dd" operation:
Code:
root@bear:/# dd if=/mirrors/slackware-live/latest/slackware-live-xfce-current.iso of=/tmp/DUMMY.iso status=progress
178830848 bytes (179 MB, 171 MiB) copied, 3.00001 s, 59.6 MB/s
On Slackware-current the "status=progress" works. Any release before that, dd did not support "status=progress".
I think that you are 100% correct as usual Eric. Another member was using 8.21 and "status-progress" didn't work, where I am on current and 8.25 it does work.

@kjh
I cannot take credit for the '&& sync'. I found it on another forum somewhere while looking for something else and said hey, that looks like it might be a good idea.

Last edited by Skaendo; 06-03-2016 at 10:19 AM.
 
Old 06-03-2016, 10:17 AM   #6
Paulo2
Member
 
Registered: Aug 2012
Distribution: Slackware64 15.0 (started with 13.37). Testing -current in a spare partition.
Posts: 928

Rep: Reputation: 515Reputation: 515Reputation: 515Reputation: 515Reputation: 515Reputation: 515
As -stable user I put dd in background and 'kill -10' it to see the progress,
good to know that there is an option to show the progress now.
 
Old 06-03-2016, 10:38 AM   #7
kjhambrick
Senior Member
 
Registered: Jul 2005
Location: Round Rock, TX
Distribution: Slackware64 15.0 + Multilib
Posts: 2,159

Original Poster
Rep: Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512
Quote:
Originally Posted by Alien Bob View Post
I think that depends on what version of Slackware you are trying this on.
Thanks as always Eric !

-- kjh
 
Old 06-03-2016, 11:45 AM   #8
kjhambrick
Senior Member
 
Registered: Jul 2005
Location: Round Rock, TX
Distribution: Slackware64 15.0 + Multilib
Posts: 2,159

Original Poster
Rep: Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512
This is kinda strange ...

edit -- same groups and dd behavior from the runlevel 3 console

I am logged into a KDE Konsole session on an up-to-date Current + Multilib System

If I leave off bs=1M or bs=4M I get a progress output:

Code:
$ dd if=slackware-current-64-B60603.iso of=/dev/sde status=progress

2766066176 bytes (2.8 GB, 2.6 GiB) copied, 630 s, 4.4 MB/s    
5410816+0 records in
5410816+0 records out
2770337792 bytes (2.8 GB, 2.6 GiB) copied, 636.599 s, 4.4 MB/s
When I add the bs= arg, not only do I NOT get progress output but I am unable to kill dd via [Ctrl][C]:

The only way 'out' is to unplug the Thumb drive.

bs=4M:

Code:
$ dd if=slackware-current-64-B60603.iso of=/dev/sde bs=4M status=progress          

660+1 records in                                                                                            
660+1 records out                                                                                           
2770337792 bytes (2.8 GB, 2.6 GiB) copied, 13.6832 s, 202 MB/s                                              
dd: closing input file 'slackware-current-64-B60603.iso': Bad file descriptor
bs=1M

Code:
$ dd if=slackware-current-64-B60603.iso of=/dev/sde bs=1M status=progress          
                                                                                                            
2642+0 records in                                                                                           
2642+0 records out                                                                                          
2770337792 bytes (2.8 GB, 2.6 GiB) copied, 16.0967 s, 172 MB/s                                              
dd: closing input file 'slackware-current-64-B60603.iso': Bad file descriptor
no bs=

Code:
$ dd if=slackware-current-64-B60603.iso of=/dev/sde status=progress

2766066176 bytes (2.8 GB, 2.6 GiB) copied, 630 s, 4.4 MB/s    
5410816+0 records in
5410816+0 records out
2770337792 bytes (2.8 GB, 2.6 GiB) copied, 636.599 s, 4.4 MB/s
I am a member of plugdev:

Code:
$groups 
users lp floppy audio video cdrom plugdev netdev scanner
But this is kinda strange ( note the different group lists ) ...

Code:
$ su -
Password: 

# groups konrad

konrad : users lp plugdev netdev
as is this:

Code:
# grep konrad /etc/group
lp:x:7:lp,konrad
plugdev:x:83:konrad
netdev:x:86:konrad
dd is Version 8.25:

Code:
$ dd --version

dd (coreutils) 8.25
Copyright (C) 2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by Paul Rubin, David MacKenzie, and Stuart Kemp.
I am going to log out of KDE / try from a runlevel 3 session ... maybe it's a KDE thing ?

-- kjh

Last edited by kjhambrick; 06-03-2016 at 11:49 AM.
 
Old 06-03-2016, 11:52 AM   #9
dab1414
Member
 
Registered: May 2011
Location: OK, USA
Distribution: Slackware 14.1_64
Posts: 76

Rep: Reputation: 52
When I last installed current (a few days ago), I did the dd urandom on hardrives then in another tty
Code:
pkill -USR1 -n -x dd
It showed me the progress, then I weeped after realizing how long it would take for my 1Tb drive.
 
1 members found this post helpful.
Old 06-03-2016, 12:13 PM   #10
kjhambrick
Senior Member
 
Registered: Jul 2005
Location: Round Rock, TX
Distribution: Slackware64 15.0 + Multilib
Posts: 2,159

Original Poster
Rep: Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512
Quote:
Originally Posted by dab1414 View Post
When I last installed current (a few days ago), I did the dd urandom on hardrives then in another tty
Code:
pkill -USR1 -n -x dd
It showed me the progress, then I weeped after realizing how long it would take for my 1Tb drive.
Yes. That's more-or-less the way I used to run dd:

Code:
# dd if=slackware-current-64-B60603.iso of=/dev/sde &                
[2] 31262

# note the PID=31262 ...

# kill -USR1 31262

484017+0 records in
484017+0 records out
247816704 bytes (248 MB, 236 MiB) copied, 48.8515 s, 5.1 MB/s
Interesting ... if I add bs=1M or bs=4M to the dd command, I get no status on a kill -USR1 PID and I can't kill -15 PID or kill -9 PID ( same as [Ctrl][C] on an interactive dd session )

Maybe I've got a bad USB Drive ... ???

This particular USB Drive did some odd things when I used it to test liveslak ... maybe it was the USB Drive all along.

-- kjh
 
Old 06-03-2016, 12:15 PM   #11
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: Rocky Linux
Posts: 4,779

Rep: Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212
If you have a lot of memory, what can happen is that dd finishes writing the data very quickly, but it's all sitting in kernel buffers waiting for the slow device. Then dd calls close() on the output file, and that hangs until the buffers are flushed out. The dd program remains unresponsive (hung in the "D" state) until that all completes. With your 2.6GB of data and a slow USB flash drive, that can take several minutes.

You can use "oflag=direct" with dd to avoid the buffering, but performance will be sensitive to the output block size. Use the optimal I/O size reported by fdisk for best results.
 
4 members found this post helpful.
Old 06-03-2016, 12:37 PM   #12
kjhambrick
Senior Member
 
Registered: Jul 2005
Location: Round Rock, TX
Distribution: Slackware64 15.0 + Multilib
Posts: 2,159

Original Poster
Rep: Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512
Quote:
Originally Posted by rknichols View Post
If you have a lot of memory, what can happen is that dd finishes writing the data very quickly, but it's all sitting in kernel buffers waiting for the slow device. Then dd calls close() on the output file, and that hangs until the buffers are flushed out. The dd program remains unresponsive (hung in the "D" state) until that all completes. With your 2.6GB of data and a slow USB flash drive, that can take several minutes.

You can use "oflag=direct" with dd to avoid the buffering, but performance will be sensitive to the output block size. Use the optimal I/O size reported by fdisk for best results.
edit - marked as solved

We have a winner ! Thank you rknichols !

I've got 64GB of RAM so pretty much everything I read gets cached to RAM ...

And I saw the D State of the unresponsive DD program when I tried to kill -15 PID and kill -9 PID ...

My 'optimal size is 512 bytes ( below ) and dd now works with ANY bs= and status=progress as long as I add oflag=direct arg !

Thanks again !

-- kjh

Code:
# fdisk -l /dev/sde

Disk /dev/sde: 7.5 GiB, 8006074368 bytes, 15636864 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
<<snip>>

Last edited by kjhambrick; 06-03-2016 at 12:38 PM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Copy command to show progress bar or status sudo_su Linux - Newbie 5 08-03-2013 04:16 PM
cupsd fails when trying to create a printer with status code 127 and at times status 2 lgoldma Linux - Software 0 11-02-2012 07:52 PM
A progress status for Rsync?? helptonewbie Linux - Newbie 3 03-24-2008 02:05 AM
My LFS Progress/Status. rvijay Linux From Scratch 15 01-28-2005 09:42 AM
LQ member progress status from member to senior member............. emailssent LQ Suggestions & Feedback 3 10-11-2004 01:31 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 02:49 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration