+ (match p.p_type with
+ | ContentUnknown | ContentPV _ | ContentFS _ ->
+ g#copy_device_to_device ~size:copysize source target
+
+ | ContentExtendedPartition ->
+ (* You can't just copy an extended partition by name, eg.
+ * source = "/dev/sda2", because the device name only covers
+ * the first 1K of the partition. Instead, copy the
+ * source bytes from the parent disk (/dev/sda).
+ *)
+ let srcoffset = p.p_part.G.part_start in
+ g#copy_device_to_device ~srcoffset ~size:copysize "/dev/sda" target
+ )