Cfdisk
|
From Linuxconfig.org
.. back to the list of Linux Commands
Name
cfdisk - Curses based disk partition table manipulator for Linux
Synopsis - man page
cfdisk [ -agvz ] [ -c cylinders ] [ -h heads ] [ -s sectors-per-track ]
[ -P opt ] [ device ]
Examples
# fdisk -l /dev/sdb
Disk /dev/sdb doesn't contain a valid partition table
So let's create valid partition table. In this example we are going to use cfdisk to create partitions on our /dev/sdb hardisk. We will create:
- /dev/sdb1 - 500MB ( primary Linux partition ID:83)
- /dev/sdb2 - 64MB ( primary swap partition ID:82)
- /dev/sdb5 - 1GB ( logical Linux partition ID:83)
NOTE: cdfisk can be only run as a superuser
# cfdisk /dev/sdb
navigate to new and press enter:
enter "Primary"
cfdisk is asking for a size of partition in MB.
press enter
Choose Beginning and press Enter:
First partition is ready, now we will create swap partition: With arrow down navigate to "Free Space" and select "New"
Press Enter:
enter "Primary"
enter size 64
enter
Choose Beginning and press Enter:
Now we need to change partition type to swap, with arrows navigate to "Type" and press enter:
Press any key and you will see that swap partition has ID: 82
Press enter and type 82
Enter:
Swap partition is ready, now we create logical partition which always starts with partition number 5. With arrow down navigate to "Free Space" and select "New"
Select Logical and press enter:
enter size 1000
enter:
Choose Beginning and press Enter:
Partition table is ready all we need to do now is to write changes. With arrows navigate to "write" press enter and type "yes":
our partitions are ready. Navigate to quit and press enter. Lets run again fdisk command to confirm that partions are ready:
# fdisk -l /dev/sdb






































