LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Closed Thread
  Search this Thread
Old 12-31-2021, 10:01 AM   #1
newbiesforever
Senior Member
 
Registered: Apr 2006
Location: Iowa
Distribution: Debian distro family
Posts: 2,378

Rep: Reputation: Disabled
any reason I shouldn't dd two partitions at once?


I am going to dd two partitions to their respective targets. I could dd one and then the other; but is there any reason I wouldn't want to dd both at once? I could do it by, of course, simply opening a new tab in the terminal and running the new dd from there.

Last edited by newbiesforever; 12-31-2021 at 10:02 AM.
 
Old 12-31-2021, 10:22 AM   #2
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,927

Rep: Reputation: 7320Reputation: 7320Reputation: 7320Reputation: 7320Reputation: 7320Reputation: 7320Reputation: 7320Reputation: 7320Reputation: 7320Reputation: 7320Reputation: 7320
That can work, but without details hard to say anything.
 
Old 12-31-2021, 11:33 AM   #3
lvm_
Member
 
Registered: Jul 2020
Posts: 942

Rep: Reputation: 338Reputation: 338Reputation: 338Reputation: 338
In case of magnetic disks if both partitions are written to the same disk or read from the same disk dd processes will compete for i/o and performance will drop to a point when running them sequentially will be much faster.
 
1 members found this post helpful.
Old 01-01-2022, 04:06 AM   #4
remmilou
Member
 
Registered: Mar 2010
Location: Amsterdam
Distribution: MX Linux (21)/ XFCE
Posts: 212

Rep: Reputation: 69
Speed is the main consideration here (as LVM explains).
I used to "wipe" drives in the old days with dd (dd if=/dev/zero of=/dev/sdX). Did up to 8(!) drives in parallel. Was a mix of internal, USB and ESATA drives. Booted from a live CD. Slow, but started at friday and over the weekend it was ready.
I also found that the stability of the system had its linits, when overdoing it.
Happy dd'ing...
 
1 members found this post helpful.
Old 01-01-2022, 04:44 AM   #5
fatmac
LQ Guru
 
Registered: Sep 2011
Location: Upper Hale, Surrey/Hants Border, UK
Distribution: Mainly Devuan, antiX, & Void, with Tiny Core, Fatdog, & BSD thrown in.
Posts: 5,503

Rep: Reputation: Disabled
As said above, the processes will be competing for resources, better to do them separately.
 
1 members found this post helpful.
Old 01-01-2022, 04:53 AM   #6
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,139

Rep: Reputation: 4122Reputation: 4122Reputation: 4122Reputation: 4122Reputation: 4122Reputation: 4122Reputation: 4122Reputation: 4122Reputation: 4122Reputation: 4122Reputation: 4122
Don't use dd. Simple.
 
Old 01-04-2022, 03:56 AM   #7
remmilou
Member
 
Registered: Mar 2010
Location: Amsterdam
Distribution: MX Linux (21)/ XFCE
Posts: 212

Rep: Reputation: 69
Why no dd?

Quote:
Originally Posted by syg00 View Post
Don't use dd. Simple.
I'm curious for the reasons for not using dd. Any alternatives? Or alternative strategies?
I personally prefer dderescue or dcfldd, but basically the do the same job.
 
Old 01-04-2022, 05:18 AM   #8
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,927

Rep: Reputation: 7320Reputation: 7320Reputation: 7320Reputation: 7320Reputation: 7320Reputation: 7320Reputation: 7320Reputation: 7320Reputation: 7320Reputation: 7320Reputation: 7320
Quote:
Originally Posted by remmilou View Post
I'm curious for the reasons for not using dd. Any alternatives? Or alternative strategies?
I personally prefer dderescue or dcfldd, but basically the do the same job.
dd is a dangerous tool, it will overwrite everything without further notice and usually there is no way to recover (just a backup). So if you are unsure don't use it.
Copying 2 partitions in one can work, but need to check a lot of things before. Otherwise the result will be useless.
 
Old 01-04-2022, 05:57 AM   #9
lvm_
Member
 
Registered: Jul 2020
Posts: 942

Rep: Reputation: 338Reputation: 338Reputation: 338Reputation: 338
Quote:
Originally Posted by pan64 View Post
dd is a dangerous tool, it will overwrite everything without further notice and usually there is no way to recover (just a backup).
The same applies to cp - dangerous and to be banned too?
 
Old 01-04-2022, 09:15 AM   #10
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: Rocky Linux
Posts: 4,781

Rep: Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214
Quote:
Originally Posted by pan64 View Post
dd is a dangerous tool, it will overwrite everything without further notice and usually there is no way to recover (just a backup). So if you are unsure don't use it.
Copying 2 partitions in one can work, but need to check a lot of things before. Otherwise the result will be useless.
Quote:
Originally Posted by lvm_ View Post
The same applies to cp - dangerous and to be banned too?
And the same applies to output redirection:
Code:
cat /dev/zero >/dev/sdx
so perhaps output redirection should be avoided, too.

There is nothing inherently dangerous about dd. It's just that dd is typically used to do dangerous things, like using root privileges to write to raw devices. Any method you use for that is going to be "dangerous".

Last edited by rknichols; 01-04-2022 at 09:23 AM.
 
1 members found this post helpful.
Old 01-04-2022, 09:28 AM   #11
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,927

Rep: Reputation: 7320Reputation: 7320Reputation: 7320Reputation: 7320Reputation: 7320Reputation: 7320Reputation: 7320Reputation: 7320Reputation: 7320Reputation: 7320Reputation: 7320
Quote:
Originally Posted by lvm_ View Post
The same applies to cp - dangerous and to be banned too?
I did not tell dd is banned. And actually you cannot cp two partitions "in one", or at least it is even harder, and quite unusual (and actually yes, cp should not be used to copy two partitions in one step).

You can read a lot about it here: https://www.linuxquestions.org/quest...ommand-362506/ (why and how dd can be dangerous - and also you can check if the same applies to cp, cat or any other command).

Last edited by pan64; 01-04-2022 at 09:39 AM.
 
1 members found this post helpful.
Old 01-04-2022, 12:17 PM   #12
lvm_
Member
 
Registered: Jul 2020
Posts: 942

Rep: Reputation: 338Reputation: 338Reputation: 338Reputation: 338
I was being sarcastic and my question was purely rhetorical. I am just not at all keen on things being called dangerous because they do exactly what you told them to do.

Also, OP was asking not about merging two partitions but about parallel copying n partitions to n destinations.
 
Old 01-04-2022, 01:18 PM   #13
newbiesforever
Senior Member
 
Registered: Apr 2006
Location: Iowa
Distribution: Debian distro family
Posts: 2,378

Original Poster
Rep: Reputation: Disabled
Those who want to persist in heated debate whether dd should be used at all, would you please start your own thread. Otherwise, you're starting to drag my thread off topic.

Last edited by newbiesforever; 01-04-2022 at 01:24 PM.
 
  


Closed Thread



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
crontab once per week and once per month? qwertyjjj Linux - Newbie 3 12-15-2011 04:54 AM
one cpu ,two monitor, two keyboard, two mice..any help?? jeevanism Linux - Networking 9 01-04-2011 08:14 AM
any reason I shouldn't use a flash drive? newbiesforever General 17 08-09-2009 03:40 PM
Knoppix booted once, and only once... abowling Debian 7 02-29-2004 09:31 PM
Partitions, partitions, partitions..... Clueless in VA Linux - Newbie 7 08-08-2001 03:01 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 12:09 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