Linux – cfdisk or fdisk

cfdiskcommand linefdisklinux

While reading the man page for fdisk I came across this interesting text:

There are several *fdisk programs around. Each has its problems and strengths. Try them in the order
cfdisk, fdisk, sfdisk. (Indeed, cfdisk is a beautiful program that has strict requirements on the parti‐
tion tables it accepts, and produces high quality partition tables. Use it if you can. fdisk is a buggy
program that does fuzzy things – usually it happens to produce reasonable results. Its single advantage is
that it has some support for BSD disk labels and other non-DOS partition tables. Avoid it if you can.
sfdisk is for hackers only — the user interface is terrible, but it is more correct than fdisk and more
powerful than both fdisk and cfdisk. Moreover, it can be used noninteractively.)

I notice that the option formats are not the same for the two applications:

 - melancholy():/$ sudo fdisk -l

Disk /dev/sda: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders, total 976773168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x00036f1b

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *        2048    39063551    19530752   83  Linux
/dev/sda2        39063552   976771071   468853760   83  Linux

Disk /dev/sdb: 2000.4 GB, 2000398934016 bytes
255 heads, 63 sectors/track, 243201 cylinders, total 3907029168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x00000000

Disk /dev/sdb doesn't contain a valid partition table

Disk /dev/sdc: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders, total 1953525168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x00085251

   Device Boot      Start         End      Blocks   Id  System
/dev/sdc1            2048    15624191     7811072   82  Linux swap / Solaris
/dev/sdc2   *    15624192    64452607    24414208   83  Linux
/dev/sdc3        64454654  1953523711   944534529    5  Extended
Partition 3 does not start on physical sector boundary.
/dev/sdc5        64454656  1953523711   944534528   83  Linux
 - melancholy():/$ sudo cfdisk -l
cfdisk: invalid option -- 'l'

Usage:
Print version:
        cfdisk -v
Print partition table:
        cfdisk -P {r|s|t} [options] device
Interactive use:
        cfdisk [options] device

Options:
-a: Use arrow instead of highlighting;
-z: Start with a zero partition table, instead of reading the pt from disk;
-c C -h H -s S: Override the kernel's idea of the number of cylinders,
                the number of heads and the number of sectors/track.

Copyright (C) 1994-2002 Kevin E. Martin & aeb

Is there real merit in switching to using cfdisk instead of fdisk, or is the man page note a historical observation that is no longer valid? Since fdisk works fine for listing the disks info (-l flag) should I use cfdisk only for altering the partitions and partition tables? What are the real strengths and weaknesses of each application?

Best Answer

cfdisk is a graphical application designed to be more friendly to the novice. If you are comfortable with fdisk, then by all means, use it. If you prefer a bit more hand holding and fewer ( advanced ) options, use cfdisk. Another good alternative is GNU parted.

Related Question