15

After choosing "Guided - Use entire disk" during installation of Ubunsut Server 12.04 I find that the first partition starts on sector 34. Why that specific sector and not the first one?

(parted) print
Model: ATA WDC WD30EZRX-00M (scsi)
Disk /dev/sda: 5860533168s
Sector size (logical/physical): 512B/4096B
Partition Table: gpt

Number  Start    End          Size         File system  Name  Flags
 1      34s      390659s      390626s      fat32              boot
 2      390660s  890660s      500001s      ext2
 3      890661s  5860533118s  5859642458s

(parted)

In case you prefer bytes as the unit:

(parted) unit B
(parted) print
Model: ATA WDC WD30EZRX-00M (scsi)
Disk /dev/sda: 3000592982016B
Sector size (logical/physical): 512B/4096B
Partition Table: gpt

Number  Start       End             Size            File system  Name  Flags
 1      17408B      200017919B      200000512B      fat32              boot
 2      200017920B  456018431B      256000512B      ext2
 3      456018432B  3000592956927B  3000136938496B
Deleted
  • 848

4 Answers4

13

The size of the EFI label is usually 34 sectors, so partitions start at sector 34. This feature means that no partition can start at sector zero (0)

Source.

Uri Herrera
  • 15,318
13

Colin Ian King's answer is correct; however, it should be noted that hard disks that use the Advanced Format feature (4096-byte physical sectors and 512-byte logical sectors) require partition start sectors to be multiples of 8 in order to get optimal performance. See this article I wrote for all the gory details. Most partitioning tools today (late 2012) align partitions on 1MiB (2048-sector) boundaries by default. Since 2048 is a multiple of 8, such partitions work fine with these disks. Most disks sold today, and certainly most of the larger models, use Advanced Format. Thus, unless you're certain that your disk does not use Advanced Format, it's best to align on 8-sector boundaries. Note that 34 is not divisible by 8; 40 is the smallest start sector for a GPT disk with a standard partition table size that works well with Advanced Format disks.

What version of Ubuntu are you installing, Kent? I haven't checked recently, but I thought that the last version or two used 2048-sector partition alignment. If you're installing something older, you might want to consider installing a newer Ubuntu, since that will give you much more up-to-date software.

Rod Smith
  • 45,120
  • 7
  • 66
  • 108
1

If installed on a GPT disk, sector 34 is the first sector than can be used as sectors 0-33 overhead sectors used for the Protective MBR, the GPT header, and the GPT partition tables. This is a reasonable answer as to why it starts at sector 34.

Hoot
  • 11
0

I agree with the answer from "Colin Ian King" and "Rod Smith" (for 512e Advanced Format Disks) BUT both using 34s or 40s as partition start gives the WARNING "Warning: The resulting partition is not properly aligned for best performance." when running "parted -a optimal /dev/sdb mkpart first-partition 34s 40s" or "parted -a optimal /dev/sdb mkpart first-partition 40s 47s" (when running "parted mkpart" the end sector is included and using 40s...47s results in 8 sectors size partition which would align nicely to 4KiB alignment that should be used on 512e AF Disks).

BECAUSE according to Windows Vista support for large-sector hard disk drives: ... In Windows Vista, the default starting offset will generally be sector 0x800 (2048s) ... 2048s*512B = 1048576B = 1MiB

AND parted has aligned its partition start/handling to Windows Vista: parted.git: https://git.savannah.gnu.org/gitweb/?p=parted.git;a=blobdiff;f=libparted/labels/dos.c;h=0a606e506e11030e7f9d1d17e0deec67a7a5d594;hp=fda8a79ed1c4ca813256459720f7be5d963c662d;hb=51e774269002a7a9c0aecf497d4d98486c918918;hpb=40bfba3a317f33e7bc55fdd8cd5073ac69ae280a

AND therefore the first partition needs to start at: 1048576B = 1MiB (running "parted -a optimal /dev/sdb mkpart first-partition 2048s 2055s" on a 512e Disk (the end sector of course can be chosen >=2055s that is just the minimum))

becke-ch
  • 151