* Re: Why fdisk wants the first partition to start at 1 MiB?
2012-09-25 20:50 ` Kay Sievers
@ 2012-09-25 21:19 ` Davidlohr Bueso
2012-09-26 8:12 ` Karel Zak
2012-09-26 8:56 ` Francesco Turco
2 siblings, 0 replies; 5+ messages in thread
From: Davidlohr Bueso @ 2012-09-25 21:19 UTC (permalink / raw)
To: Kay Sievers; +Cc: Francesco Turco, util-linux
On Tue, 2012-09-25 at 22:50 +0200, Kay Sievers wrote:
> On Tue, Sep 25, 2012 at 10:33 PM, Francesco Turco <fturco@fastmail.fm> wrote:
> > I'm trying to use fdisk (from util-linux 2.19.1) for creating a
> > partition on a drive. I noticed that the start sector of the first
> > partition must be at least 2048, that is 1 MiB from the beginning of the
> > drive. This can be changed by entering the "expert mode" and using the
> > "move beginning of data in a partition" option. But I'm still wondering
> > why fdisk reserves so much space by default.
> >
> > As far as I know the only sector that should not be used for partitions
> > is the first one, that is, sector 0. It is reserved for the MBR. So the
> > first partition can start at sector 1. I read that the 1 MiB thing is
> > Windows related: http://en.wikipedia.org/wiki/Logical_Disk_Manager. Or
> > it's something that Linux users should also care about? I can't find a
> > convincing explanation anywhere.
> >
> > This 1 MiB thing seems to affect parted, too, as it wants partition
> > boundaries to be multiples of 1 MiB. I don't know if it's related to the
> > problem I have with fdisk, though.
>
> It's a de-facto standard, which Windows does too. The first megabyte
> is reserved here for a boot loader or any other management data that
> could be needed for a disk or box to boot from.
>
> Boot loader issues are probably not that interesting on EFI boxes and
> other non-BIOS hardware, but on usually big sized disks it's still a
> safe default.
Right, in fact GPT only reserves 17Kib and the first partition can start
at sector 34, with 512 sector size.
Davidlohr
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Why fdisk wants the first partition to start at 1 MiB?
2012-09-25 20:50 ` Kay Sievers
2012-09-25 21:19 ` Davidlohr Bueso
@ 2012-09-26 8:12 ` Karel Zak
2012-09-26 8:56 ` Francesco Turco
2 siblings, 0 replies; 5+ messages in thread
From: Karel Zak @ 2012-09-26 8:12 UTC (permalink / raw)
To: Kay Sievers; +Cc: Francesco Turco, util-linux
On Tue, Sep 25, 2012 at 10:50:44PM +0200, Kay Sievers wrote:
> On Tue, Sep 25, 2012 at 10:33 PM, Francesco Turco <fturco@fastmail.fm> wrote:
> > I'm trying to use fdisk (from util-linux 2.19.1) for creating a
> > partition on a drive. I noticed that the start sector of the first
> > partition must be at least 2048, that is 1 MiB from the beginning of the
> > drive. This can be changed by entering the "expert mode" and using the
> > "move beginning of data in a partition" option. But I'm still wondering
> > why fdisk reserves so much space by default.
> >
> > As far as I know the only sector that should not be used for partitions
> > is the first one, that is, sector 0. It is reserved for the MBR. So the
> > first partition can start at sector 1. I read that the 1 MiB thing is
> > Windows related: http://en.wikipedia.org/wiki/Logical_Disk_Manager. Or
> > it's something that Linux users should also care about? I can't find a
> > convincing explanation anywhere.
> >
> > This 1 MiB thing seems to affect parted, too, as it wants partition
> > boundaries to be multiples of 1 MiB. I don't know if it's related to the
> > problem I have with fdisk, though.
>
> It's a de-facto standard, which Windows does too. The first megabyte
> is reserved here for a boot loader or any other management data that
> could be needed for a disk or box to boot from.
The real reason is that 1MiB is ideal offset to keep partitions
aligned on almost all random hardware. This offset is compatible with
512-byte, 4096-byte sector devices, many raid devices as well as old
broken WD disks where physical sector size has been incorrectly
reported. You can use dd(1) to move your PT + data to another device
without care about physical device topology (I/O limits), etc.
It's also important to keep your partition sizes aligned to MiB --
this is for example default in fdisk if you specify the size in
+<size>{M,G} convention.
> Boot loader issues are probably not that interesting on EFI boxes and
> other non-BIOS hardware, but on usually big sized disks it's still a
> safe default.
Yes.
Probably the most complete docs with many references:
https://ata.wiki.kernel.org/index.php/ATA_4_KiB_sector_issues
Karel
--
Karel Zak <kzak@redhat.com>
http://karelzak.blogspot.com
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: Why fdisk wants the first partition to start at 1 MiB?
2012-09-25 20:50 ` Kay Sievers
2012-09-25 21:19 ` Davidlohr Bueso
2012-09-26 8:12 ` Karel Zak
@ 2012-09-26 8:56 ` Francesco Turco
2 siblings, 0 replies; 5+ messages in thread
From: Francesco Turco @ 2012-09-26 8:56 UTC (permalink / raw)
To: util-linux
> It's a de-facto standard, which Windows does too. The first megabyte
> is reserved here for a boot loader or any other management data that
> could be needed for a disk or box to boot from.
So as far as I understood both starting at 1 MiB and having partition
boundaries at multiples of 1 MiB is for:
- Dealing with all possible situations (Windows, bootloaders, 4K
sectors, ...), both at present and in the foreseeable future
- Avoiding each person to use different partitioning rules (as I were
trying to do)
Am I right?
^ permalink raw reply [flat|nested] 5+ messages in thread