All of lore.kernel.org
 help / color / mirror / Atom feed
* Write intent bitmaps
@ 2009-06-08  2:10 Leslie Rhorer
  2009-06-08 13:51 ` Carlos Carvalho
  0 siblings, 1 reply; 17+ messages in thread
From: Leslie Rhorer @ 2009-06-08  2:10 UTC (permalink / raw)
  To: linux-raid


I have been reading a bit about write-intent bitmaps on RAID arrays, and I
am considering adding them to my arrays.  I have a few questions:

1. The write-intent bitmap seems to be rather similar to a file system
journal.  Are there any features of the bitmaps which distinguish them from
a journal, other than the fact they operate at the RAID layer, of course,
instead of the filesystem layer?

2. On a RAID5 or RAID6 array, how much of a performance hit might I expect?

3. The threads I have read all speak about the benefits during a power
failure.  Power failures are not the only source of dirty shutdowns,
however.  Are there any benefits to a bitmap for recovering a failed array
or a degraded array?  A resync can take more than a day, and the array is
vulnerable during that time.

4. How much space will be required for the bitmnap on an external drive?

5. What happens if the bitmap is lost or the external drive fills up?

6. Would it be best to allocate a small separate partition entirely for the
bitmap?  If so, would ext2 probably be the best choice?  How does one
guarantee the partition and filesystem will be available prior to the
assembly of  the RAID array during boot?


^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: Write intent bitmaps
  2009-06-08  2:10 Write intent bitmaps Leslie Rhorer
@ 2009-06-08 13:51 ` Carlos Carvalho
  2009-06-18  8:17   ` Goswin von Brederlow
  2009-06-19  2:16   ` Neil Brown
  0 siblings, 2 replies; 17+ messages in thread
From: Carlos Carvalho @ 2009-06-08 13:51 UTC (permalink / raw)
  To: linux-raid

Leslie Rhorer (lrhorer@satx.rr.com) wrote on 7 June 2009 21:10:
 >1. The write-intent bitmap seems to be rather similar to a file system
 >journal.  Are there any features of the bitmaps which distinguish them from
 >a journal, other than the fact they operate at the RAID layer, of course,
 >instead of the filesystem layer?

The bitmap doesn't have the info to be written, it's just a bit for
the whole region. The FS journal has the [journaled part of the] info,
which can be fully recovered later if necessary. Don't forget that
raid doesn't protect against unclean shutdowns; if the array is taken
down during a write, some disks may have the new version of the stripe
and others not. When it's resynced the parity will be recalculated
from what's on all disks, that is a mix of new and old versions of the
stripes. If later a disk fails before the blocks are re-written the
not-the-one-you-want parity will be used, and you'll have corruption.

 >2. On a RAID5 or RAID6 array, how much of a performance hit might I expect?

Depends on the chunk and where the bitmap is. With an internal one the
default chunk will cause a BIG hit. Fortunately it's very easy to try
different settings with the array live, so you can easily revert when
the world suddenly freezes around you... Our arrays are rather busy,
so performance is important and I gave up on it. If you can put it on
other disks I suppose it's possible to find a chunk size compatible
with performance.

 >3. The threads I have read all speak about the benefits during a power
 >failure.  Power failures are not the only source of dirty shutdowns,
 >however.  Are there any benefits to a bitmap for recovering a failed array
 >or a degraded array?  A resync can take more than a day, and the array is
 >vulnerable during that time.

That's the benefit and the purpose of the bitmap. Besides being
vulnerable during the resync, you also have a BIG performance hit if
your array is busy (or the resync takes forever), so it's worth trying.

 >4. How much space will be required for the bitmap on an external drive?

You decide it with the chunk size.

 >5. What happens if the bitmap is lost or the external drive fills up?

No idea.

 >6. Would it be best to allocate a small separate partition entirely for the
 >bitmap?

For performance what's important is to have the bitmap and array on
different disks. Having a filesystem exclusively for the bitmap might
avoid fragmentation but I suspect this is negligible in practice.
If the bitmap disks are being used for other things you'll have to
wait for the heads to come back, which may impact performance
noticeably.

 >If so, would ext2 probably be the best choice?

That's what the man page says. I find it strange since if it's a file
the filesystem shouldn't matter. Neil?

 >How does one guarantee the partition and filesystem will be
 >available prior to the assembly of the RAID array during boot?

Your boot process must guarantee it. If the bitmap is internal you get
it automatically from the kernel.

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: Write intent bitmaps
  2009-06-08 13:51 ` Carlos Carvalho
@ 2009-06-18  8:17   ` Goswin von Brederlow
  2009-06-19  2:24     ` Neil Brown
  2009-06-19  2:16   ` Neil Brown
  1 sibling, 1 reply; 17+ messages in thread
From: Goswin von Brederlow @ 2009-06-18  8:17 UTC (permalink / raw)
  To: Carlos Carvalho; +Cc: linux-raid

carlos@fisica.ufpr.br (Carlos Carvalho) writes:

