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...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.