* Why is sb->size set to 0 with raid0?
@ 2010-07-21 16:16 Mario 'BitKoenig' Holbe
2010-07-22 5:34 ` Neil Brown
0 siblings, 1 reply; 6+ messages in thread
From: Mario 'BitKoenig' Holbe @ 2010-07-21 16:16 UTC (permalink / raw)
To: linux-raid
Hello,
while examining a raid0 v1.2 superblock I found "Used Dev Size" seems
not to be set there, mdadm -E on a component device shows:
Magic : a92b4efc
Version : 1.2
Feature Map : 0x0
...
Avail Dev Size : 2930274824 (1397.26 GiB 1500.30 GB)
Used Dev Size : 0
Data Offset : 16 sectors
Super Offset : 8 sectors
State : clean
Is this intentional?
This is just to let you know and for my curiosity. I don't know whether
this has negative side-effects or not. I found none until now.
Don't get me wrong, I like the (IMHO positive) side-effect of this: it
makes totally sense to me, not to reserve bitmap-space for raid0 - I
even downgraded to mdadm 3.1.1 for raid creation to get rid of the 1M
alignment, and I was short thinking about patching super1.c for this
array to get rid of the bitmap-space reservation as well.
Thus, I was just positively surprised to see that in fact there *is* no
bitmap-space reserved for raid0, wondered how and where this was
managed, and tracked it down to sb->size being set to 0.
regards
Mario
--
You know, people think mathematics is complicated. Mathematics is the simple
bit. Its the stuff we can understand. Its cats that are complicated. I mean,
what is it in those little molecules and stuff that make one cat behave
differently than another, or that make a cat? And how do you define a cat?
I have no idea. -- John Conway
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Why is sb->size set to 0 with raid0?
2010-07-21 16:16 Why is sb->size set to 0 with raid0? Mario 'BitKoenig' Holbe
@ 2010-07-22 5:34 ` Neil Brown
2010-07-22 11:36 ` Mario 'BitKoenig' Holbe
2010-07-22 12:50 ` Roman Mamedov
0 siblings, 2 replies; 6+ messages in thread
From: Neil Brown @ 2010-07-22 5:34 UTC (permalink / raw)
To: Mario 'BitKoenig' Holbe; +Cc: linux-raid
On Wed, 21 Jul 2010 18:16:46 +0200
Mario 'BitKoenig' Holbe <Mario.Holbe@TU-Ilmenau.DE> wrote:
> Hello,
>
> while examining a raid0 v1.2 superblock I found "Used Dev Size" seems
> not to be set there, mdadm -E on a component device shows:
> Magic : a92b4efc
> Version : 1.2
> Feature Map : 0x0
> ...
> Avail Dev Size : 2930274824 (1397.26 GiB 1500.30 GB)
> Used Dev Size : 0
> Data Offset : 16 sectors
> Super Offset : 8 sectors
> State : clean
>
> Is this intentional?
> This is just to let you know and for my curiosity. I don't know whether
> this has negative side-effects or not. I found none until now.
>
> Don't get me wrong, I like the (IMHO positive) side-effect of this: it
> makes totally sense to me, not to reserve bitmap-space for raid0 - I
> even downgraded to mdadm 3.1.1 for raid creation to get rid of the 1M
> alignment, and I was short thinking about patching super1.c for this
> array to get rid of the bitmap-space reservation as well.
> Thus, I was just positively surprised to see that in fact there *is* no
> bitmap-space reserved for raid0, wondered how and where this was
> managed, and tracked it down to sb->size being set to 0.
>
The 'Used Dev Size' is the amount of each device that is used in the array.
For RAID0 (and linear), there is no such number. The devices can be of
different sizes and in each case "all" of the available space is used.
So in this case '0' means 'all'. I should probably just remove the number
as it doesn't mean anything.
This has nothing to do with the bitmap. Space reserved for the bitmap is
out side of the 'Avail Dev Size'.
NeilBrown
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Why is sb->size set to 0 with raid0?
2010-07-22 5:34 ` Neil Brown
@ 2010-07-22 11:36 ` Mario 'BitKoenig' Holbe
2010-07-22 12:50 ` Roman Mamedov
1 sibling, 0 replies; 6+ messages in thread
From: Mario 'BitKoenig' Holbe @ 2010-07-22 11:36 UTC (permalink / raw)
To: linux-raid
Neil Brown <neilb@suse.de> wrote:
> The 'Used Dev Size' is the amount of each device that is used in the array.
> For RAID0 (and linear), there is no such number. The devices can be of
> different sizes and in each case "all" of the available space is used.
Hmm, RAID0 has a chunk size - but I guess this is what you meant with
the quotes around "all" :)
> This has nothing to do with the bitmap. Space reserved for the bitmap is
> out side of the 'Avail Dev Size'.
Sure, it has: having a zero 'Used Dev Size' (i.e. sb->size = 0) results
in not reserving space for a bitmap - at least for v1 superblocks:
array_size = __le64_to_cpu(sb->size);
/* work out how much space we left for a bitmap */
bm_space = choose_bm_space(array_size);
... which I like in case of RAID0 (as I said), but of which I don't know
if you do like it as well ;) - for example, because it also prevents a
bitmap when the RAID0 is later converted to RAID5.
regards
Mario
--
Jene, die grundlegende Freiheit aufgeben wuerden, um eine geringe
voruebergehende Sicherheit zu erwerben, verdienen weder Freiheit noch
Sicherheit.
-- Benjamin Franklin (1706-1790)
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Why is sb->size set to 0 with raid0?
2010-07-22 5:34 ` Neil Brown
2010-07-22 11:36 ` Mario 'BitKoenig' Holbe
@ 2010-07-22 12:50 ` Roman Mamedov
2010-07-22 13:02 ` Neil Brown
2010-07-22 13:04 ` Mario 'BitKoenig' Holbe
1 sibling, 2 replies; 6+ messages in thread
From: Roman Mamedov @ 2010-07-22 12:50 UTC (permalink / raw)
To: Neil Brown; +Cc: Mario 'BitKoenig' Holbe, linux-raid
[-- Attachment #1: Type: text/plain, Size: 465 bytes --]
On Thu, 22 Jul 2010 15:34:56 +1000
Neil Brown <neilb@suse.de> wrote:
> For RAID0 (and linear), there is no such number. The devices can be of
> different sizes and in each case "all" of the available space is used.
That sounds a bit surprising, excuse my ignorance, but how a RAID0 of
differently-sized devices is laid out? Is the "tail" of the larger device
simply used in linear mode, adding space to the striped "heads"?
--
With respect,
Roman
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 198 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Why is sb->size set to 0 with raid0?
2010-07-22 12:50 ` Roman Mamedov
@ 2010-07-22 13:02 ` Neil Brown
2010-07-22 13:04 ` Mario 'BitKoenig' Holbe
1 sibling, 0 replies; 6+ messages in thread
From: Neil Brown @ 2010-07-22 13:02 UTC (permalink / raw)
To: Roman Mamedov; +Cc: Mario 'BitKoenig' Holbe, linux-raid
On Thu, 22 Jul 2010 18:50:54 +0600
Roman Mamedov <roman@rm.pp.ru> wrote:
> On Thu, 22 Jul 2010 15:34:56 +1000
> Neil Brown <neilb@suse.de> wrote:
>
> > For RAID0 (and linear), there is no such number. The devices can be of
> > different sizes and in each case "all" of the available space is used.
>
> That sounds a bit surprising, excuse my ignorance, but how a RAID0 of
> differently-sized devices is laid out? Is the "tail" of the larger device
> simply used in linear mode, adding space to the striped "heads"?
>
% man md
search for "RAID0"
read and enjoy.
NeilBrown
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Why is sb->size set to 0 with raid0?
2010-07-22 12:50 ` Roman Mamedov
2010-07-22 13:02 ` Neil Brown
@ 2010-07-22 13:04 ` Mario 'BitKoenig' Holbe
1 sibling, 0 replies; 6+ messages in thread
From: Mario 'BitKoenig' Holbe @ 2010-07-22 13:04 UTC (permalink / raw)
To: linux-raid
Roman Mamedov <roman@rm.pp.ru> wrote:
> That sounds a bit surprising, excuse my ignorance, but how a RAID0 of
> differently-sized devices is laid out? Is the "tail" of the larger device
rtfm :)
md(4):
RAID0
...
If devices in the array are not all the same size, then once
the smallest device has been exhausted, the RAID0 driver starts
collecting chunks into smaller stripes that only span the
drives which still have remaining space.
regards
Mario
--
Und wie jede Sprache, so hat auch PHP ein Anwendungsgebiet, fuer das es
besonders gut geeignet ist. Soweit ich sehen kann, handelt es sich dabei
um das sogenannte "ins Knie schiessen".
-- Volker Birk in de.alt.sysadmin.recovery
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2010-07-22 13:04 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-07-21 16:16 Why is sb->size set to 0 with raid0? Mario 'BitKoenig' Holbe
2010-07-22 5:34 ` Neil Brown
2010-07-22 11:36 ` Mario 'BitKoenig' Holbe
2010-07-22 12:50 ` Roman Mamedov
2010-07-22 13:02 ` Neil Brown
2010-07-22 13:04 ` Mario 'BitKoenig' Holbe
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).