linux-lvm.redhat.com archive mirror
 help / color / mirror / Atom feed
From: Zdenek Kabelac <zkabelac@redhat.com>
To: LVM general discussion and development <linux-lvm@redhat.com>,
	Tomasz Lasko <tomasz@lasko.pl>
Subject: Re: [linux-lvm] Sector size is assumed 512
Date: Fri, 12 May 2017 13:34:56 +0200	[thread overview]
Message-ID: <aba0c545-6db4-62ad-34b2-d7768f1017ce@redhat.com> (raw)
In-Reply-To: <d8bf4829-6136-4f44-68b1-661b3b6f98cb@lasko.pl>

Dne 11.5.2017 v 12:39 Tomasz Lasko napsal(a):
> Hi,
> 
> I'm not a part of the list or the project, just a random guy dropping by to 
> say I found one suspicious thing:
> 
> after looking for what 's' size stands for, I found that your lvmcmdline.c 
> source code 
> <https://github.com/Jajcus/lvm2/blob/master/tools/lvmcmdline.c#L320> probably 
> assumes that sector size is 512, but there are various sector sizes out in 
> world (both for the hardware sector size and logical disk interfaces like 
> SCSI) especially more and more popular 4096 byte sector size.
> 
> I wonder if apart of lvmcmdline.c above, also other parts of your software 
> assume that sector size will always be 512. If yes, then I suggest rethinking 
> if 4k sectors might break some operations in LVM.
> 
> By the way, I understand that when specifying command line parameter sector 
> size, then it is the same for small 's' as capital 'S', right?  And the same 
> goes for bytes ('b' is the same as 'B'), right?
> 

Hi

Sector size is 'fixed'  for  dm devices for 512b.

If you work with 4K sector disks you need to use/specify size multiplied by 8.

It would get really messy if you would have multiple different PVs in a VG 
with  different sector size and you would want to print i.e. size of LV in 
sectors.

So nope - we can't change this fixed 'base' value.

Normally users do work size in  MiB or GiB eventually TiB.

lvm2 never advises users to go to sector level precision for numerous reason.

If you care about single sector - lvm2 is likely not a tool to be considered 
for usage.


Also note - default alignment is 4MiB - so unless you would override this 
extent-size below 4K, you can't actually hit issues with wrong alignment
(and likely >99% users never change this setting)

And BTW it's explicitly mentioned that 'sector is 512b' it has not attachment 
to physical device sector size...

Regards


Zdenek

      parent reply	other threads:[~2017-05-12 11:34 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-11 10:39 [linux-lvm] Sector size is assumed 512 Tomasz Lasko
2017-05-12 11:31 ` Alasdair G Kergon
2017-05-12 11:34 ` Zdenek Kabelac [this message]

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=aba0c545-6db4-62ad-34b2-d7768f1017ce@redhat.com \
    --to=zkabelac@redhat.com \
    --cc=linux-lvm@redhat.com \
    --cc=tomasz@lasko.pl \
    /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).