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 <74cmo...@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.



Reply via email to