Can you create a partition in a usb disk using fdisk command in a single line.

fdisk command is interactive in nature, But I want to automate partition creation in a single line using fdisk command.

link|improve this question

29% accept rate
feedback

3 Answers

You probably need to use the parted command instead of fdisk.

link|improve this answer
feedback

sfdisk also has a non-interactive mode that reads in partition information from stdin. parted is more flexible, though.

link|improve this answer
feedback

Use sfdisk instead.

The sfdisk man page is a little confusing, here's some specific examples of how to automate partition setup with sfdisk. One example is you can save the partition info from one drive via sfdisk -l and then dump that directly on to a new drive.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.