Cfdisk


From Linuxconfig.org

Jump to: navigation, search

.. 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
Image:cfdisk01.gif
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
Image:cfdisk02.gif

navigate to new and press enter:

Image:cfdisk03.gif

enter "Primary"

Image:cfdisk04.gif

cfdisk is asking for a size of partition in MB.

Image:cfdisk05.gif

press enter

Image:cfdisk06.gif

Choose Beginning and press Enter:

Image:cfdisk07.gif

First partition is ready, now we will create swap partition: With arrow down navigate to "Free Space" and select "New"

Image:cfdisk08.gif

Press Enter:

Image:cfdisk09.gif

enter "Primary"

Image:cfdisk10.gif

enter size 64

Image:cfdisk11.gif

enter

Image:cfdisk12.gif

Choose Beginning and press Enter:

Image:cfdisk13.gif

Now we need to change partition type to swap, with arrows navigate to "Type" and press enter:

Image:cfdisk14.gif

Press any key and you will see that swap partition has ID: 82

Image:cfdisk15.gif

Press enter and type 82

Image:cfdisk16.gif

Enter:

Image:cfdisk17.gif

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"

Image:cfdisk18.gif

Select Logical and press enter:

Image:cfdisk19.gif

enter size 1000

Image:cfdisk20.gif

enter:

Image:cfdisk21.gif

Choose Beginning and press Enter:

Image:cfdisk22.gif

Partition table is ready all we need to do now is to write changes. With arrows navigate to "write" press enter and type "yes":

Image:cfdisk23.gif

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
Image:cfdisk24.gif

.. back to the list of Linux Commands

Personal tools
Linux Commands