I have a computer with Linux (A) and another computer with a formatted hard disk(B). If I connect two computers with LAN cable, how can I write the disk-image of computer A to computer B using the dd command?
-
You might be able to use the NBD (network block device) protocol to do this. I hope you need like 10,000 of them because this is FAR more trouble than it is worth.– Señor CMasMasJul 28, 2020 at 16:39
-
Copying the image of a disk drive with active (i.e. mounted) filesystem(s) is a bad idea. Why do you mention that the destination drive is formatted? Do you intend to replace that filesystem, or write the image as a file?– sawdustJul 28, 2020 at 18:47
-
@sawdust I want to clone it to another computer as practical as possible.– user215422Jul 28, 2020 at 18:58
Add a comment
|
1 Answer
# destination machine:
nc -l -p 19000 | bzip2 -d | dd bs=16M of=/dev/sda
# source machine:
dd bs=16M if=/dev/sda | bzip2 -c | nc 192.168.100.2 19000
You may not want to use bzip2 though