All of lore.kernel.org
 help / color / mirror / Atom feed
From: richard lucassen <mailinglists@lucassen.org>
To: linux-btrfs@vger.kernel.org
Subject: Re: Debian Bullseye install btrfs raid1
Date: Wed, 4 May 2022 14:59:51 +0200	[thread overview]
Message-ID: <20220504145951.93293c35de0a7a6c464e12c5@lucassen.org> (raw)
In-Reply-To: <83b2f5df-fc16-627d-85b4-af07bac9a73b@knorrie.org>

On Wed, 4 May 2022 14:06:31 +0200
Hans van Kranenburg <hans@knorrie.org> wrote:

> > Still new to btrfs, I try to set up a system that is capable of
> > booting even if one of the two disks is removed or broken. The BIOS
> > supports this.
> > 
> > As the Debian installer is not capable of installing btrfs raid1, I 
> > installed Bullseye using /dev/md0 for /boot (ext2) and a / btrfs on
> > /dev/sda3. This works of course. After install I added /dev/sdb3 to
> > the / fs: OK.
> 
> Did you 'just' add the disk to the filesystem, or did you also do a
> next step of converting the existing data to the raid1 profile?

AFAIK this is what I need to do to convert sda3 mounted on / to a
raid1 using sda3/sdb3:

btrfs device add /dev/sdb3 /
btrfs balance start -dconvert=raid1 -mconvert=raid1 /

> If you start out with 1 disk and simply add another, it tells btrfs
> that it can continue writing just 1 (!) copy of your data wherever it 
> likes. And, in this case, the filesystem *always* wants (needs!) all 
> disks to be present to mount, of course.
> 
> disk 1  disk 2
> A       C
> B       E
> D
> 
> If you want everything duplicated on both disks, you need to convert
> the existing data that you already had on the first disk to the raid1 
> profile, and from then on, it will keep writing 2 copies of the data
> on any two disks in the filesystem (but you have exactly 2, so it's
> always on both of those two in that case).
> 
> disk 1  disk 2
> A       D
> B       B
> D       C
> C       A
> 
> If the previous installed system still works well when you add back
> the second disk again, you can still do this. (so, when you did not
> force any destructive operations, and just had it fail like seen
> below)
> 
> Can you share output of the following commands:
> 
> btrfs fi usage <mountpoint>
> 
> With the following command you let it convert all (d)ata and
> (m)etadata to the raid1 profile:
> 
> btrfs balance start -dconvert=raid1 -mconvert=raid1 /

That's what I did

> Afterwards, you can check the result with the usage command. The
> data, metadata, and system lines in the output of the usage command
> should all say RAID1, and you should see that on both disks, a
> similar amount of data is present.

Just chose the grub boot option "Debian 11 on sda6" (an older install),
this works but in fact this seems to be the sda3/sdb3 raid1. I must have
messed up grub somewhere:

btrfs filesystem show
Label: none  uuid: f9cf579f-d3d9-49b2-ab0d-ba258e9df3d8
        Total devices 2 FS bytes used 1.15GiB
        devid    1 size 16.00GiB used 2.28GiB path /dev/sda3
        devid    2 size 16.00GiB used 2.28GiB path /dev/sdb3

Label: none  uuid: 1739f989-05e0-48d8-b99a-67f91c18c892
        Total devices 2 FS bytes used 448.00KiB
        devid    1 size 16.00GiB used 2.57GiB path /dev/sda5
        devid    2 size 16.00GiB used 2.56GiB path /dev/sdb5

Label: 'data'  uuid: 3173a224-830f-41d7-8870-3db0e8c986c9
        Total devices 2 FS bytes used 1020.38MiB
        devid    1 size 187.32GiB used 2.01GiB path /dev/sda6
        devid    2 size 187.32GiB used 2.01GiB path /dev/sdb6

I will first clean up all the mess I created.

"There are two types of people: those who have lost data and those who
will" :-)

R.

-- 
richard lucassen
https://contact.xaq.nl/

      reply	other threads:[~2022-05-04 13:00 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-04  9:23 Debian Bullseye install btrfs raid1 richard lucassen
2022-05-04  9:27 ` Nikolay Borisov
2022-05-04  9:30   ` richard lucassen
2022-05-04 10:02   ` richard lucassen
2022-05-04 10:07     ` Nikolay Borisov
2022-05-04 10:14       ` richard lucassen
2022-05-04 10:26         ` Andy Smith
2022-05-04 11:16           ` richard lucassen
2022-05-04 18:15         ` Andrei Borzenkov
2022-05-04 19:33           ` richard lucassen
2022-05-05  8:27             ` Nikolay Borisov
2022-05-05 20:30               ` richard lucassen
2022-05-09  6:50             ` Andrei Borzenkov
2022-05-04 12:06 ` Hans van Kranenburg
2022-05-04 12:59   ` richard lucassen [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=20220504145951.93293c35de0a7a6c464e12c5@lucassen.org \
    --to=mailinglists@lucassen.org \
    --cc=linux-btrfs@vger.kernel.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 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.