What is the state of partitioning tools in Linux? Which tools are recommend and which should I stay away from? Namely I am interested in fdisk
, cfdisk
, sfdisk
and the fdisk
and cfdisk
variants that come in the gnu-fdisk
package. The "go to" solution these days would be parted
I assume?
I am asking this because I used to use cfdisk
years ago, but now I am sitting here with a new 3TB disk and cfdisk
is displaying completely wrong information, it's displaying a partition as 375GB in size and free space available even so there is a single partition of 3TB and no free space. If I switch over to cfdisk
from the gnu-fdisk
package, it will display correct information, but now fdisk.gnu-fdisk
won't display anything. Meanwhile the regular fdisk
that comes by default with Ubuntu would display things correctly. sfdisk
seems to work, but is lacking support for the newer GPT partition tables.
Essentially half of those tools don't seem to work properly. So should I just forget them and do everything with parted
from now on? Are the gdisk
tools ready for prime time or are there any drawbacks to using GPT? Are there other tools I should be aware of?
For working with GPT disks, you need either something based on libparted (
parted
, GParted, etc.) or my GPT fdisk (gdisk
,sgdisk
, andcgdisk
) tools. The latter come in the Ubuntugdisk
package, IIRC. Since you say you're familiar withcfdisk
, I recommend you check outcgdisk
, since the latter is modeled after the former, but for GPT disks.Personally, I'd avoid the GNU fdisk package; it's an attempt to slap an fdisk-like user interface atop libparted, but the result is something that omits the functionality that makes
fdisk
worthwhile to begin with.Edit (March, 2017):
The older
fdisk
and related tools (sfdisk
andcfdisk
) now support GPT, too. IIRC, Ubuntu 14.10 or 15.04 was the first version of Ubuntu to ship with the updated tools, so you should have those unless you're running an older distribution. The last I checked, my GPT fdisk provided more comprehensive support for GPT-specific features, butfdisk
and its brethren should be fine for most day-to-day operations.Factory state / blank reset
If having trouble with HDD partitioning, one thing I found helpful was to create a bootable disk of:
(there's a free version at that website)
there is some other functionality on the bootable ISO, but I didn't need them
this helped me reset the HDD to an utterly blank factory state & begin from scratch
particularly helpful when it has been the bootable disk for a windows machine before then being used for Linux, or where for some other reason the disk wasn't being properly recognized by an operating system installation CD.
However in one case (not sure why) I had to then deal with removing a GPT partition table, but that was a comparatively easier task (explained in the link below):
Not sure if this is what you're after ... but perhaps it helps
SEE COMMENTS BELOW ON WARNING REGARDING REMOVAL OF GPT ON LARGE DRIVES