7

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?

5

For working with GPT disks, you need either something based on libparted (parted, GParted, etc.) or my GPT fdisk (gdisk, sgdisk, and cgdisk) tools. The latter come in the Ubuntu gdisk package, IIRC. Since you say you're familiar with cfdisk, I recommend you check out cgdisk, 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 and cfdisk) 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, but fdisk and its brethren should be fine for most day-to-day operations.

0

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

  • thanks Rod ! :-)
  • 2
    Removing the GPT from a 3TB disk is a bad idea. The old MBR partitioning scheme maxes out at 2TiB (assuming 512-byte logical sectors), so GPT is needed for most larger disks. – Rod Smith Sep 3 '13 at 15:55
  • Thanks for that Rod, I wasn't aware of that ... however (and perhaps this is relevant to the original post (?)), when I tried to work with a GPT myself, Ubuntu rejected it ... but are you saying there are ways to work with GPTs in Linux? (sorry if this is going slightly off topic - just hoping it helps others like myself who might not be aware of this). – Mr.President Sep 3 '13 at 15:58
  • 1
    Both Linux generally and Ubuntu specifically support GPT just fine. I don't know what type of problems you ran into, but you may want to check this old but mostly still-relevant introduction to the topic, as well as the GPT fdisk online documentation, which covers the basics of GPT. – Rod Smith Sep 3 '13 at 16:01

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.