Avatar of NetRock6
NetRock6
Flag for Canada asked on

Parted Layout

I used gpart live CD to create attached partitions, since I have to run it on may PCs, can someone help to make bash script to create gpt partition with the attached layout and file systems.
 Thanks
Shell ScriptingLinuxScripting Languages

Avatar of undefined
Last Comment
NetRock6

8/22/2022 - Mon
Gerwin Jansen

Hello, I see no attachment?
Darr247

And do you mean GParted Live ?
Gerwin Jansen

I'd be using parted btw to create such a script, not gparted (graphical). For batch files, command-line parted would be better.
Your help has saved me hundreds of hours of internet surfing.
fblack61
ahoffmann

man fdisk
man parted
man gdisk
NetRock6

ASKER
I see, here is the attachment.
just looking for Bash Script to automate the process.
Yes is the gparted live CD.
Sda1 is the /Boot
sda2 is /
Sda3 is swap i have 4Gib of memory.
sda8 is fat
sda4-sda7 are Linux partitions

Thank you in advance.
Partl.JPG
Darr247

Who told you it needs to be gpt instead of mbr?

Are you sure you don't just need to run
$ blkid
to find out the UUIDs for something?
Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.
ASKER CERTIFIED SOLUTION
Rick Hobbs

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
NetRock6

ASKER
Thanks, this is a golden way for two live HDD or raids but in my case this method simply does not work because there is no HDD to copy from the Gpt partition layout
Gerwin Jansen

>> there is no HDD to copy from the Gpt partition layout
Then you could create one 'sample' machine and create the initial layout for copying.

You are about to run this on a bunch of machines, right?
NetRock6

ASKER
I tried to backup the partition table and restore using the following:
To backup I used:
# parted -ms /dev/sda print > sda.parted
Restore:
#sgdisk -R=/dev/sdb  sda.parted

But I get warnings/errors : file size is not multiple of 512 bytes! Misbehavior is likely!
Error 25; strange behavior

Also there is another option like sgdisk -l -w.  

Any help appreciated.
All of life is about relationships, and EE has made a viirtual community a real community. It lifts everyone's boat
William Peck