Friday, June 20, 2014

new cfdisk (util-linux v2.25)

cfdisk is a popular ncurses partitioning tool. Unfortunately, it has been ignored by developers for many many years. The original version does not a have clue
about 4K disks, modern disk I/O limits (alignment offset, optimal I/O sizes, etc),
and it was all about MBR (DOS) only.

It was impossible to improve the old code by refactoring, so the new version is written from scratch. The new cfdisk is based on on the same code like fdisk, so it shares all the necessary features required for new disks and it supports MBR, GPT, SGI and SUN disk labels. Some features have been removed:
  • it does not have a clue about CHS addressing any more
  • it's impossible to play any games with disk geometry (use fdisk if you believe that CHS setting makes any sense)
  • 'm' command (maximize disk usage of the current partition) is not implemented
  • 'p' command and --print command line option are not implemented (use partx or lsblk)
  •  'u' (units) command is not implemented, all is based on sectors or real sizes
The idea is to keep cfdisk pretty simple and easy to use for end users. Advanced users or users who want to do some unusual things have to use fdisk or parted.

New features:
  • output formatting based on libsmartcols
  • tree-like output for MBR extended and logical partitions
  • show free space on place where the gap is really located
  • colors
  • new 's'ort command to reorder partition according to start sectors
  • partitions aligned to I/O limits, 1MiB start offset, etc.
  • it's still possible to recompile with slang library (although I personallyprefer ncursesw)

For full size screenshots see g+

What next? sfdisk and stable public API fro libfdisk... let's wait for v2.26 :-)