[SOLVED] any reason I shouldn't dd two partitions at once?
Linux - SoftwareThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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.
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.
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...
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.
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.
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_
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".
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).
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.
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.