Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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?

share|improve this question

1 Answer 1

up vote 3 down vote accepted

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.

share|improve this answer
    
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
    
0. I already upvoted it and will accept when test (now I have no internet cable available and wifi is too slow(-:). 1. AFAIK discussion questions are not welcome at SE sites, so I just asked for your opinion via comment. 2. 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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.