[Ocfs2-users] partition offset/alignment on SAN devices.

Patrick J. LoPresti lopresti at gmail.com
Fri Jul 9 07:11:16 PDT 2010


On Fri, Jul 9, 2010 at 2:24 AM,  <Thomas.Zimolong at bmi.bund.de> wrote:
>
> So we first wondered how to automate this, because we'd have had to align the
> partitions on quite a few LUNs (more than 40).
> Since you'd have to use the expert options of fdisk, we did'nt find a quick
> solution with sfdisk, though with some further investigation there will
> surely be one.

I have been using this one-line incantation for a while now:

  parted -- /dev/sdc mklabel gpt mkpart ext2 2048s -34s

"mklabel gpt" creates a GPT disk label, since the old DOS disk label
has a minuscule maximum partition size of 2 TiB.

"mkpart ext2 2048s -34s" creates a partition with type code 0x83
starting 2048 sectors (1MiB) into the disk and ending 34 sectors
before the end of the disk.  The 34 sectors at the end are reserved by
the GPT disk label.

The "--" prevents parted from trying to interpret "-34s" as a
command-line option.

This gives you a partition aligned on a 1MiB boundary, which I figured
was enough for any reasonable current or future alignment need.

> We don’t use partitions, so no todo.

That works, too.  I just like having partitions because some tools
(especially GUI disk managers) expect them.

 - Pat



More information about the Ocfs2-users mailing list