> Leslie Rhorer (lrhorer@satx.rr.com) wrote on 7 June 2009 21:10:
>  >1. The write-intent bitmap seems to be rather similar to a file system
>  >journal.  Are there any features of the bitmaps which distinguish them from
>  >a journal, other than the fact they operate at the RAID layer, of course,
>  >instead of the filesystem layer?
>
> The bitmap doesn't have the info to be written, it's just a bit for
> the whole region. The FS journal has the [journaled part of the] info,
> which can be fully recovered later if necessary. Don't forget that
> raid doesn't protect against unclean shutdowns; if the array is taken
> down during a write, some disks may have the new version of the stripe
> and others not. When it's resynced the parity will be recalculated
> from what's on all disks, that is a mix of new and old versions of the
> stripes. If later a disk fails before the blocks are re-written the
> not-the-one-you-want parity will be used, and you'll have corruption.

Can that actualy happen? I would think the raid should refuse to
reassemble automatically if any one stripe does not have enough blocks
in sync. Just like when not enough disks are in sync without bitmap.

>  >2. On a RAID5 or RAID6 array, how much of a performance hit might I expect?
>
> Depends on the chunk and where the bitmap is. With an internal one the
> default chunk will cause a BIG hit. Fortunately it's very easy to try
> different settings with the array live, so you can easily revert when
> the world suddenly freezes around you... Our arrays are rather busy,
> so performance is important and I gave up on it. If you can put it on
> other disks I suppose it's possible to find a chunk size compatible
> with performance.

Worst case every write to the raid requires a write to the bitmap. So
your speed will be ~half. It is not (much) less than half though. You
could think that the seek to and from the bitmap must slow things down
even more but worst case is random access, which means there already
is a seek between each write. The bitmap just adds one write and one
seek for each write and seek.

The critical part seems to be the size one bit in the bitmap
covers. If you have 2 writes that are covered by the same bit then the
bit is only changed once. So the bigger the covered size the less
bitmap writes. On the other hand the benefits (specifically resyncs)
decrease with the covered size. Find a balance that works for you.

>  >3. The threads I have read all speak about the benefits during a power
>  >failure.  Power failures are not the only source of dirty shutdowns,
>  >however.  Are there any benefits to a bitmap for recovering a failed array
>  >or a degraded array?  A resync can take more than a day, and the array is
>  >vulnerable during that time.
>
> That's the benefit and the purpose of the bitmap. Besides being
> vulnerable during the resync, you also have a BIG performance hit if
> your array is busy (or the resync takes forever), so it's worth trying.

As long as the drives work again during reassembly it doesn't matter
what the cause of the failure was. It will only sync the parts
indicated by the bitmap. On the other hand if a drive fails and is
replaced there is no alternative to rewriting all of that drive.

One benefit of the bitmap during a full resync though is (afaik) that
the bitmap (better) indicates the amount done already. If the system
crashes and reboots the resync will resume instead of restart.

>  >4. How much space will be required for the bitmap on an external drive?
>
> You decide it with the chunk size.
>
>  >5. What happens if the bitmap is lost or the external drive fills up?
>
> No idea.

Afaik you can always start the raid without bitmap. If it is unclean
that means a full resync though. As for the external drive filling up
I don't think that has any effect, not with ext2. The bitmap uses a
fixed space on the disk and will never need more space. Even with a
completly full ext2 there should be no problem writing the bitmap.

>  >6. Would it be best to allocate a small separate partition entirely for the
>  >bitmap?
>
> For performance what's important is to have the bitmap and array on
> different disks. Having a filesystem exclusively for the bitmap might
> avoid fragmentation but I suspect this is negligible in practice.

From test I've done with some external enclosures there was absolutely
no difference between internal bitmap and external bitmap on a
partition on the same drive. But test it for your use case and
hardware.

Since the bitmap is only written once and then only rewritten just
make sure it is not fragmented to start with. Although it probably
doesn't matter even if it is.

> If the bitmap disks are being used for other things you'll have to
> wait for the heads to come back, which may impact performance
> noticeably.
>
>  >If so, would ext2 probably be the best choice?
>
> That's what the man page says. I find it strange since if it's a file
> the filesystem shouldn't matter. Neil?
>
>  >How does one guarantee the partition and filesystem will be
>  >available prior to the assembly of the RAID array during boot?
>
> Your boot process must guarantee it. If the bitmap is internal you get
> it automatically from the kernel.

MfG
        Goswin

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: Write intent bitmaps
  2009-06-08 13:51 ` Carlos Carvalho
  2009-06-18  8:17   ` Goswin von Brederlow
@ 2009-06-19  2:16   ` Neil Brown
  2009-06-19 15:01     ` Goswin von Brederlow
                       ` (2 more replies)
  1 sibling, 3 replies; 17+ messages in thread
From: Neil Brown @ 2009-06-19  2:16 UTC (permalink / raw)
  To: Carlos Carvalho; +Cc: linux-raid

On Monday June 8, carlos@fisica.ufpr.br wrote:
> 
>  >5. What happens if the bitmap is lost or the external drive fills up?
> 
> No idea.

If the bitmap is lost, it is just as though you didn't have a bitmap 
(or as though all the bits in the bitmap were set to one).

The drive filling up is not relevant.  When the bitmap is in a
separate file, the file is preallocated to be the right size.

> 
>  >If so, would ext2 probably be the best choice?
> 
> That's what the man page says. I find it strange since if it's a file
> the filesystem shouldn't matter. Neil?

The way that md writes to the bitmap file is not entirely portable
across different filesystems.  As the man page say,  it is known to
work for ext2 and ext3.  Either is a fine choice.
A new filesystem interface is being introduced in 2.6.31 as part of
the swap-over-NFS work.  I might end up using that to write to bitmap
files, as it has the right characteristics.  But that is very much in
the future.

NeilBrown

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: Write intent bitmaps
  2009-06-18  8:17   ` Goswin von Brederlow
