I have two the same capacity drives (equal to 1 byte). I need to swap their content (one is QVO, other one is EVO, but the selection of their application was mistaken).
Is it possible to do that by pipes or FIFO in Linux?
I am thinking about eventually storing 100/500 MB of each drive at one moment (on Linux drive or in memory) and rewrite it but to the other disk, repeating the process.
I know dd and third disk but need to operate only on these two. Both disks are 1 TB SSD, where one is 70% full, and the other has basic Linux system with no more than 20 GB of data.
I agree that there is third medium with OS (in this case Linux) but this disk has limited free space, let's say we can use up to ~1 GB so we can't make full disk image (even compressed).
~/block.infois not yet synced to the disk? How to recover from a read error, if one occurs? And if I'm not mistaken,breakleads torm. This is fatal, data gets lost. I don't want to downvote, the answer has a potential; but I wouldn't use it in its current form. (Side note: quote!) – Kamil Maciorowski May 14 '20 at 16:32breakis the exit of thewhile true;loop and thermwas the cleanup, this was just how it was meant to be. Now it has to be cleaned up manually. ;-) – bey0nd May 14 '20 at 17:56ddfailed for some unexpected reason, you would lose the temporary file. The original chunk would have already been overwritten by the seconddd, the file would be the only copy, now gone. You need to anticipate such things. – Kamil Maciorowski May 14 '20 at 18:08blockis missing $ sign. Seems like the other answer is proper for safe swap, but not the answer to the question. – pbies May 14 '20 at 18:18blockare you referring to? A name of a variable within $(( )) doesn't require a$sign ! – bey0nd May 14 '20 at 18:19