How do I copy a partition table to a new drive ?
Posted on 2004-08-04
I'm trying to work out how to do something on Linux that I can currently do on FreeBSD.
I want to copy the partition table from one device (say /dev/sda) to another device of the same size (say /dev/sdb).
On FreeBSD I can do this by using disklabel -w to write a disklabel that I got from disklabel /dev/driveid.
I can get the base output I want in Linux by doing fdisk -l /dev/sda. I then have to edit this and change all occurances of sda to sdb, a step I don't need to do in FreeBSD because partition tables are separate to labels. Now I have a file with all of my partition information, how do I put this onto a drive (e.g. sdb) ?