Small unallocated space left, when partitioning harddrive. What is is meant for and why can't I use it?

4

Every so often I encounter a small unallocated space in the partitioning scheme of a hard drive, when I want to create a maximal sized partition, even though I have set the "Free space following" to zero in the partitioning dialogue. (see first picture below.)

Of what use this free space of 2048 sectors? The chosen partition table is GPT. Is this small space meant for the MBR equivalent of GPT? If so, why is it at the end of space, should it not be at the beginning of the HDD?


Partition Creation gParted - Unallocated Space Unallocated Space Details

Senkaku

Posted 2013-10-22T16:45:40.417

Reputation: 494

2It is because 3.815.391 isn't evenly divisible by 2048 leaving you with roughly 1MIB of unused space... – TheXed – 2013-10-22T16:54:10.980

Could you go into some more detail? Why do I have to divide by 2048? Newer hard drives use 4096 byte (4 kB) sectors. Is the problem, that I have chosen an alignment of megabytes not sectors?

– Senkaku – 2013-10-22T17:01:07.573

Answers

1

I'm not sure why libparted does this, but I have three hypotheses:

  • It may be a relic of times past. When using the old-style cylinder alignment, the number of sectors on a modern disk would seldom work out to an exact number of cylinders -- that is, the last cylinder would be partial. Thus, when partitioning MBR disks with cylinder alignment, it was once common practice to leave a few sectors at the end of the disk unused. It's possible that the algorithms that libparted uses to do this end up creating a 1MiB gap on GPT disks. If so, this could be considered a bug, albeit a very minor one.
  • It may be a rounding error. In recent versions of libparted, partition start points are aligned on 1MiB boundaries. The developers may have intended to have the partition end at the very last usable sector, but a rounding error might have caused it to drop down by the partition-alignment value of 1MiB.
  • It may be intentional. A gap at the end of the disk could be used for a BIOS Boot Partition (which users must sometimes add after partitioning because they didn't realize they needed it) or to adjust the size of the partition table. Unfortunately for this hypothesis, libparted doesn't enable use of this space in either of these ways, although gdisk does.

I've listed these options in order of decreasing plausibility. Note that I'm the author of GPT fdisk (gdisk, sgdisk, and cgdisk), so I'm extremely familiar with the needs of GPT partitioning. I've even contributed a few lines of code to libparted, but I'm not familiar with the specific areas of libparted that are responsible for this behavior, hence the speculative nature of my hypotheses.

Rod Smith

Posted 2013-10-22T16:45:40.417

Reputation: 18 427

You have gone on to change the Arch Linux page, adding references to your own web pages! This is highly improper, you should be ashamed of yourself. – MariusMatutiae – 2013-10-22T20:29:22.950

I did change the Arch Linux wiki. There's nothing improper about that; it's a wiki, and I have knowledge about the topic at hand. I did *not* add references to my own page, as a check of the wiki's history would show. Other people had already placed references to my pages in that wiki. – Rod Smith – 2013-10-22T21:22:05.460

All quite true, but your change and your comment about "my answer being wrong" make it look like I deliberately mis-cited a wiki which instead is correct. You are trying to make me look like a liar and a cheater. This is what is wrong with your changing the Wiki. – MariusMatutiae – 2013-10-23T04:43:59.910

My intent was not to make you look like a liar or a cheater; I was simply trying to fix misinformation on the Web (here and in the Arch wiki). Please keep Hanlon's razor in mind: "Never attribute to malice that which is adequately explained by stupidity." I had no malicious intent, but failing to mention here that I'd edited the wiki was indeed thoughtless.

– Rod Smith – 2013-10-23T15:30:58.717

Ok, case closed. – MariusMatutiae – 2013-10-23T16:43:14.420

3

From Arch Linux Wiki article on GUID Partition table:

Note: Remember that GPT stores a secondary table at the end of disk. You must make sure that the last 1 MiB of the disk is not used by any partition.

MariusMatutiae

Posted 2013-10-22T16:45:40.417

Reputation: 41 321

4This answer is wrong. The space required by GPT at the end of the disk is just 33 sectors (16.5KiB), not 1MiB. Furthermore, there's no need to manually reserve space for GPT data structures in any well-designed partitioning software. Note that I'm the author of the GPT fdisk (gdisk, sgdisk, and cgdisk) software, so I know this topic extremely well. – Rod Smith – 2013-10-22T19:11:55.803