Cloning Ubuntu over network











up vote
3
down vote

favorite
2












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




























    up vote
    3
    down vote

    favorite
    2












    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


























      up vote
      3
      down vote

      favorite
      2









      up vote
      3
      down vote

      favorite
      2






      2





      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















      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?







      installation file-sharing nfs dd cloning






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Apr 13 '17 at 12:23









      Community

      1




      1










      asked Jul 19 '13 at 16:46









      savick01

      1286




      1286






















          2 Answers
          2






          active

          oldest

          votes

















          up vote
          5
          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




















          up vote
          1
          down vote













          I can't comment, but I'd like to add to @gertvdijk 's answer that you can use | pv | to show a progress report and it is also wise to add explicit buffer size bs=8M (e.g.) to speed things up (default is 512 bytes which is pretty small). The size depends on your hardware and if you're cloning on local gigabit network or a slower connection. The final command on the receiving end could look like this (add sudo if needed):



          nc -l 5678 | dd if=/dev/stdin | pv | of=/dev/sda bs=8M





          share|improve this answer








          New contributor




          Alex is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
          Check out our Code of Conduct.


















            Your Answer








            StackExchange.ready(function() {
            var channelOptions = {
            tags: "".split(" "),
            id: "89"
            };
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function() {
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled) {
            StackExchange.using("snippets", function() {
            createEditor();
            });
            }
            else {
            createEditor();
            }
            });

            function createEditor() {
            StackExchange.prepareEditor({
            heartbeatType: 'answer',
            convertImagesToLinks: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader: {
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            },
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            });


            }
            });














             

            draft saved


            draft discarded


















            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f321956%2fcloning-ubuntu-over-network%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            2 Answers
            2






            active

            oldest

            votes








            2 Answers
            2






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes








            up vote
            5
            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

















            up vote
            5
            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















            up vote
            5
            down vote



            accepted







            up vote
            5
            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












            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












            share|improve this answer



            share|improve this answer










            answered Jul 19 '13 at 16:56









            gertvdijk

            49.6k18140234




            49.6k18140234












            • 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




















            • 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


















            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




            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




            @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




            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






            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














            up vote
            1
            down vote













            I can't comment, but I'd like to add to @gertvdijk 's answer that you can use | pv | to show a progress report and it is also wise to add explicit buffer size bs=8M (e.g.) to speed things up (default is 512 bytes which is pretty small). The size depends on your hardware and if you're cloning on local gigabit network or a slower connection. The final command on the receiving end could look like this (add sudo if needed):



            nc -l 5678 | dd if=/dev/stdin | pv | of=/dev/sda bs=8M





            share|improve this answer








            New contributor




            Alex is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
            Check out our Code of Conduct.






















              up vote
              1
              down vote













              I can't comment, but I'd like to add to @gertvdijk 's answer that you can use | pv | to show a progress report and it is also wise to add explicit buffer size bs=8M (e.g.) to speed things up (default is 512 bytes which is pretty small). The size depends on your hardware and if you're cloning on local gigabit network or a slower connection. The final command on the receiving end could look like this (add sudo if needed):



              nc -l 5678 | dd if=/dev/stdin | pv | of=/dev/sda bs=8M





              share|improve this answer








              New contributor




              Alex is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
              Check out our Code of Conduct.




















                up vote
                1
                down vote










                up vote
                1
                down vote









                I can't comment, but I'd like to add to @gertvdijk 's answer that you can use | pv | to show a progress report and it is also wise to add explicit buffer size bs=8M (e.g.) to speed things up (default is 512 bytes which is pretty small). The size depends on your hardware and if you're cloning on local gigabit network or a slower connection. The final command on the receiving end could look like this (add sudo if needed):



                nc -l 5678 | dd if=/dev/stdin | pv | of=/dev/sda bs=8M





                share|improve this answer








                New contributor




                Alex is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                Check out our Code of Conduct.









                I can't comment, but I'd like to add to @gertvdijk 's answer that you can use | pv | to show a progress report and it is also wise to add explicit buffer size bs=8M (e.g.) to speed things up (default is 512 bytes which is pretty small). The size depends on your hardware and if you're cloning on local gigabit network or a slower connection. The final command on the receiving end could look like this (add sudo if needed):



                nc -l 5678 | dd if=/dev/stdin | pv | of=/dev/sda bs=8M






                share|improve this answer








                New contributor




                Alex is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                Check out our Code of Conduct.









                share|improve this answer



                share|improve this answer






                New contributor




                Alex is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                Check out our Code of Conduct.









                answered Nov 24 at 14:39









                Alex

                111




                111




                New contributor




                Alex is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                Check out our Code of Conduct.





                New contributor





                Alex is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                Check out our Code of Conduct.






                Alex is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                Check out our Code of Conduct.






























                     

                    draft saved


                    draft discarded



















































                     


                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function () {
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f321956%2fcloning-ubuntu-over-network%23new-answer', 'question_page');
                    }
                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    Category:香港粉麵

                    List *all* the tuples!

                    Channel [V]