@ 2009-06-19  2:24     ` Neil Brown
  2009-06-19  5:21       ` Goswin von Brederlow
  0 siblings, 1 reply; 17+ messages in thread
From: Neil Brown @ 2009-06-19  2:24 UTC (permalink / raw)
  To: Goswin von Brederlow; +Cc: Carlos Carvalho, linux-raid

On Thursday June 18, goswin-v-b@web.de wrote:
> carlos@fisica.ufpr.br (Carlos Carvalho) writes:
> 
> > Leslie Rhorer (lrhorer@satx.rr.com) wrote on 7 June 2009 21:10:
> >  >1. The write-intent bitmap seems to be rather similar to a file system
> >  >journal.  Are there any features of the bitmaps which distinguish them from
> >  >a journal, other than the fact they operate at the RAID layer, of course,
> >  >instead of the filesystem layer?
> >
> > The bitmap doesn't have the info to be written, it's just a bit for
> > the whole region. The FS journal has the [journaled part of the] info,
> > which can be fully recovered later if necessary. Don't forget that
> > raid doesn't protect against unclean shutdowns; if the array is taken
> > down during a write, some disks may have the new version of the stripe
> > and others not. When it's resynced the parity will be recalculated
> > from what's on all disks, that is a mix of new and old versions of the
> > stripes. If later a disk fails before the blocks are re-written the
> > not-the-one-you-want parity will be used, and you'll have corruption.
> 
> Can that actualy happen? I would think the raid should refuse to
> reassemble automatically if any one stripe does not have enough blocks
> in sync. Just like when not enough disks are in sync without bitmap.

You would think correctly.  If mdadm cannot be sure that the data is
still good, it will refuse to assemble the array. 
In particular, active degraded raid4/5/6 arrays will not normally be
assembled for you due to the above reason - the could be data
corruption.

If you want to get as whatever data there is there, you can assemble
with "--force".  But in that case be aware that there could be
corruption.
I have never actually heard of anyone doing that and discovering
corruption, but then the nature of the possible corruption is that it
would probably be quite hard to find.

> 
> >  >2. On a RAID5 or RAID6 array, how much of a performance hit might I expect?
> >
> > Depends on the chunk and where the bitmap is. With an internal one the
> > default chunk will cause a BIG hit. Fortunately it's very easy to try
> > different settings with the array live, so you can easily revert when
> > the world suddenly freezes around you... Our arrays are rather busy,
> > so performance is important and I gave up on it. If you can put it on
> > other disks I suppose it's possible to find a chunk size compatible
> > with performance.
> 
> Worst case every write to the raid requires a write to the bitmap. So
> your speed will be ~half. It is not (much) less than half though. You
> could think that the seek to and from the bitmap must slow things down
> even more but worst case is random access, which means there already
> is a seek between each write. The bitmap just adds one write and one
> seek for each write and seek.

I think half-speed would be very very unlikely.  md tries to gather
bitmap updates so that - where possible - it might update several bits
all at once.

I have measured a 10% performance drop.  However it is very dependant
on workload and, and you say, bitmap chunk size.

> 
> The critical part seems to be the size one bit in the bitmap
> covers. If you have 2 writes that are covered by the same bit then the
> bit is only changed once. So the bigger the covered size the less
> bitmap writes. On the other hand the benefits (specifically resyncs)
> decrease with the covered size. Find a balance that works for you.
> 
> >  >3. The threads I have read all speak about the benefits during a power
> >  >failure.  Power failures are not the only source of dirty shutdowns,
> >  >however.  Are there any benefits to a bitmap for recovering a failed array
> >  >or a degraded array?  A resync can take more than a day, and the array is
> >  >vulnerable during that time.
> >
> > That's the benefit and the purpose of the bitmap. Besides being
> > vulnerable during the resync, you also have a BIG performance hit if
> > your array is busy (or the resync takes forever), so it's worth trying.
> 
> As long as the drives work again during reassembly it doesn't matter
> what the cause of the failure was. It will only sync the parts
> indicated by the bitmap. On the other hand if a drive fails and is
> replaced there is no alternative to rewriting all of that drive.
> 
> One benefit of the bitmap during a full resync though is (afaik) that
> the bitmap (better) indicates the amount done already. If the system
> crashes and reboots the resync will resume instead of restart.

When you a rebuilding a drive that had failed, we call that "recovery"
not "resync".
With 0.90 metadata, a recovery will always restart at the beginning.
With 1.x metadata, we checkpoint the recovery so it won't duplicated
very much work.


NeilBrown

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: Write intent bitmaps
  2009-06-19  2:24     ` Neil Brown
@ 2009-06-19  5:21       ` Goswin von Brederlow
  0 siblings, 0 replies; 17+ messages in thread
From: Goswin von Brederlow @ 2009-06-19  5:21 UTC (permalink / raw)
  To: Neil Brown; +Cc: Goswin von Brederlow, Carlos Carvalho, linux-raid

Neil Brown <neilb@suse.de> writes:

