util-linux.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Karel Zak <kzak@redhat.com>
To: dE <de.techno@gmail.com>
Cc: util-linux@vger.kernel.org
Subject: Re: fdisk and 2048 sectors obsession.
Date: Tue, 28 Oct 2014 08:53:08 +0100	[thread overview]
Message-ID: <20141028075308.GI10134@x2.net.home> (raw)
In-Reply-To: <544E923E.6050406@gmail.com>

On Tue, Oct 28, 2014 at 12:13:10AM +0530, dE wrote:
> Regardless of the partition table, fdisk always starts the first partition
> at 2048. In reality, the maximum size required by the gap between MBR and
> the 1st partition is a single sector, which's used by GRUB 1.5. GPT doesn't
> need this space at all.
> 
> Then extended partitions too have a gap of 2048 sectors.
> 
> Why this behavior?

This is standard behavior for all modern partitioning tools.

 # parted -s --align optimal /dev/sdb 'mkpart primary 1 10MiB'

 # fdisk -l /dev/sdb
 Device    Start          End Size Type
 /dev/sdb1  2048        20479   9M Microsoft basic data


the goal is to start the first partition on offset which is the most
portable and the most useful on all possible disk configurations. If
you align partitions to 1MiB than it's good enough for all possible 
I/O limits  (including 4K disks, RAIDs with huge optimal I/O etc). You
can dd(1) partition table from 512-byte disk to 4K disk without care
about alignment etc.

The overhead (1MiB gap(s)) is minimal to compare to usual disk sizes.
(Note that for very small disk we use grain based on real I/O limits.)

The another advantage is that 1MiB offset also unifies all partition
tables -- from users point of view all the partition table look very
analogous.


If you don't like it, then use fdisk expert menu and move the begin of
the partition by command 'b'.

    Karel

-- 
 Karel Zak  <kzak@redhat.com>
 http://karelzak.blogspot.com

  parent reply	other threads:[~2014-10-28  7:53 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-27 18:43 fdisk and 2048 sectors obsession dE
2014-10-27 19:07 ` Felix Miata
2014-10-28  3:24   ` dE
2014-10-28  3:55     ` Felix Miata
2014-10-28  4:30       ` dE
2014-10-28  5:53         ` Felix Miata
2014-10-28  7:32           ` Karel Zak
2014-10-28  7:49             ` Felix Miata
2014-10-28  8:48               ` Martin Steigerwald
2014-10-28  8:47     ` Martin Steigerwald
     [not found]     ` <544F3B20.7090109@gmail.com>
2014-10-28 14:33       ` dE
2014-10-28 17:11         ` Linda Walsh
2014-10-29 14:28           ` Dale R. Worley
2014-10-28  7:53 ` Karel Zak [this message]
2014-10-28 12:38   ` Martin K. Petersen
2014-10-28 14:53     ` dE
2014-10-28 15:35       ` Theodore Ts'o
2014-10-29 16:40         ` dE

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20141028075308.GI10134@x2.net.home \
    --to=kzak@redhat.com \
    --cc=de.techno@gmail.com \
    --cc=util-linux@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).