Use the fdisk command to prepare a new hard drive with one or more partitions. fdisk is not the most intuitive Linux command but it can be used to quickly prepare a hard drive for use.
Don't overwrite the partition you're running on
If you need to repartition a hard drive that's already in use, be sure to unmount it first. If it is ever necessary to repartition the hard drive you have / mounted on, you should boot into single user mode first.
▸ For more information on run levels, see page 355.
Log in as the root operator. Use the fdisk command to prepare and partition a hard drive by specifying the drive's device name on the command line:
# fdisk /dev/sda Command (m for help): m