I have a running server with /dev/sda1 partition and a remote server with /dev/sda1 partion also. I want to clone the partition of running server to remote server.

I want to try this:

On remote server:

nc -l -p 2000 | bzip2 -d | dd of=/dev/sda1

On running server:

bzip2 -c /dev/sda1 | nc 2000

It's the right way or there are some others better solutions?

  • Make sure it is umounted before reading from the block device. – Grogi Jul 11 '18 at 20:41
  • You mean the running server partition? What happens if isn't unmounted? – ELK2 Jul 11 '18 at 20:57
  • You don't get a clean copy because the running system can write to it after you've attempted to copy the partition. – Michael Hampton Jul 11 '18 at 21:26
  • I doubt it's the right way, but before getting into details, please let us know if sda1 hold a mounted filesystem and, if yes, which one (mount point, filesystem type and brief description of contained data). Also, It would be useful to know what is "exactly" your problem. I mean: the problem you're trying to solve with such a low-level copy (a backup? A D/R Plan? A simple "exercise"? A network test? A migration?) – Damiano Verzulli Jul 12 '18 at 5:21
  • The running server filesystem is ext3 type with RAID 10 mode and is a running server with debian operating system. It is a monitoring server and the remote server was identical. After a disk corruption we need to restore the same data into remote server with the identical configuration of running server. – ELK2 Jul 12 '18 at 8:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.