[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Message from grub2-install

From: Chris Murphy
Subject: Re: Message from grub2-install
Date: Sat, 10 Mar 2012 14:49:59 -0700

On Mar 10, 2012, at 2:23 PM, Neal Murphy wrote:
> There're all manner of weirdities to be found between grub2 and msdos and gpt 
> partitioning.

Yes. I'm finding 63 common for older partitioning schemes, but even parted on 
CentOS 6, maybe even Centos 5.x (?) is now using 2048 for the first sector of 
the first partition for either MBR or GPT disks.

Apple's diskutil (Disk Utility) sets the first partition at 40, while also 
defaulting to GPT.

> Sector 63 is simply the start of cylinder 1. Works great for old partitioning 
> schemes that still use CHS reckoning. Sector 2048 (maybe 1MiB; I don't have a 
> new 4kB sector drive to test with) is the place parted uses for the somewhat 
> more modern GPT partitioning and modern drives that treat the drive as a 
> sequential series of blocks (much like SCSI did 20 years ago). 

My understanding of 2048, and 1MiB alignments, is to make sure partition 
starting sector is also the beginning of a 4096 byte sector on 512e disks, 
rather than one of the other three logical sectors making up that physical 
sector. You could do it with 4096 byte alignment, but it's just considered 
easier for humans specifying partitions to do it in full MiB increments - then 
you won't have a problem and you don't have to use a calculator. *shrug*

Sector 2048 will be a 1MiB offset on either conventional (non-AF) disks, as 
well as 512e AF disks. All AF disks right now are 512e, there is no way to 
directly address the physical sector. All tools still request LBA from the 
disk, which translates into a 512 byte logical sector, which the drive firmware 
translates into the true physical sector.

In a matter of months we start seeing 4Kn AF disks appear which do not have the 
emulation layer, and only expose the 4K sector. So sector 2048 will be an 8MiB 
offset from the start of the disk. So the equivalent starting sector for 
partition 1 would be 256 for a 4Kn disk, which would be a 1MiB offset from 
start of the disk.

So, there are two kinds of AF disks: 512e and 4Kn.

> For GPT partitioning, IIRC, I had to start the first partition at 1 MiB; it 
> was the only way to shut parted up (never mind the contortions I had to go 
> through to make it stop silently recomputing partition boundaries on me). 
> Then 
> I had to make the firt partition a bare 1-2MiB grub_boot partition to keep 
> grub2 happy. This partition contains *no* filesystem; it is merely the place 
> where grub lays down its stuff. If you use a /boot partition, that must be 
> another partition; fortunately, GPT has 'unlimited' partitions.

It doesn't matter where BIOS Boot partition is located on the disk, 
grub2-install will find it.

Chris Murphy

reply via email to

[Prev in Thread] Current Thread [Next in Thread]