> On Thursday June 18, goswin-v-b@web.de wrote:
>> carlos@fisica.ufpr.br (Carlos Carvalho) writes:
>> >  >2. On a RAID5 or RAID6 array, how much of a performance hit might I expect?
>> >
>> > Depends on the chunk and where the bitmap is. With an internal one the
>> > default chunk will cause a BIG hit. Fortunately it's very easy to try
>> > different settings with the array live, so you can easily revert when
>> > the world suddenly freezes around you... Our arrays are rather busy,
>> > so performance is important and I gave up on it. If you can put it on
>> > other disks I suppose it's possible to find a chunk size compatible
>> > with performance.
>> 
>> Worst case every write to the raid requires a write to the bitmap. So
>> your speed will be ~half. It is not (much) less than half though. You
>> could think that the seek to and from the bitmap must slow things down
>> even more but worst case is random access, which means there already
>> is a seek between each write. The bitmap just adds one write and one
>> seek for each write and seek.
>
> I think half-speed would be very very unlikely.  md tries to gather
> bitmap updates so that - where possible - it might update several bits
> all at once.
>
> I have measured a 10% performance drop.  However it is very dependant
> on workload and, and you say, bitmap chunk size.

From my tests with internal bitmaps half is what you get with the
default size. At least that was what I got with a software raid over
external raid enclosures. Might be a side effect of bitmap writes not
covering a stripe on the external raid enclosures and them slowing
them down in the hope of getting more data for that stripe. But it was
quite unusable.

>> One benefit of the bitmap during a full resync though is (afaik) that
>> the bitmap (better) indicates the amount done already. If the system
>> crashes and reboots the resync will resume instead of restart.
>
> When you a rebuilding a drive that had failed, we call that "recovery"
> not "resync".
> With 0.90 metadata, a recovery will always restart at the beginning.
> With 1.x metadata, we checkpoint the recovery so it won't duplicated
> very much work.
>
>
> NeilBrown

One of these days I have to redo my home raids with newer metadata.

MfG
        Goswin

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: Write intent bitmaps
  2009-06-19  2:16   ` Neil Brown
@ 2009-06-19 15:01     ` Goswin von Brederlow
  2009-06-20  8:14       ` NeilBrown
  2009-06-21 18:06     ` Bill Davidsen
  2009-06-28 18:14     ` Leslie Rhorer
  2 siblings, 1 reply; 17+ messages in thread
From: Goswin von Brederlow @ 2009-06-19 15:01 UTC (permalink / raw)
  To: Neil Brown; +Cc: Carlos Carvalho, linux-raid

Neil Brown <neilb@suse.de> writes:

> On Monday June 8, carlos@fisica.ufpr.br wrote:
>>  >If so, would ext2 probably be the best choice?
>> 
>> That's what the man page says. I find it strange since if it's a file
>> the filesystem shouldn't matter. Neil?
>
> The way that md writes to the bitmap file is not entirely portable
> across different filesystems.  As the man page say,  it is known to
> work for ext2 and ext3.  Either is a fine choice.
> A new filesystem interface is being introduced in 2.6.31 as part of
> the swap-over-NFS work.  I might end up using that to write to bitmap
> files, as it has the right characteristics.  But that is very much in
> the future.
>
> NeilBrown

How about support to write to a device instead of a file?

MfG
        Goswin

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: Write intent bitmaps
  2009-06-19 15:01     ` Goswin von Brederlow
@ 2009-06-20  8:14       ` NeilBrown
  2009-06-20  9:52         ` Goswin von Brederlow
  0 siblings, 1 reply; 17+ messages in thread
From: NeilBrown @ 2009-06-20  8:14 UTC (permalink / raw)
  To: Goswin von Brederlow; +Cc: Carlos Carvalho, linux-raid

On Sat, June 20, 2009 1:01 am, Goswin von Brederlow wrote:
> Neil Brown <neilb@suse.de> writes:
>
>> On Monday June 8, carlos@fisica.ufpr.br wrote:
>>>  >If so, would ext2 probably be the best choice?
>>>
>>> That's what the man page says. I find it strange since if it's a file
>>> the filesystem shouldn't matter. Neil?
>>
>> The way that md writes to the bitmap file is not entirely portable
>> across different filesystems.  As the man page say,  it is known to
>> work for ext2 and ext3.  Either is a fine choice.
>> A new filesystem interface is being introduced in 2.6.31 as part of
>> the swap-over-NFS work.  I might end up using that to write to bitmap
>> files, as it has the right characteristics.  But that is very much in
>> the future.
>>
>> NeilBrown
>
> How about support to write to a device instead of a file?

One of my next little projects is to rationalise the bitmap support
and make it more generic - currently you cannot use bitmaps with
externally managed metadata because there is no way to say where
it should go.
I don't know yet how that will end up working, but it is entirely possible
that it will generalise to allows the bitmap to be written to an
arbitrary device.

However, as bitmaps are typically quite small (a few megabytes at
most, typically tens of kilobytes) it seems clumsy to create a
partition just for a bitmap..

NeilBrown


^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: Write intent bitmaps
  2009-06-20  8:14       ` NeilBrown
@ 2009-06-20  9:52         ` Goswin von Brederlow
  0 siblings, 0 replies; 17+ messages in thread
From: Goswin von Brederlow @ 2009-06-20  9:52 UTC (permalink / raw)
  To: NeilBrown; +Cc: Goswin von Brederlow, Carlos Carvalho, linux-raid

"NeilBrown" <neilb@suse.de> writes:

