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

Re: kernel: device-mapper: table: 254:1: adding target device sda1 caused an alignment inconsistency



On Sat, 28 Jul 2018, David Wright wrote:
> On Sat 28 Jul 2018 at 10:57:45 (-0300), Henrique de Moraes Holschuh wrote:
> > On Sat, 28 Jul 2018, Rick Thomas wrote:
> > > > rbthomas@small:~$ lsblk -t
> > > > NAME           ALIGNMENT MIN-IO   OPT-IO PHY-SEC LOG-SEC ROTA SCHED       RQ-SIZE  RA WSAME
> > > > sda                    0   4096 33553920    4096     512    1 mq-deadline      60 128    0B
> > > > `-sda1                 0   4096 33553920    4096     512    1 mq-deadline      60 128    0B
> > > >   |-small-swap        -1   4096        0    4096     512    1                 128 128   32M
> > > >   |-small-root        -1   4096        0    4096     512    1                 128 128   32M
> > > >   `-small-home        -1   4096        0    4096     512    1                 128 128   32M
> > > > mmcblk2                0    512        0     512     512    0 mq-deadline     128 128    0B
> > > > |-mmcblk2p1            0    512        0     512     512    0 mq-deadline     128 128    0B
> > > > `-mmcblk2p2            0    512        0     512     512    0 mq-deadline     128 128    0B
> > > > rbthomas@small:~$ 
> > > 
> > > Note the alignment values of “-1” for the lvm entries but not for the GPT partition or the whole disk.
> > > Why do you suppose that is?
> > 
> > Keep in mind that you *offset*-align the outer container *only*, and then inside
> > you just keep the size alignment.
> > 
> > So, the above ensures correct use of the partitions even if sda1 is
> > unaligned.
> > 
> > If you offset-align sda1 to -1, everything inside it should have an offset of
> > zero to keep the alignment correct.
> 
> I don't think I fully understand the explanation. Can you point out
> the number(s) that's wrong, and how it should be corrected.

There is nothing wrong on the table above as far as I can tell,
*assuming* the device does need the -1 alignment.  Since sda1 isn't
aligned, everything inside it at the first level must be (and is)
aligned at -1 to compensate.

Where sda1 aligned at -1, nothing inside it should be, as sda1 would
already provide the required alignemnt to anything inside it.

> (To which number does the -1 apply, and what units is it in?)

It applies to whatever line it is listed, and it is in "host-side
sectors" (512 bytes in this case), where "host" is "your computer" as
opposed to "the HDD".

No idea why your USB-connected HDD is causing the warnings.  I didn't
think there were still devices in the market with that dreadful "windows
workaround" (which not even windows want, nowadays)... but USB-connected
HDDs are *always* suspect of insanity caused by crap protocol bridges,
so YMMV.

-- 
  Henrique Holschuh


Reply to: