0

Is there a tool that can read the partitioning information of a disk and partition another disk based on that information?

I don't know whether parted for instance can partition a disk based on a script, or whether there is a tool that can read a partition table and create a script that parted might be able to use, but I am interested in something like that if it exists.

3
  • so we're trying to get the same sized partitions, same types, but without the content of them? Oct 18, 2012 at 11:59
  • @JourneymanGeek yes
    – vfclists
    Oct 18, 2012 at 12:20
  • parted should do it. it can print out partitions in any unit you want, and then more invocations of parted would recreate it step by step.
    – Marcin
    Oct 18, 2012 at 14:08

1 Answer 1

2

I'm probably late, but anyway.. Copying partition table from sda to sdb:

Copy mbr and partition table of sda to files:

dd if=/dev/sda of=sda.mbr count=1 bs=512
sfdisk -d /dev/sda > sda.sf

Copy it from files to another drive (here sdb):

dd if=sda.mbr of=/dev/sdb
sfdisk /dev/sdb < sda.sf

If you don't need mbr skip the dd lines.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .