Child pages
  • Physical storage device (HDD, SDD) partitions

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Table of Contents

TODO: somewhere: cgdisk (part of gdisk package) is sweet for GPT as required for > 2 TB and it does 4096 physical sector alignment automatically.

Technical background

Block device partitioning has a long history, related to the physical construction of hard disk drives – to their cylinders, heads and sectors.  Current hard disk drives present themselves to the operating system as a simple sequence of blocks.  For practical partitioning purposes the physical construction no longer matters except that Zone Bit Recording means that a partition at the beginning of the drive (physically the outer edge) transfers data faster than one at the end of the drive.  With the introduction of 4k sector sizes, aligning partitions on sector boundaries has become important.

...

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 partition 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.)

These days there also is parted. The cfdisk interface is nicer, but parted does much more: it not only resizes partitions, but also the filesystems that live in them.

For GPT-partitioning, there is gdisk and its full-screen version cgdisk.  gdisk and cgdisk replace any MBR with a GPT.   (warning) If grub was installed in the MBR, this makes the system unbootable.  GPT is required for HDDs greater than 2 TB (TODO: reference for that?).  gdisk/cgdisk automatically do 4096 physical sector alignment.

Find an exact partition size

...