[parted-devel] Automate parted command

Sagar Shedge sagar.shedge92 at gmail.com
Mon Feb 3 08:34:47 UTC 2014


Respected Sir/Mam,

I want to make paritition creation using automate script. This script
should avoid interaction and respond all question for parted command.
Previous there will be msdos type partition table.

My command are as follows :-
1. parted /dev/sdb mklabel gpt
2. parted /dev/sdb mkpart logical 7168s 5638312959s
3. parted /dev/sda name 1 TEMP-1

I can put all these command directly in shell script.

But for 1st command *parted /dev/sdb mklabel gpt , *it will ask me
*Warning: The existing disk label on /dev/sdb will be destroyed and all
data on this disk will be lost. Do you want*
*to continue?*
*Yes/No?*
if I say yes then
*New disk label type?  [msdos]?*

But all these become interactive. Also if I use *-s* then it will
Instead of that is there any way to pass these answer to command through
file.
I don't want to use any third party tool like *expect*

I was trying to pass all command through file to parted but it wont work.
> cat parted.txt
/dev/sdb
mklabel
gpt
yes
gpt

> parted < parted.txt

So please suggest me way to automate these answer as early as possible.
Thanks in advance.
-- 
Sagar Dilip Shedge,
Pune.

With Regards.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.alioth.debian.org/pipermail/parted-devel/attachments/20140203/d5805387/attachment.html>


More information about the parted-devel mailing list