> On Sat, June 20, 2009 1:01 am, Goswin von Brederlow wrote:
>> Neil Brown <neilb@suse.de> writes:
>>
>>> On Monday June 8, carlos@fisica.ufpr.br wrote:
>>>>  >If so, would ext2 probably be the best choice?
>>>>
>>>> That's what the man page says. I find it strange since if it's a file
>>>> the filesystem shouldn't matter. Neil?
>>>
>>> The way that md writes to the bitmap file is not entirely portable
>>> across different filesystems.  As the man page say,  it is known to
>>> work for ext2 and ext3.  Either is a fine choice.
>>> A new filesystem interface is being introduced in 2.6.31 as part of
>>> the swap-over-NFS work.  I might end up using that to write to bitmap
>>> files, as it has the right characteristics.  But that is very much in
>>> the future.
>>>
>>> NeilBrown
>>
>> How about support to write to a device instead of a file?
>
> One of my next little projects is to rationalise the bitmap support
> and make it more generic - currently you cannot use bitmaps with
> externally managed metadata because there is no way to say where
> it should go.
> I don't know yet how that will end up working, but it is entirely possible
> that it will generalise to allows the bitmap to be written to an
> arbitrary device.
>
> However, as bitmaps are typically quite small (a few megabytes at
> most, typically tens of kilobytes) it seems clumsy to create a
> partition just for a bitmap..
>
> NeilBrown

lvcreate --extents 1 ...

Ideal would be if one could put multiple bitmaps on the same
device. But then again that is what an FS allows.

MfG
        Goswin


^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: Write intent bitmaps
  2009-06-19  2:16   ` Neil Brown
  2009-06-19 15:01     ` Goswin von Brederlow
@ 2009-06-21 18:06     ` Bill Davidsen
  2009-06-28 18:14     ` Leslie Rhorer
  2 siblings, 0 replies; 17+ messages in thread
From: Bill Davidsen @ 2009-06-21 18:06 UTC (permalink / raw)
  To: Neil Brown; +Cc: Carlos Carvalho, linux-raid

Neil Brown wrote:
> On Monday June 8, carlos@fisica.ufpr.br wrote:
>   
>>  >5. What happens if the bitmap is lost or the external drive fills up?
>>
>> No idea.
>>     
>
> If the bitmap is lost, it is just as though you didn't have a bitmap 
> (or as though all the bits in the bitmap were set to one).
>
> The drive filling up is not relevant.  When the bitmap is in a
> separate file, the file is preallocated to be the right size.
>
>   
>>  >If so, would ext2 probably be the best choice?
>>
>> That's what the man page says. I find it strange since if it's a file
>> the filesystem shouldn't matter. Neil?
>>     
>
> The way that md writes to the bitmap file is not entirely portable
> across different filesystems.  As the man page say,  it is known to
> work for ext2 and ext3.  Either is a fine choice.
> A new filesystem interface is being introduced in 2.6.31 as part of
> the swap-over-NFS work.  I might end up using that to write to bitmap
> files, as it has the right characteristics.  But that is very much in
> the future.
>   

I never understood why swap over anything wasn't supported... we had 
swap over NFS in SunOS, in 1992, and that was over 10Mbit thicknet to 
drives sized in MB (RAM in MB, too). I have been trying some things with 
SSD, putting swap on it, bitmaps both raid and f/s, and journals. At the 
moment I'm developing the scripts and tools to do valid measurement.

-- 
Bill Davidsen <davidsen@tmr.com>
  Obscure bug of 2004: BASH BUFFER OVERFLOW - if bash is being run by a
normal user and is setuid root, with the "vi" line edit mode selected,
and the character set is "big5," an off-by-one error occurs during
wildcard (glob) expansion.


^ permalink raw reply	[flat|nested] 17+ messages in thread

* RE: Write intent bitmaps
  2009-06-19  2:16   ` Neil Brown
  2009-06-19 15:01     ` Goswin von Brederlow
  2009-06-21 18:06     ` Bill Davidsen
@ 2009-06-28 18:14     ` Leslie Rhorer
  2009-06-29 10:01       ` Goswin von Brederlow
  2 siblings, 1 reply; 17+ messages in thread
From: Leslie Rhorer @ 2009-06-28 18:14 UTC (permalink / raw)
  To: 'Neil Brown', 'Carlos Carvalho'; +Cc: linux-raid

> >  >5. What happens if the bitmap is lost or the external drive fills up?
> >
> > No idea.
> 
> If the bitmap is lost, it is just as though you didn't have a bitmap
> (or as though all the bits in the bitmap were set to one).

	OK, what about the thread in this list where (as I recall) the
fellow's bitmap was corrupted or lost and it evidently caused the entire
array to go splat?  That's worrisome.

> The drive filling up is not relevant.  When the bitmap is in a
> separate file, the file is preallocated to be the right size.

	Let me take a little different tack.  I don't have any ext2 or ext3
file systems on the server.  If I am going to set up an external bitmap, I
am going to have to steal some space from one of the other file systems -
perhaps from the swap area (5G), the boot file system (reiserfs - 109G), or
the Windows XP filesystem (NTFS - 40G).  I need to be able to calculate how
much space to steal to fit the bitmap, and allow for later expansion.

> >  >If so, would ext2 probably be the best choice?
> >
> > That's what the man page says. I find it strange since if it's a file
> > the filesystem shouldn't matter. Neil?
> 
> The way that md writes to the bitmap file is not entirely portable
> across different filesystems.  As the man page say,  it is known to
> work for ext2 and ext3.  Either is a fine choice.

	I'm fine with shrinking one of the existing file systems and
creating a tiny partition just for the bitmap.



^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: Write intent bitmaps
  2009-06-28 18:14     ` Leslie Rhorer
