All of lore.kernel.org
 help / color / mirror / Atom feed
From: Roman Mamedov <rm@romanrm.net>
To: xerobrinhek <xerobrinhek@proton.me>
Cc: linux-btrfs@vger.kernel.org
Subject: Re: btrfs: multi-device pool corrupted after repeated removal/recreation of missing device
Date: Sun, 31 May 2026 03:55:26 +0500	[thread overview]
Message-ID: <20260531035526.17ac92c3@nvm> (raw)
In-Reply-To: <ISRv0Ku3zGY139-n3o62hjAyUorcln7sKNLrUViaahtGK-bidGOIjXvj6OeK6_od0CwGnW0RuTP1Un8PXSUv6owZVbEfIJkRuiS8NLwIBqU=@proton.me>

On Sat, 30 May 2026 20:25:42 +0000
xerobrinhek <xerobrinhek@proton.me> wrote:

> Hello btrfs developers,
> 
> I have a btrfs multi-device setup that got corrupted after a failed device
> removal. I need help recovering the filesystem structure (not just raw file
> extraction).
> 
> Setup:
> 
> - Two devices: nvme0n1p9 (17.53GB) and nvme0n1p8 (31,30GB) originally
> 
> - The filesystem uses subvolumes: @, @home, @var, @snapshots
> 
> - Compression: enabled (zstd)

What were the profiles used for data and metadata? Since they were both on the
same physical device, did you use "single"? And what for metadata, e.g. I
believe DUP wouldn't guarantee copies across different devices in this case.

> 1. I removed /dev/nvme0n1p8 (devid 2) from the pool without proper 'btrfs device remove'

How do you "remove" partition 8 of an NVMe drive, at the same time retaining
partition 9 of the same NVMe drive? Just by deleting the partition? Recreating
it with the same offset would have been enough to make btrfs see it again
(after a device-scan).

> 2. I tried to recreate the missing device multiple times, creating and removing btrfs on it

This bit sounds weird, what exactly do you mean by that? If mkfs.btrfs, then
that makes an entirely separate FS, ruining all data that was on there before,
and with a guarantee to do so, because it full-device TRIMs the partition.

> I understand the risk of data loss. My goal is to restore the filesystem
> structure (subvolumes, names, directory hierarchy), not just raw file
> extraction.

I'd suggest to abandon that goal, all of that doesn't seem comparably as
important as the actual data (that you can try to btrfs-recover or just restore
from backups).

-- 
With respect,
Roman

      reply	other threads:[~2026-05-30 23:03 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <JJ5S5tQDVkTmHxqx0ncj423p-TgogJGM8fSviYuGeF1i-xc7NtTdlmd1VO0aopC3SEVqYZF_Z6opVqrTz4eJ8sbDOiceQNzgwnjerSXJWhM=@proton.me>
2026-05-30 20:25 ` btrfs: multi-device pool corrupted after repeated removal/recreation of missing device xerobrinhek
2026-05-30 22:55   ` Roman Mamedov [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=20260531035526.17ac92c3@nvm \
    --to=rm@romanrm.net \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=xerobrinhek@proton.me \
    /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.