move partition from one disk to another from the Windows CLI












1















As the title says, I'm looking for a way to move let's say partition 1 on disk of Id 1 to partition 2 on disk 2...



The Windows cmd diskpart options doesn't mention a copy or move option, the Powershell storage cmdlets have no such option either.
C.F. https://technet.microsoft.com/fr-fr/library/hh848705(v=wps.630).aspx



The DISM utility has only the Capture Image capability and other tools are often accessible only by GUI.



I would like to automate that partition moving process, what command should I look into?










share|improve this question



























    1















    As the title says, I'm looking for a way to move let's say partition 1 on disk of Id 1 to partition 2 on disk 2...



    The Windows cmd diskpart options doesn't mention a copy or move option, the Powershell storage cmdlets have no such option either.
    C.F. https://technet.microsoft.com/fr-fr/library/hh848705(v=wps.630).aspx



    The DISM utility has only the Capture Image capability and other tools are often accessible only by GUI.



    I would like to automate that partition moving process, what command should I look into?










    share|improve this question

























      1












      1








      1








      As the title says, I'm looking for a way to move let's say partition 1 on disk of Id 1 to partition 2 on disk 2...



      The Windows cmd diskpart options doesn't mention a copy or move option, the Powershell storage cmdlets have no such option either.
      C.F. https://technet.microsoft.com/fr-fr/library/hh848705(v=wps.630).aspx



      The DISM utility has only the Capture Image capability and other tools are often accessible only by GUI.



      I would like to automate that partition moving process, what command should I look into?










      share|improve this question














      As the title says, I'm looking for a way to move let's say partition 1 on disk of Id 1 to partition 2 on disk 2...



      The Windows cmd diskpart options doesn't mention a copy or move option, the Powershell storage cmdlets have no such option either.
      C.F. https://technet.microsoft.com/fr-fr/library/hh848705(v=wps.630).aspx



      The DISM utility has only the Capture Image capability and other tools are often accessible only by GUI.



      I would like to automate that partition moving process, what command should I look into?







      windows command-line partitioning powershell automation






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Oct 5 '16 at 16:05









      kuzkokuzko

      28112




      28112






















          1 Answer
          1






          active

          oldest

          votes


















          0














          You can't really copy a "partition", as a partition is just marking a section of disk off to be used for holding a file system, which is what's actually holding your data.



          So the general steps would be:




          1. Create new partition.

          2. Format it with desired file system.

          3. Copy data from the existing file system on the existing partition, to the new file system on the new partition.


          There are 3rd party partitioning tools that can help you those steps, such as gPartEd, but it's not really a utility intended for automation.



          Another method for duplicating partitions is "cloning". This is a block by block copy of a section of the drive, done without actually reading the data in the blocks. If you clone a section of the drive that contains the partition (and the file system, and data it holds), you can then stamp that clone onto another drive. The advantage to this is that structurally the files will be in the same relative locations, allowing things like maintaining the boot ability of a partition.



          One of the most popular cloning tools is dd ("Disk Dump"), which is included in most Linux distributions, and there are ports to Windows available.



          Perhaps check these questions/answers out:





          • Using DD for disk cloning (ServerFault)

          • windows equivalent for dd






          share|improve this answer


























          • But there is a big difference between a file based copy and a sector based copy which most partitioning tools use to copy/move partitions.

            – Peter Hahndorf
            Oct 6 '16 at 8:50











          • @PeterHahndorf True, I was trying to keep it general to match the general question about "copying/moving", and to point towards why there's no simple tool included for doing it (or rather, why the partitioning tools don't do file copies). I'll put in a mention about "cloning" as well.

            – Ƭᴇcʜιᴇ007
            Oct 6 '16 at 13:10











          • Turns out, there is a way on Windows to do it, I've been investigating, and because relies heavily on NTFS, and it's system utilities, using DISM, bcdedit or bcdboot, the Windows AIK and a bit of powershell, there should be a way, I'll have an answer when my script is ready. Link to the related Windows documentation msdn.microsoft.com/fr-ch/windows/hardware/commercialize/…

            – kuzko
            Oct 6 '16 at 15:10













          • @kuzko Looking forward to your solution. :)

            – Ƭᴇcʜιᴇ007
            Oct 6 '16 at 16:08











          Your Answer








          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "3"
          };
          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',
          autoActivateHeartbeat: false,
          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%2fsuperuser.com%2fquestions%2f1131769%2fmove-partition-from-one-disk-to-another-from-the-windows-cli%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          0














          You can't really copy a "partition", as a partition is just marking a section of disk off to be used for holding a file system, which is what's actually holding your data.



          So the general steps would be:




          1. Create new partition.

          2. Format it with desired file system.

          3. Copy data from the existing file system on the existing partition, to the new file system on the new partition.


          There are 3rd party partitioning tools that can help you those steps, such as gPartEd, but it's not really a utility intended for automation.



          Another method for duplicating partitions is "cloning". This is a block by block copy of a section of the drive, done without actually reading the data in the blocks. If you clone a section of the drive that contains the partition (and the file system, and data it holds), you can then stamp that clone onto another drive. The advantage to this is that structurally the files will be in the same relative locations, allowing things like maintaining the boot ability of a partition.



          One of the most popular cloning tools is dd ("Disk Dump"), which is included in most Linux distributions, and there are ports to Windows available.



          Perhaps check these questions/answers out:





          • Using DD for disk cloning (ServerFault)

          • windows equivalent for dd






          share|improve this answer


























          • But there is a big difference between a file based copy and a sector based copy which most partitioning tools use to copy/move partitions.

            – Peter Hahndorf
            Oct 6 '16 at 8:50











          • @PeterHahndorf True, I was trying to keep it general to match the general question about "copying/moving", and to point towards why there's no simple tool included for doing it (or rather, why the partitioning tools don't do file copies). I'll put in a mention about "cloning" as well.

            – Ƭᴇcʜιᴇ007
            Oct 6 '16 at 13:10











          • Turns out, there is a way on Windows to do it, I've been investigating, and because relies heavily on NTFS, and it's system utilities, using DISM, bcdedit or bcdboot, the Windows AIK and a bit of powershell, there should be a way, I'll have an answer when my script is ready. Link to the related Windows documentation msdn.microsoft.com/fr-ch/windows/hardware/commercialize/…

            – kuzko
            Oct 6 '16 at 15:10













          • @kuzko Looking forward to your solution. :)

            – Ƭᴇcʜιᴇ007
            Oct 6 '16 at 16:08
















          0














          You can't really copy a "partition", as a partition is just marking a section of disk off to be used for holding a file system, which is what's actually holding your data.



          So the general steps would be:




          1. Create new partition.

          2. Format it with desired file system.

          3. Copy data from the existing file system on the existing partition, to the new file system on the new partition.


          There are 3rd party partitioning tools that can help you those steps, such as gPartEd, but it's not really a utility intended for automation.



          Another method for duplicating partitions is "cloning". This is a block by block copy of a section of the drive, done without actually reading the data in the blocks. If you clone a section of the drive that contains the partition (and the file system, and data it holds), you can then stamp that clone onto another drive. The advantage to this is that structurally the files will be in the same relative locations, allowing things like maintaining the boot ability of a partition.



          One of the most popular cloning tools is dd ("Disk Dump"), which is included in most Linux distributions, and there are ports to Windows available.



          Perhaps check these questions/answers out:





          • Using DD for disk cloning (ServerFault)

          • windows equivalent for dd






          share|improve this answer


























          • But there is a big difference between a file based copy and a sector based copy which most partitioning tools use to copy/move partitions.

            – Peter Hahndorf
            Oct 6 '16 at 8:50











          • @PeterHahndorf True, I was trying to keep it general to match the general question about "copying/moving", and to point towards why there's no simple tool included for doing it (or rather, why the partitioning tools don't do file copies). I'll put in a mention about "cloning" as well.

            – Ƭᴇcʜιᴇ007
            Oct 6 '16 at 13:10











          • Turns out, there is a way on Windows to do it, I've been investigating, and because relies heavily on NTFS, and it's system utilities, using DISM, bcdedit or bcdboot, the Windows AIK and a bit of powershell, there should be a way, I'll have an answer when my script is ready. Link to the related Windows documentation msdn.microsoft.com/fr-ch/windows/hardware/commercialize/…

            – kuzko
            Oct 6 '16 at 15:10













          • @kuzko Looking forward to your solution. :)

            – Ƭᴇcʜιᴇ007
            Oct 6 '16 at 16:08














          0












          0








          0







          You can't really copy a "partition", as a partition is just marking a section of disk off to be used for holding a file system, which is what's actually holding your data.



          So the general steps would be:




          1. Create new partition.

          2. Format it with desired file system.

          3. Copy data from the existing file system on the existing partition, to the new file system on the new partition.


          There are 3rd party partitioning tools that can help you those steps, such as gPartEd, but it's not really a utility intended for automation.



          Another method for duplicating partitions is "cloning". This is a block by block copy of a section of the drive, done without actually reading the data in the blocks. If you clone a section of the drive that contains the partition (and the file system, and data it holds), you can then stamp that clone onto another drive. The advantage to this is that structurally the files will be in the same relative locations, allowing things like maintaining the boot ability of a partition.



          One of the most popular cloning tools is dd ("Disk Dump"), which is included in most Linux distributions, and there are ports to Windows available.



          Perhaps check these questions/answers out:





          • Using DD for disk cloning (ServerFault)

          • windows equivalent for dd






          share|improve this answer















          You can't really copy a "partition", as a partition is just marking a section of disk off to be used for holding a file system, which is what's actually holding your data.



          So the general steps would be:




          1. Create new partition.

          2. Format it with desired file system.

          3. Copy data from the existing file system on the existing partition, to the new file system on the new partition.


          There are 3rd party partitioning tools that can help you those steps, such as gPartEd, but it's not really a utility intended for automation.



          Another method for duplicating partitions is "cloning". This is a block by block copy of a section of the drive, done without actually reading the data in the blocks. If you clone a section of the drive that contains the partition (and the file system, and data it holds), you can then stamp that clone onto another drive. The advantage to this is that structurally the files will be in the same relative locations, allowing things like maintaining the boot ability of a partition.



          One of the most popular cloning tools is dd ("Disk Dump"), which is included in most Linux distributions, and there are ports to Windows available.



          Perhaps check these questions/answers out:





          • Using DD for disk cloning (ServerFault)

          • windows equivalent for dd







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Apr 13 '17 at 12:14









          Community

          1




          1










          answered Oct 5 '16 at 16:14









          Ƭᴇcʜιᴇ007Ƭᴇcʜιᴇ007

          99.3k14156216




          99.3k14156216













          • But there is a big difference between a file based copy and a sector based copy which most partitioning tools use to copy/move partitions.

            – Peter Hahndorf
            Oct 6 '16 at 8:50











          • @PeterHahndorf True, I was trying to keep it general to match the general question about "copying/moving", and to point towards why there's no simple tool included for doing it (or rather, why the partitioning tools don't do file copies). I'll put in a mention about "cloning" as well.

            – Ƭᴇcʜιᴇ007
            Oct 6 '16 at 13:10











          • Turns out, there is a way on Windows to do it, I've been investigating, and because relies heavily on NTFS, and it's system utilities, using DISM, bcdedit or bcdboot, the Windows AIK and a bit of powershell, there should be a way, I'll have an answer when my script is ready. Link to the related Windows documentation msdn.microsoft.com/fr-ch/windows/hardware/commercialize/…

            – kuzko
            Oct 6 '16 at 15:10













          • @kuzko Looking forward to your solution. :)

            – Ƭᴇcʜιᴇ007
            Oct 6 '16 at 16:08



















          • But there is a big difference between a file based copy and a sector based copy which most partitioning tools use to copy/move partitions.

            – Peter Hahndorf
            Oct 6 '16 at 8:50











          • @PeterHahndorf True, I was trying to keep it general to match the general question about "copying/moving", and to point towards why there's no simple tool included for doing it (or rather, why the partitioning tools don't do file copies). I'll put in a mention about "cloning" as well.

            – Ƭᴇcʜιᴇ007
            Oct 6 '16 at 13:10











          • Turns out, there is a way on Windows to do it, I've been investigating, and because relies heavily on NTFS, and it's system utilities, using DISM, bcdedit or bcdboot, the Windows AIK and a bit of powershell, there should be a way, I'll have an answer when my script is ready. Link to the related Windows documentation msdn.microsoft.com/fr-ch/windows/hardware/commercialize/…

            – kuzko
            Oct 6 '16 at 15:10













          • @kuzko Looking forward to your solution. :)

            – Ƭᴇcʜιᴇ007
            Oct 6 '16 at 16:08

















          But there is a big difference between a file based copy and a sector based copy which most partitioning tools use to copy/move partitions.

          – Peter Hahndorf
          Oct 6 '16 at 8:50





          But there is a big difference between a file based copy and a sector based copy which most partitioning tools use to copy/move partitions.

          – Peter Hahndorf
          Oct 6 '16 at 8:50













          @PeterHahndorf True, I was trying to keep it general to match the general question about "copying/moving", and to point towards why there's no simple tool included for doing it (or rather, why the partitioning tools don't do file copies). I'll put in a mention about "cloning" as well.

          – Ƭᴇcʜιᴇ007
          Oct 6 '16 at 13:10





          @PeterHahndorf True, I was trying to keep it general to match the general question about "copying/moving", and to point towards why there's no simple tool included for doing it (or rather, why the partitioning tools don't do file copies). I'll put in a mention about "cloning" as well.

          – Ƭᴇcʜιᴇ007
          Oct 6 '16 at 13:10













          Turns out, there is a way on Windows to do it, I've been investigating, and because relies heavily on NTFS, and it's system utilities, using DISM, bcdedit or bcdboot, the Windows AIK and a bit of powershell, there should be a way, I'll have an answer when my script is ready. Link to the related Windows documentation msdn.microsoft.com/fr-ch/windows/hardware/commercialize/…

          – kuzko
          Oct 6 '16 at 15:10







          Turns out, there is a way on Windows to do it, I've been investigating, and because relies heavily on NTFS, and it's system utilities, using DISM, bcdedit or bcdboot, the Windows AIK and a bit of powershell, there should be a way, I'll have an answer when my script is ready. Link to the related Windows documentation msdn.microsoft.com/fr-ch/windows/hardware/commercialize/…

          – kuzko
          Oct 6 '16 at 15:10















          @kuzko Looking forward to your solution. :)

          – Ƭᴇcʜιᴇ007
          Oct 6 '16 at 16:08





          @kuzko Looking forward to your solution. :)

          – Ƭᴇcʜιᴇ007
          Oct 6 '16 at 16:08


















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Super User!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1131769%2fmove-partition-from-one-disk-to-another-from-the-windows-cli%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

          If I really need a card on my start hand, how many mulligans make sense? [duplicate]

          Alcedinidae

          Can an atomic nucleus contain both particles and antiparticles? [duplicate]