@ 2009-06-29 10:01       ` Goswin von Brederlow
  0 siblings, 0 replies; 17+ messages in thread
From: Goswin von Brederlow @ 2009-06-29 10:01 UTC (permalink / raw)
  To: lrhorer; +Cc: 'Neil Brown', 'Carlos Carvalho', linux-raid

"Leslie Rhorer" <lrhorer@satx.rr.com> writes:

>> >  >5. What happens if the bitmap is lost or the external drive fills up?
>> >
>> > No idea.
>> 
>> If the bitmap is lost, it is just as though you didn't have a bitmap
>> (or as though all the bits in the bitmap were set to one).
>
> 	OK, what about the thread in this list where (as I recall) the
> fellow's bitmap was corrupted or lost and it evidently caused the entire
> array to go splat?  That's worrisome.
>
>> The drive filling up is not relevant.  When the bitmap is in a
>> separate file, the file is preallocated to be the right size.
>
> 	Let me take a little different tack.  I don't have any ext2 or ext3
> file systems on the server.  If I am going to set up an external bitmap, I
> am going to have to steal some space from one of the other file systems -
> perhaps from the swap area (5G), the boot file system (reiserfs - 109G), or
> the Windows XP filesystem (NTFS - 40G).  I need to be able to calculate how
> much space to steal to fit the bitmap, and allow for later expansion.

That is pretty flexible and the size is miniscule. For example my big
raid5 with internal bitmap has

      bitmap: 0/233 pages [0KB], 2048KB chunk

That is slightly less than 1MB. With 512MB bitmap I could do 4KB
chunks but from a few tests a larger chunk size is better for me.

MfG
        Goswin

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: Write intent bitmaps.
  2009-09-02 16:28           ` Paul Clements
@ 2009-09-02 17:36             ` Ryan Wagoner
  0 siblings, 0 replies; 17+ messages in thread
From: Ryan Wagoner @ 2009-09-02 17:36 UTC (permalink / raw)
  To: Paul Clements; +Cc: Bill Davidsen, NeilBrown, Simon Jackson, linux-raid

You could just provide more information in the mdadm bitmap error message

mdadm: unknown bitmap version 0, either the bitmap file is corrupted
or you need to upgrade your tools

suggested change

mdadm: unknown bitmap version 0, either the bitmap file is corrupted,
you are looking looking at the array and not an array component, or
you need to upgrade your tools

Ryan

On Wed, Sep 2, 2009 at 12:28 PM, Paul
Clements<paul.clements@steeleye.com> wrote:
> Bill Davidsen wrote:
>>
>> NeilBrown wrote:
>>>
>>> On Tue, August 25, 2009 12:39 am, Simon Jackson wrote:
>>>
>>>>
>>>> I am trying to use write intent bitmaps on some RAID 1 volumes to reduce
>>>> the rebuild times in the event of hard resets that cause the md driver
>>>> to
>>>> kick members out of my arrays.
>>>>
>>>> I used the mdadm --grow /dev/md0 --bitmap=internal  and this appeared to
>>>> succeed, but when I tried to examine the bitmap I get an error.
>>>>
>>>>
>>>> :~$ sudo mdadm --grow /dev/md0 --bitmap=internal
>>>> :~$ sudo mdadm -X /dev/md0
>>>>        Filename : /dev/md0
>>>>           Magic : 00000000
>>>> mdadm: invalid bitmap magic 0x0, the bitmap file appears to be corrupted
>>>>         Version : 0
>>>> mdadm: unknown bitmap version 0, either the bitmap file is corrupted or
>>>> you need to upgrade your tools
>>>>
>>>
>>> Quoting from the man page:
>>>
>>>       -X, --examine-bitmap
>>>              Report  information about a bitmap file.  The argument is
>>> either
>>>              an external bitmap file or an array  component  in  case  of
>>>  an
>>>              internal  bitmap.   Note  that  running  this on an array
>>> device
>>>              (e.g.  /dev/md0) does not report the bitmap for that array.
>>>
>>>
>>> Particularly read the last sentence.
>>> Then try
>>>   mdadm -X /dev/sda5
>>>
>>
>> Well that's nice and clear, but raises the question "why not?" This would
>> seem to be one of the most common things someone would do, to look at the
>> bitmap for an array.
>
> Two reasons why not:
>
> The examine code simply takes the device or file you give it and looks for a
> bitmap in that file or device. You'd have to do some hand-waving to "read
> the bitmap for /dev/md0". There actually is no bitmap on /dev/md0; there is
> a bitmap stored either in a file or on each of the component devices. So
> which version of the bitmap do you read? From the first, second, third ...
> component disk?
>
> Also, mdadm's behavior would be ambiguous if you implemented the above. What
> if /dev/md0 is itself a component of another md device? Then how is mdadm to
> know which bitmap you want? The one that actually physically exists on md0,
> or the ones that the components of md0 contain?
>
> Perhaps better would be to simply throw an error in this case?
>
> --
> Paul
> --
> To unsubscribe from this list: send the line "unsubscribe linux-raid" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>
--
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: Write intent bitmaps.
  2009-09-02 16:10         ` Bill Davidsen
