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>,
	lejeczek <peljasz@yahoo.co.uk>
Subject: Re: [linux-lvm] lv raid - how to read this?
Date: Thu, 7 Sep 2017 11:16:47 +0200	[thread overview]
Message-ID: <2feba733-6812-3c1f-d42a-3e5eea82a636@redhat.com> (raw)
In-Reply-To: <38537c05-ba92-9817-a791-19ac39b9615f@yahoo.co.uk>

Dne 7.9.2017 v 10:06 lejeczek napsal(a):
> hi fellas
> 
> I'm setting up a lvm raid0, 4 devices, I want raid0 and I understand & expect 
> - there will be four stripes, all I care of is speed.
> I do:
> $ lvcreate --type raid0 -i 4 -I 16 -n 0 -l 96%pv intel.raid0-0 /dev/sd{c..f} # 
> explicitly four stripes
> 
> I see:
> $ mkfs.xfs /dev/mapper/intel.sataA-0 -f
> meta-data=/dev/mapper/intel.sataA-0 isize=512    agcount=32, agsize=30447488 blks
>           =                       sectsz=512   attr=2, projid32bit=1
>           =                       crc=1        finobt=0, sparse=0
> data     =                       bsize=4096 blocks=974319616, imaxpct=5
>           =                       sunit=4      swidth=131076 blks
> naming   =version 2              bsize=4096   ascii-ci=0 ftype=1
> log      =internal log           bsize=4096   blocks=475744, version=2
>           =                       sectsz=512   sunit=4 blks, lazy-count=1
> realtime =none                   extsz=4096   blocks=0, rtextents=0
> 
> What puzzles me is xfs's:
>   sunit=4      swidth=131076 blks
> and I think - what the hexx?


Unfortunatelly  'swidth'  in XFS has different meaning than lvm2's  stripe 
size parameter.

In lvm2 -


-i | --stripes    - how many disks
-I | --stripesize    - how much data before using next disk.

So  -i 4  & -I 16 gives  64KB  total stripe width

----

XFS meaning:

suinit = <RAID controllers stripe size in BYTES (or KiBytes when used with k)>
swidth = <# of data disks (don't count parity disks)>

----

---- so real-world example ----

# lvcreate --type striped -i4 -I16 -L1G -n r0 vg

or

# lvcreate --type raid0  -i4 -I16 -L1G -n r0 vg

# mkfs.xfs  /dev/vg/r0 -f
meta-data=/dev/vg/r0             isize=512    agcount=8, agsize=32764 blks
          =                       sectsz=512   attr=2, projid32bit=1
          =                       crc=1        finobt=1, sparse=0, rmapbt=0, 
reflink=0
data     =                       bsize=4096   blocks=262112, imaxpct=25
          =                       sunit=4      swidth=16 blks
naming   =version 2              bsize=4096   ascii-ci=0 ftype=1
log      =internal log           bsize=4096   blocks=552, version=2
          =                       sectsz=512   sunit=4 blks, lazy-count=1
realtime =none                   extsz=4096   blocks=0, rtextents=0


---- and we have ----

sunit=4         ...  4 * 4096 = 16KiB        (matching  lvm2 -I16  here)
swidth=16 blks  ... 16 * 4096 = 64KiB
    so we have  64 as total width / size of single strip (sunit)  ->  4 disks
    (matching  lvm2 -i4 option here)

Yep complex, don't ask... ;)



> 
> In a LVM non-raid stripe scenario I've always remember it was: swidth = sunit 
> * Y where Y = number of stripes, right?
> 
> I'm hoping some expert could shed some light, help me(maybe others too) 
> understand what LVM is doing there? I'd appreciate.
> many thanks, L.


We in the first place there is major discrepancy in the naming:

You use intel.raid0-0   VG name
and then you mkfs device: /dev/mapper/intel.sataA-0  ??

While you should be accessing: /dev/intel.raid0/0

Are you sure you are not trying to overwrite some unrelated device here?

(As your shown numbers looks unrelated, or you have buggy kernel or blkid....)


Regards

Zdenek

  reply	other threads:[~2017-09-07  9:16 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-07  8:06 [linux-lvm] lv raid - how to read this? lejeczek
2017-09-07  9:16 ` Zdenek Kabelac [this message]
2017-09-07 13:12   ` lejeczek
2017-09-07 16:27     ` Heinz Mauelshagen
2017-09-08  9:39       ` lejeczek
2017-09-08  8:49     ` Zdenek Kabelac
2017-09-08  9:22       ` lejeczek
2017-09-08  9:34         ` Zdenek Kabelac
2017-09-08  9:39           ` lejeczek
2017-09-08  9:54             ` Zdenek Kabelac
2017-09-08  9:38         ` Zdenek Kabelac
2017-09-08 10:23           ` lejeczek
2017-09-08 10:58           ` Ming-Hung Tsai
2017-09-08 11:00             ` Ming-Hung Tsai
2017-09-08 12:11               ` Zdenek Kabelac

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=2feba733-6812-3c1f-d42a-3e5eea82a636@redhat.com \
    --to=zkabelac@redhat.com \
    --cc=linux-lvm@redhat.com \
    --cc=peljasz@yahoo.co.uk \
    /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).