Tuesday, September 17, 2013

Creating fdisk partition - Through script

fdisk command operation can be done through script (or) in a command line method. fdisk accepts commands through stdin. Below appropriate command can used with fdisk
  • fdisk to clear a partition (if exists) and create a new partition which is entire disk 
                  (echo o; echo n; echo p; echo 1; echo ; echo; echo w) | fdisk
  • fdisk to create a partition of 200MB size
                  (echo n; echo p; echo 1; echo 1; echo 200; echo w) | fdisk /dev/sdc

No comments:

Post a Comment