@ 2009-09-02 16:28           ` Paul Clements
  2009-09-02 17:36             ` Ryan Wagoner
  0 siblings, 1 reply; 17+ messages in thread
From: Paul Clements @ 2009-09-02 16:28 UTC (permalink / raw)
  To: Bill Davidsen; +Cc: NeilBrown, Simon Jackson, linux-raid

Bill Davidsen wrote:
> NeilBrown wrote:
>> On Tue, August 25, 2009 12:39 am, Simon Jackson wrote:
>>  
>>> I am trying to use write intent bitmaps on some RAID 1 volumes to reduce
>>> the rebuild times in the event of hard resets that cause the md 
>>> driver to
>>> kick members out of my arrays.
>>>
>>> I used the mdadm --grow /dev/md0 --bitmap=internal  and this appeared to
>>> succeed, but when I tried to examine the bitmap I get an error.
>>>
>>>
>>> :~$ sudo mdadm --grow /dev/md0 --bitmap=internal
>>> :~$ sudo mdadm -X /dev/md0
>>>         Filename : /dev/md0
>>>            Magic : 00000000
>>> mdadm: invalid bitmap magic 0x0, the bitmap file appears to be corrupted
>>>          Version : 0
>>> mdadm: unknown bitmap version 0, either the bitmap file is corrupted or
>>> you need to upgrade your tools
>>>     
>>
>> Quoting from the man page:
>>
>>        -X, --examine-bitmap
>>               Report  information about a bitmap file.  The argument is
>> either
>>               an external bitmap file or an array  component  in  
>> case  of
>>  an
>>               internal  bitmap.   Note  that  running  this on an array
>> device
>>               (e.g.  /dev/md0) does not report the bitmap for that array.
>>
>>
>> Particularly read the last sentence.
>> Then try
>>    mdadm -X /dev/sda5
>>   
> 
> Well that's nice and clear, but raises the question "why not?" This 
> would seem to be one of the most common things someone would do, to look 
> at the bitmap for an array.

Two reasons why not:

The examine code simply takes the device or file you give it and looks 
for a bitmap in that file or device. You'd have to do some hand-waving 
to "read the bitmap for /dev/md0". There actually is no bitmap on 
/dev/md0; there is a bitmap stored either in a file or on each of the 
component devices. So which version of the bitmap do you read? From the 
first, second, third ... component disk?

Also, mdadm's behavior would be ambiguous if you implemented the above. 
What if /dev/md0 is itself a component of another md device? Then how is 
mdadm to know which bitmap you want? The one that actually physically 
exists on md0, or the ones that the components of md0 contain?

Perhaps better would be to simply throw an error in this case?

--
Paul

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: Write intent bitmaps.
  2009-08-24 20:25       ` NeilBrown
@ 2009-09-02 16:10         ` Bill Davidsen
  2009-09-02 16:28           ` Paul Clements
  0 siblings, 1 reply; 17+ messages in thread
From: Bill Davidsen @ 2009-09-02 16:10 UTC (permalink / raw)
  To: NeilBrown; +Cc: Simon Jackson, linux-raid

NeilBrown wrote:
> On Tue, August 25, 2009 12:39 am, Simon Jackson wrote:
>   
>> I am trying to use write intent bitmaps on some RAID 1 volumes to reduce
>> the rebuild times in the event of hard resets that cause the md driver to
>> kick members out of my arrays.
>>
>> I used the mdadm --grow /dev/md0 --bitmap=internal  and this appeared to
>> succeed, but when I tried to examine the bitmap I get an error.
>>
>>
>> :~$ sudo mdadm --grow /dev/md0 --bitmap=internal
>> :~$ sudo mdadm -X /dev/md0
>>         Filename : /dev/md0
>>            Magic : 00000000
>> mdadm: invalid bitmap magic 0x0, the bitmap file appears to be corrupted
>>          Version : 0
>> mdadm: unknown bitmap version 0, either the bitmap file is corrupted or
>> you need to upgrade your tools
>>     
>
> Quoting from the man page:
>
>        -X, --examine-bitmap
>               Report  information about a bitmap file.  The argument is
> either
>               an external bitmap file or an array  component  in  case  of
>  an
>               internal  bitmap.   Note  that  running  this on an array
> device
>               (e.g.  /dev/md0) does not report the bitmap for that array.
>
>
> Particularly read the last sentence.
> Then try
>    mdadm -X /dev/sda5
>   

Well that's nice and clear, but raises the question "why not?" This 
would seem to be one of the most common things someone would do, to look 
at the bitmap for an array.

-- 
bill davidsen <davidsen@tmr.com>
  CTO TMR Associates, Inc

"Now we have another quarterback besides Kurt Warner telling us during postgame
interviews that he owes every great thing that happens to him on a football
field to his faith in Jesus. I knew there had to be a reason why the Almighty
included a mute button on my remote."
			-- Arthur Troyer on Tim Tebow (Sports Illustrated)


^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: Write intent bitmaps.
       [not found]     ` <ABFC24E4C13D81489F7F624E14891C860D1F15EF@uk-ex-mbx1.terastack.bluearc .com>
@ 2009-08-24 20:25       ` NeilBrown
  2009-09-02 16:10         ` Bill Davidsen
  0 siblings, 1 reply; 17+ messages in thread
