DD multiple input, single output file?
I have 2 SSD's in my desktop /dev/sda + /dev/sdb Previous to the installation of the 2nd drive, I would simply;
if=/dev/sda of=/dev/sdb. sdb was my external backup drive Is there a way to if=/dev/sda + /dev/sdb of=/dev/sdc ? |
Probably not. You'd make ground beef out of your backup.
|
Read the manpage for dd.
Sounds suspiciously like a xyproblem. |
dd would be a wrong choice for this unless you did dd to a file from each device. I guess you could tar them together or copy them binary but you'd end up making the deal too complex.
dd is a choice for backup's but not a great tool for everyday use. dd command sda to some file then dd command sdb to some file on sdc, you can add in compression to make it smaller. You could zero out free space on drives to make the image smaller too. |
Why not use rsync?
|
I think the OP could use rsync if the data is only file data. dd captures the entire data on the device in his syntax. dd can be used for many things but almost no one uses it for files.
|
Now your external drive is sdc? Is it bigger than the sum of the old-ssd sda + new-ssd sdb?
Consider (post) the sizes of your partitions (fdisk -l)... IF you had just one each, sda1&sdb1, you could make two same-sized partitions on sdc & dd sda1 to sdc1 and sdb1 to sdc2 (tho sdc wouldn't be bootable: MBR before 1st partition) I know zero about UEFI/GPT and SSDs (just old hdd); I see you are a LONG-time Linux'er! |
Quote:
Try for example: Code:
mount /dev/sdc into /mnt/sdc |
Quote:
Very likely you would end up with garbage. Dumping /dev/sda contains all the partition definitions and the data. Appending another set of partition definitions and data only confuses the result. You can't restore the result - well, you could restore /dev/sda (it would error out when the device is full) , But estoring /dev/sdc from it would require you to know the starting point. Now said you wanted was an output put on /dev/sdc - and no it won't work. The partition definitions only come at the beginning of the disk - thus the /dev/sdb portion would still be inaccessible. You CAN concatenate multiple inputs. The easiest way is Code:
(dd if=inputdata ; dd if=moreinputdata) >outputdata In your case the result won't be usable. You can't even do a "dd if=/dev/sda of=/dev/sdc1" for instance either... UNLESS there are no partitions on /dev/sda. Again, the problem is the partition tables. If /dev/sda has partitions, then the first blocks copied to /dev/sdc1 will be the partition table - not the filesystem home block, thus the partition will not have a valid filesystem. The only time this would work is if /dev/sda was not partitioned, but was entirely dedicated to a single filesystem. It works then because the first blocks copied would be the home block of the filesystem. |
All times are GMT -5. The time now is 06:42 AM. |