public inbox for linux-btrfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Hugo Mills <hugo@carfax.org.uk>
To: Tomasz Chmielewski <mangoo@wpkg.org>
Cc: Btrfs BTRFS <linux-btrfs@vger.kernel.org>
Subject: Re: balance conversion from RAID-1 to RAID-10 leaves some metadata in RAID-1?
Date: Mon, 2 Mar 2020 09:37:09 +0000	[thread overview]
Message-ID: <20200302093709.GL1235@savella.carfax.org.uk> (raw)
In-Reply-To: <56ef4bcdd854a9dde3cbe2f5760592ed@wpkg.org>

On Sun, Mar 01, 2020 at 07:30:34PM +0900, Tomasz Chmielewski wrote:
> Just finished a conversion from RAID-1 to RAID-10, on Linux 5.5.6:
> 
> # time btrfs balance start -dconvert=raid10 -mconvert=raid10 /data/lxd
> Done, had to relocate 2064 out of 2064 chunks
> 
> real    1811m51.427s
> user    0m0.000s
> sys     1259m34.448s
> 
> 
> # echo $?
> 0
> 
> # dmesg
> (...)
> [211862.205521] BTRFS info (device sda2): found 40805 extents
> [211910.773888] BTRFS info (device sda2): found 40805 extents
> [211965.321150] BTRFS info (device sda2): relocating block group
> 3492979671040 flags data|raid1
> [211972.743476] BTRFS info (device sda2): found 37221 extents
> [212020.193342] BTRFS info (device sda2): found 37221 extents
> [212084.580739] BTRFS info (device sda2): balance: ended with status: 0
> 
> 
> To my surprise, some metadata is still RAID-1 - is it expected?

   It's definitely something that can happen. I think what happens is
that new chunks are created while the balance process is going, so
they never get picked up by the converter. I'd guess it's most likely
to happen on an FS with active writes on it while the balance is
running.

   If it happens again, you can finish off just the unconverted chunks
by adding the "soft" option to the conversion filter:

# btrfs balance start -dconvert=raid10,sort -mconvert=raid10,soft /data/lxd

which will convert only those chunks that aren't already in the target
RAID level.

   Hugo.

> # btrfs fi usage /data/lxd
> Overall:
>     Device size:                   6.91TiB
>     Device allocated:              6.70TiB
>     Device unallocated:          210.40GiB
>     Device missing:                  0.00B
>     Used:                          3.96TiB
>     Free (estimated):              1.46TiB      (min: 1.46TiB)
>     Data ratio:                       2.00
>     Metadata ratio:                   2.00
>     Global reserve:              512.00MiB      (used: 0.00B)
> 
> Data,RAID10: Size:3.32TiB, Used:1.97TiB (59.20%)
>    /dev/sda2       1.66TiB
>    /dev/sdd2       1.66TiB
>    /dev/sdc2       1.66TiB
>    /dev/sdb2       1.66TiB
> 
> Metadata,RAID1: Size:2.00GiB, Used:85.02MiB (4.15%)
>    /dev/sdc2       2.00GiB
>    /dev/sdb2       2.00GiB
> 
> Metadata,RAID10: Size:29.00GiB, Used:12.55GiB (43.27%)
>    /dev/sda2      14.50GiB
>    /dev/sdd2      14.50GiB
>    /dev/sdc2      14.50GiB
>    /dev/sdb2      14.50GiB
> 
> System,RAID10: Size:64.00MiB, Used:400.00KiB (0.61%)
>    /dev/sda2      32.00MiB
>    /dev/sdd2      32.00MiB
>    /dev/sdc2      32.00MiB
>    /dev/sdb2      32.00MiB
> 
> Unallocated:
>    /dev/sda2      53.60GiB
>    /dev/sdd2      53.60GiB
>    /dev/sdc2      51.60GiB
>    /dev/sdb2      51.60GiB
> 
> 
> # btrfs fi df /data/lxd
> Data, RAID10: total=3.32TiB, used=1.97TiB
> System, RAID10: total=64.00MiB, used=400.00KiB
> Metadata, RAID10: total=29.00GiB, used=12.55GiB
> Metadata, RAID1: total=2.00GiB, used=85.02MiB
> GlobalReserve, single: total=512.00MiB, used=0.00B
> 
> 
> # btrfs fi show /data/lxd
> Label: 'lxd5'  uuid: 2b77b498-a644-430b-9dd9-2ad3d381448a
>         Total devices 4 FS bytes used 1.98TiB
>         devid    1 size 1.73TiB used 1.67TiB path /dev/sda2
>         devid    3 size 1.73TiB used 1.67TiB path /dev/sdd2
>         devid    4 size 1.73TiB used 1.68TiB path /dev/sdc2
>         devid    5 size 1.73TiB used 1.68TiB path /dev/sdb2
> 
> 
> 
> 
> Tomasz Chmielewski
> https://lxadm.com

-- 
Hugo Mills             | The problem with programmers and the law is not that
hugo@... carfax.org.uk | they treat laws as code, but that they don't
http://carfax.org.uk/  | understand the VM it runs on.
PGP: E2AB1DE4          |

      parent reply	other threads:[~2020-03-02  9:37 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-01 10:30 balance conversion from RAID-1 to RAID-10 leaves some metadata in RAID-1? Tomasz Chmielewski
2020-03-02  6:29 ` Chris Murphy
2020-03-02  7:39   ` Tomasz Chmielewski
2020-03-02 21:03     ` Chris Murphy
2020-03-02  9:37 ` Hugo Mills [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=20200302093709.GL1235@savella.carfax.org.uk \
    --to=hugo@carfax.org.uk \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=mangoo@wpkg.org \
    /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