From: NeilBrown @ 2009-08-24 20:25 UTC (permalink / raw)
  To: Simon Jackson; +Cc: linux-raid

On Tue, August 25, 2009 12:39 am, Simon Jackson wrote:
>
>
> I am trying to use write intent bitmaps on some RAID 1 volumes to reduce
> the rebuild times in the event of hard resets that cause the md driver to
> kick members out of my arrays.
>
> I used the mdadm --grow /dev/md0 --bitmap=internal  and this appeared to
> succeed, but when I tried to examine the bitmap I get an error.
>
>
> :~$ sudo mdadm --grow /dev/md0 --bitmap=internal
> :~$ sudo mdadm -X /dev/md0
>         Filename : /dev/md0
>            Magic : 00000000
> mdadm: invalid bitmap magic 0x0, the bitmap file appears to be corrupted
>          Version : 0
> mdadm: unknown bitmap version 0, either the bitmap file is corrupted or
> you need to upgrade your tools

Quoting from the man page:

       -X, --examine-bitmap
              Report  information about a bitmap file.  The argument is
either
              an external bitmap file or an array  component  in  case  of
 an
              internal  bitmap.   Note  that  running  this on an array
device
              (e.g.  /dev/md0) does not report the bitmap for that array.


Particularly read the last sentence.
Then try
   mdadm -X /dev/sda5

NeilBrown


>
> cat /proc/mdstat
> Personalities : [raid1]
>
> md0 : active raid1 sda5[0] sdb5[1]
>       7823552 blocks [2/2] [UU]
>       bitmap: 29/239 pages [116KB], 16KB chunk
>
> unused devices: <none>
> sjackson@mercuryst5:~$ sudo mdadm -X /dev/md0
>         Filename : /dev/md0
>            Magic : 00000000
> mdadm: invalid bitmap magic 0x0, the bitmap file appears to be corrupted
>          Version : 0
> mdadm: unknown bitmap version 0, either the bitmap file is corrupted or
> you need to upgrade your tools
>
> Do I really have a usable bitmap on the device in this case?
>
> Thanks for any input.
>
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-raid" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>


^ permalink raw reply	[flat|nested] 17+ messages in thread

* Write intent bitmaps.
  2009-08-24 12:54 ` Goswin von Brederlow
@ 2009-08-24 14:39   ` Simon Jackson
       [not found]     ` <ABFC24E4C13D81489F7F624E14891C860D1F15EF@uk-ex-mbx1.terastack.bluearc .com>
  0 siblings, 1 reply; 17+ messages in thread
From: Simon Jackson @ 2009-08-24 14:39 UTC (permalink / raw)
  To: linux-raid



I am trying to use write intent bitmaps on some RAID 1 volumes to reduce the rebuild times in the event of hard resets that cause the md driver to kick members out of my arrays.

I used the mdadm --grow /dev/md0 --bitmap=internal  and this appeared to succeed, but when I tried to examine the bitmap I get an error. 


:~$ sudo mdadm --grow /dev/md0 --bitmap=internal
:~$ sudo mdadm -X /dev/md0
        Filename : /dev/md0
           Magic : 00000000
mdadm: invalid bitmap magic 0x0, the bitmap file appears to be corrupted
         Version : 0
mdadm: unknown bitmap version 0, either the bitmap file is corrupted or you need to upgrade your tools

cat /proc/mdstat
Personalities : [raid1] 
      
md0 : active raid1 sda5[0] sdb5[1]
      7823552 blocks [2/2] [UU]
      bitmap: 29/239 pages [116KB], 16KB chunk
      
unused devices: <none>
sjackson@mercuryst5:~$ sudo mdadm -X /dev/md0
        Filename : /dev/md0
           Magic : 00000000
mdadm: invalid bitmap magic 0x0, the bitmap file appears to be corrupted
         Version : 0
mdadm: unknown bitmap version 0, either the bitmap file is corrupted or you need to upgrade your tools

Do I really have a usable bitmap on the device in this case?

Thanks for any input.  



^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2009-09-02 17:36 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-06-08  2:10 Write intent bitmaps Leslie Rhorer
2009-06-08 13:51 ` Carlos Carvalho
2009-06-18  8:17   ` Goswin von Brederlow
2009-06-19  2:24     ` Neil Brown
2009-06-19  5:21       ` Goswin von Brederlow
2009-06-19  2:16   ` Neil Brown
2009-06-19 15:01     ` Goswin von Brederlow
2009-06-20  8:14       ` NeilBrown
2009-06-20  9:52         ` Goswin von Brederlow
2009-06-21 18:06     ` Bill Davidsen
2009-06-28 18:14     ` Leslie Rhorer
2009-06-29 10:01       ` Goswin von Brederlow
2009-08-23  8:16 RAID 5 recovery to not degrade device on bad block Anshuman Aggarwal
2009-08-24 12:54 ` Goswin von Brederlow
2009-08-24 14:39   ` Write intent bitmaps Simon Jackson
     [not found]     ` <ABFC24E4C13D81489F7F624E14891C860D1F15EF@uk-ex-mbx1.terastack.bluearc .com>
2009-08-24 20:25       ` NeilBrown
2009-09-02 16:10         ` Bill Davidsen
2009-09-02 16:28           ` Paul Clements
2009-09-02 17:36             ` Ryan Wagoner

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.