1

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?

3
  • 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. Jul 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?
    – sawdust
    Jul 28, 2020 at 18:47
  • @sawdust I want to clone it to another computer as practical as possible.
    – user215422
    Jul 28, 2020 at 18:58

1 Answer 1

0
# 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

source

You may not want to use bzip2 though

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .