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.

vfclists
  • 1,632
  • 5
  • 22
  • 37

1 Answers1

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.

petr0
  • 313
  • 1
  • 2
  • 8