Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.user > #226911

Re: Why start the first partition at 2 MIB, why not at any multiple of 4096 bytes ...

From David Christensen <dpchrist@holgerdanske.com>
Newsgroups linux.debian.user
Subject Re: Why start the first partition at 2 MIB, why not at any multiple of 4096 bytes ...
Date 2020-09-11 22:10 +0200
Message-ID <ANXwR-7X1-15@gated-at.bofh.it> (permalink)
References (4 earlier) <AN9Tr-2iA-3@gated-at.bofh.it> <ANjzs-81C-5@gated-at.bofh.it> <ANnWq-2oc-7@gated-at.bofh.it> <ANE1c-4Ez-1@gated-at.bofh.it> <ANSdP-4IC-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On 2020-09-11 07:21, David Wright wrote:
> On Thu 10 Sep 2020 at 16:15:05 (-0700), David Christensen wrote:
>> On 2020-09-09 23:02, David wrote:
>>> On Thu, 10 Sep 2020 at 11:26, David Christensen <dpchrist@holgerdanske.com> wrote:
>>>> On 2020-09-09 08:03, David Wright wrote:
>>>>> ... having been bitten by
>>>>> https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=923561

>> 2020-09-10 14:01:58 root@tinkywinky ~
>> # parted /dev/disk/by-id/ata-ST3300622AS_******** unit s print free
>> Error: The backup GPT table is corrupt, but the primary appears OK, so
>> that will be used.

> I don't know what might have got your disk into this state, but
> I'm happy that you got it fixed. My own strategy would have been
> to use gdisk (my preferred partitioning program) to rewrite the
> backup table from the main table (command r for the recovery menu,
> then d).

Thank you for the pointer.  I will look at gdisk(8) the next time I have 
a need that I cannot figure out.


> I don't think the bug affects ordinary 512/512 disks, but only
> Advanced Format ones with larger block sizes, and then only if
> "they" also supply an erroneous I/O value, eg:
> 
> Sector size (logical/physical): 512 bytes / 4096 bytes
> I/O size (minimum/optimal): 4096 bytes / 33553920 bytes
> 
> It's possible that this only occurs with USB disks, too.
> The partition can be 1MB aligned, but cryptsetup is fooled into
> setting the wrong alignment, eg:
> 
> device-mapper: table: 254:1: adding target device sdb2 caused an alignment inconsistency:
> physical_block_size=4096, logical_block_size=512, alignment_offset=0, start=33553920
> 
> which was produced by this partition:
> 
> /dev/sdb2  1302349824 1953521663  651171840 310.5G  c W95 FAT32 (LBA)
> 
>>>> 1302349824/2048
> 635913.0
>>>>
> 
> So, as my notes show, for the simple life, I always create
> partitions with 2MB alignment regardless of future use¹,
> and always add  --align-payload 2048 to my cryptsetup
> commands. This option is benign because it's the default
> when the kernel doesn't supply a value. The man page says
> to prefer --offset, but as I know nothing about what any
> of these options actually do, I don't use --offset just
> because there's no default value given for it. (I suspect
> it may be the same as for --align-payload.)
> 
> ¹ I don't worry about the initial BIOS boot partition.

That sounds like some hard-won knowledge.  I hope they fix the bug 
before I stumble into it.


David

Back to linux.debian.user | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Why start the first partition at 2 MIB, why not at any multiple of 4096 bytes ... rhkramer@gmail.com - 2020-09-08 19:00 +0200
  Re: Why start the first partition at 2 MIB, why not at any multiple  of 4096 bytes ... Tixy <tixy@yxit.co.uk> - 2020-09-08 19:00 +0200
  Re: Why start the first partition at 2 MIB, why not at any multiple of 4096 bytes ... rhkramer@gmail.com - 2020-09-08 19:00 +0200
    Re: Why start the first partition at 2 MIB, why not at any multiple  of 4096 bytes ... David Christensen <dpchrist@holgerdanske.com> - 2020-09-08 22:40 +0200
      Re: Why start the first partition at 2 MIB, why not at any multiple of 4096 bytes ... rhkramer@gmail.com - 2020-09-08 23:50 +0200
        Re: Why start the first partition at 2 MIB, why not at any multiple  of 4096 bytes ... David Christensen <dpchrist@holgerdanske.com> - 2020-09-09 00:50 +0200
        Re: Why start the first partition at 2 MIB, why not at any multiple  of 4096 bytes ... David Wright <deblis@lionunicorn.co.uk> - 2020-09-09 17:10 +0200
          Re: Why start the first partition at 2 MIB, why not at any multiple  of 4096 bytes ... David Christensen <dpchrist@holgerdanske.com> - 2020-09-10 03:30 +0200
            Re: Why start the first partition at 2 MIB, why not at any multiple  of 4096 bytes ... David <bouncingcats@gmail.com> - 2020-09-10 08:10 +0200
              Re: Why start the first partition at 2 MIB, why not at any multiple  of 4096 bytes ... David Wright <deblis@lionunicorn.co.uk> - 2020-09-10 18:50 +0200
                Re: Why start the first partition at 2 MIB, why not at any multiple  of 4096 bytes ... David Christensen <dpchrist@holgerdanske.com> - 2020-09-11 00:40 +0200
                Re: Why start the first partition at 2 MIB, why not at any multiple  of 4096 bytes ... David <bouncingcats@gmail.com> - 2020-09-11 05:10 +0200
                Re: Why start the first partition at 2 MIB, why not at any multiple  of 4096 bytes ... David Christensen <dpchrist@holgerdanske.com> - 2020-09-11 06:20 +0200
                Re: Why start the first partition at 2 MIB, why not at any multiple  of 4096 bytes ... David Wright <deblis@lionunicorn.co.uk> - 2020-09-11 16:30 +0200
              Re: Why start the first partition at 2 MIB, why not at any multiple  of 4096 bytes ... David Christensen <dpchrist@holgerdanske.com> - 2020-09-11 01:20 +0200
                Re: Why start the first partition at 2 MIB, why not at any multiple  of 4096 bytes ... David <bouncingcats@gmail.com> - 2020-09-11 05:50 +0200
                Re: Why start the first partition at 2 MIB, why not at any multiple  of 4096 bytes ... David Wright <deblis@lionunicorn.co.uk> - 2020-09-11 16:30 +0200
                Re: Why start the first partition at 2 MIB, why not at any multiple  of 4096 bytes ... David Christensen <dpchrist@holgerdanske.com> - 2020-09-11 22:10 +0200
        Re: Why start the first partition at 2 MIB, why not at any multiple of 4096 bytes ... Joe Pfeiffer <pfeiffer@cs.nmsu.edu> - 2020-09-09 17:20 +0200
          Re: Why start the first partition at 2 MIB, why not at any multiple  of 4096 bytes ... David Wright <deblis@lionunicorn.co.uk> - 2020-09-09 18:30 +0200
            Re: Why start the first partition at 2 MIB, why not at any multiple  of 4096 bytes ... Joe Pfeiffer <pfeiffer@cs.nmsu.edu> - 2020-09-09 19:10 +0200
  Re: Why start the first partition at 2 MIB, why not at any multiple  of 4096 bytes ... Michael Stone <mstone@debian.org> - 2020-09-08 23:10 +0200

csiph-web