3

I want to migrate with my 12.04 to another machine. I have found the way with dd and hope it will work for me. The thing is that I have to somehow connect both drives to do the actual cloning. I'm trying NFS. When I write in /etc/exports:

/dev/sda1 10.42.0.16(rw,async,subtree_check)

and invoke exportfs -a I end up with the following error:

exportfs: /dev/sda1 is neither a directory nor a file. Remote access will fail

Any clues how I can overcome the problem? Is it a matter of configuration or NFS is a dead end and I have to use something different?

savick01
  • 143

2 Answers2

7

On the receiver end:

nc -l 5678 | sudo dd if=/dev/stdin of=/dev/sda

Then on the sender end:

sudo dd if=/dev/sda of=/dev/stdout | nc 1.2.3.4 5678

This copies sda from one PC to another over the network to IP 1.2.3.4 and port 5678. Be sure to install one of the nc packages (just run nc in the terminal and you will get the suggestion if not installed yet.)

Also make sure not any volume on either of the sda drives has a filesystem mounted, so run off a live CD on both ends if you're unsure.

gertvdijk
  • 67,947
  • Thank you very much! It was so easy:)

    In the meantime I started doubting if cloning is such a good idea. I will copy all the drivers and randomly installed packages from the 'sender' machine. What do you think? Is it healthy to reinstall the system from time to time to make it work better or I can just make a clone and enjoy everything working immediately?

    – savick01 Jul 19 '13 at 19:08
  • @savick01 That's a new question - please ask it as such. And if you think this was useful, then consider marking it as correct. – gertvdijk Jul 19 '13 at 22:28
  • I already upvoted it and will accept when test (now I have no internet cable available and wifi is too slow(-:).
  • AFAIK discussion questions are not welcome at SE sites, so I just asked for your opinion via comment.
  • If you think it fits here, I can ask it, but there already is a similar question here. Would you be so kind to post your opinion there including the 'healthy or unnecessary to reinstall' part?
  • – savick01 Jul 19 '13 at 22:46
  • Yeah! Everything works perfectly! And the cloning process was very fast - much faster than normal copying files. I think it was a good decision to make a clone. P.S. I disabled proprietary drivers before clone just in case. – savick01 Jul 21 '13 at 14:15