fdisk partitioning

Is there a way to export a partition table to a file using fdisk, and then import that partition table on another disk?  I know I could create a file with the commands to create the tables and pipe that to stdin for fdisk.  Is there another way of accomplishing this?  I am looking for something analogous to /etc/format.dat on a solaris system.
Who is Participating?
I wear a lot of hats...


MarkLead Sales Engineer - Public SectorCommented:
How about:

cat /proc/partitions
brewskiAuthor Commented:
You cannot use /etc/partitions with fdisk to setup a disk.
MarkLead Sales Engineer - Public SectorCommented:
/proc/partitions (not /etc/partitions) would give you the current fdisk information. You can redirect the output to a file, or could pass it through and of grep, cut, sed, or awk to glean only that information that you want. The resultant file that you redirect everything to could be an actual executable script to do all of the work.

And, BTW - you could probably do the automated disk setup piece more easily with parted instead of fdisk.

Experts Exchange Solution brought to you by

Your issues matter to us.


Start your 7-day free trial

From novice to tech pro — start learning today.