To create a partition using fdisk, follow these steps:
-
Open a terminal and start
fdiskwith the appropriate disk device. Replace/dev/sdXwith your actual disk (e.g.,/dev/sda):sudo fdisk /dev/sdX -
Inside the
fdiskprompt, use the following commands:- Type
nto create a new partition. - Follow the prompts to specify the partition type (primary or extended), partition number, and size.
- After setting up the partition, type
wto write the changes and exit.
- Type
-
If you need to delete a partition, you can use the
dcommand. -
Always ensure you have backed up important data before modifying partitions, as changes can lead to data loss.
Remember, these commands will not work in a virtual environment where actual disk partitions cannot be modified.
