2

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?

kuzko
  • 58

1 Answers1

1

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: