From: Thomas Schneider <74cmonty@gmail.com>
To: Chris Murphy <lists@colorremedies.com>
Cc: Wang Yugui <wangyugui@e16-tech.com>,
Btrfs BTRFS <linux-btrfs@vger.kernel.org>
Subject: Re: BTRFS error (device sda1): bdev /dev/sdb1 errs: wr 2702175, rd 2719033, flush 0, corrupt 6, gen 0
Date: Sat, 20 Mar 2021 10:53:23 +0100 [thread overview]
Message-ID: <359864d4-6f40-b7e2-bf40-a44ffd053f4b@gmail.com> (raw)
In-Reply-To: <CAJCQCtR5zeC=jNRf0iSHpqQXDOBExfFzfGj+PzMTxs_S1JVmVg@mail.gmail.com>
Hello Chris,
many thanks for your analysis.
I'm not sure how to proceed in order to fix this error.
Obviously both devices, sda and sdb, are not partitioned 100%
correct/optimal.
Therefore I consider to restart from scratch, means
- creating a file backup of OS
- deleting any partion on sda and sdb
- create 2 partitions on sda, part #1 for OS + part #2 for swap
(swapfile is not working with BTRFS on multiple drives)
- restoring the (file) backup
Question:
Would you recommend to create a swap partition on sdb, too?
Regards
Thomas
Am 13.03.2021 um 19:02 schrieb Chris Murphy:
> On Sat, Mar 13, 2021 at 5:22 AM Thomas <74cmonty@gmail.com> wrote:
>
>> Gerät Boot Anfang Ende Sektoren Größe Kn Typ
>> /dev/sdb1 2048 496093750 496091703 236,6G 83 Linux
>> However the output of btrfs insp dump-s <device> is different:
>> thomas@pc1-desktop:~
>> $ sudo btrfs insp dump-s /dev/sdb1 | grep dev_item.total_bytes
>> dev_item.total_bytes 256059465728
> sdb1 has 253998951936 bytes which is *less* than the btrfs super block
> is saying it should be. 1.919 GiB less. I'm going to guess that the
> sdb1 partition was reduced without first shrinking the file system.
> The most common way this happens is not realizing that each member
> device of a btrfs file system must be separately shrunk. If you do not
> specify a devid, then devid 1 is assumed.
>
> man btrfs filesystem
> "The devid can be found in the output of btrfs filesystem show and
> defaults to 1 if not specified."
>
> I bet that the file system was shunk one time, this shrunk only devid
> 1 which is also /dev/sda1. But then both partitions were shrunk
> thereby truncating sdb1, resulting in these errors.
>
> If that's correct, you need to change the sdb1 partition back to its
> original size (matching the size of the sdb1 btrfs superblock). Scrub
> the file system so sdb1 can be repaired from any prior damage from the
> mistake. Shrink this devid to match the size of the other devid, and
> then change the partition.
>
>
>
>> Gerät Boot Anfang Ende Sektoren Größe Kn Typ
>> /dev/sda1 * 2048 496093750 496091703 236,6G 83 Linux
>>
>> thomas@pc1-desktop:~
>> $ sudo btrfs insp dump-s /dev/sda1 | grep dev_item.total_bytes
>> dev_item.total_bytes 253998948352
> This is fine. The file system is 3584 bytes less than the partition.
> I'm not sure why it doesn't end on a 4KiB block boundary or why
> there's a gap before the start of sda2...but at least it's benign.
>
>
next prev parent reply other threads:[~2021-03-20 11:15 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-12 7:47 BTRFS error (device sda1): bdev /dev/sdb1 errs: wr 2702175, rd 2719033, flush 0, corrupt 6, gen 0 Thomas
2021-03-13 6:59 ` Chris Murphy
2021-03-13 7:21 ` Wang Yugui
2021-03-13 12:21 ` Thomas
2021-03-13 18:02 ` Chris Murphy
2021-03-20 9:53 ` Thomas Schneider [this message]
2021-04-02 20:46 ` Thomas
2021-04-03 17:28 ` Lukas Straub
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=359864d4-6f40-b7e2-bf40-a44ffd053f4b@gmail.com \
--to=74cmonty@gmail.com \
--cc=linux-btrfs@vger.kernel.org \
--cc=lists@colorremedies.com \
--cc=wangyugui@e16-tech.com \
/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;
as well as URLs for NNTP newsgroup(s).