<div dir="ltr"><div>Respected Sir/Mam,</div><div><br></div>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.<div>
<br></div><div>My command are as follows :-</div><div>1. parted /dev/sdb mklabel gpt</div><div>2. parted /dev/sdb mkpart logical 7168s 5638312959s</div><div>3. parted /dev/sda name 1 TEMP-1<br clear="all"><div><br></div><div>
I can put all these command directly in shell script.</div><div><br></div><div>But for 1st command <b>parted /dev/sdb mklabel gpt , </b>it will ask me </div><div><div><b>Warning: The existing disk label on /dev/sdb will be destroyed and all data on this disk will be lost. Do you want</b></div>
<div><b>to continue?</b></div><div><b>Yes/No?</b></div><div>if I say yes then</div><div><b>New disk label type?  [msdos]?</b><br></div><div><br></div><div>But all these become interactive. Also if I use <b>-s</b> then it will </div>
<div>Instead of that is there any way to pass these answer to command through file.</div><div>I don't want to use any third party tool like <b>expect</b></div><div><b><br></b></div><div>I was trying to pass all command through file to parted but it wont work.</div>
<div>> cat parted.txt</div><div>/dev/sdb</div><div>mklabel</div><div>gpt</div><div>yes</div><div>gpt</div><div><br></div><div>> parted < parted.txt</div><div><br></div><div>So please suggest me way to automate these answer as early as possible.</div>
<div>Thanks in advance.</div>-- </div>Sagar Dilip Shedge,<br>Pune.<br><div> </div>
<div>With Regards.</div><div> </div>
</div></div>