All of lore.kernel.org
 help / color / mirror / Atom feed
From: Johannes Kastl <kastl@b1-systems.de>
To: linux-btrfs@vger.kernel.org
Subject: 'btrfs rescue' command (recommended by btrfs check) fails on old BTRFS RAID1 on (currently) openSUSE Leap 15.3
Date: Sat, 23 Apr 2022 20:39:57 +0200	[thread overview]
Message-ID: <17981e45-a182-60ce-5a02-31616609410a@b1-systems.de> (raw)


[-- Attachment #1.1: Type: text/plain, Size: 4963 bytes --]

Good evening,

I need your advice on how to continue with one of my BTRFS RAID1 setups.

The machine and the BTRFS RAID1 were built/created in 2014, as far as I can say. 
It was built using openSUSE Leap, I think 13.X or similar. The machine was then 
constantly upgraded and is now running openSUSE Leap 15.3 with a 5.3.18 kernel 
(detailed infos below).

As one of the HDDs started reporting SMART errors, I just dd'ed each of the 4TB 
disks onto new 8TB disks (and fixed the GPT backup). I did not resize the 
filesystem, so it is still 3.6 TiB like on the old HDDs.
To make sure that the filesystem was working, I issued a btrfsck against each of 
the devices.

The output of the check is below. The TL;DR was that I should run 'btrfs rescue 
fix-device-size' to fix a "minor" issue.

Unfortunately, running this command fails:

> root dumbo:/root # btrfs rescue fix-device-size /dev/sdc1
> Unable to find block group for 0
> Unable to find block group for 0
> Unable to find block group for 0
> btrfs unable to find ref byte nr 2959295381504 parent 0 root 3  owner 1 offset 0
> transaction.c:168: btrfs_commit_transaction: BUG_ON `ret` triggered, value -5
> btrfs(+0x51f99)[0x55aeeae12f99]
> btrfs(btrfs_commit_transaction+0x193)[0x55aeeae13573]
> btrfs(btrfs_fix_device_size+0x123)[0x55aeeadfe2a3]
> btrfs(btrfs_fix_device_and_super_size+0x6b)[0x55aeeadfe56b]
> btrfs(+0x6ceee)[0x55aeeae2deee]
> btrfs(main+0x8e)[0x55aeeade008e]
> /lib64/libc.so.6(__libc_start_main+0xef)[0x7f907fc0d2bd]
> btrfs(_start+0x2a)[0x55aeeade028a]
> Aborted (core dumped)
> root dumbo:/root #

So, my question is what I should do:

Do I need to run another command to fix this issue?
Can I safely ignore the issue?
Should I copy all of the data to another disk, and create a new BTRFS RAID1 from 
scratch? (Which of course I would like to avoid, if possible...)

Maybe someone can advise me on how to proceed. I am grateful for all of the 
input I get.

If there is other information I should give, please feel free to reach out to me.

Kind Regards
Johannes

#######################################################################
btrfs check output:

> root dumbo:/root # btrfs check -p /dev/sdc1 ;btrfs check -p /dev/sdd1
> Opening filesystem to check...
> Checking filesystem on /dev/sdc1
> UUID: 50651b41-bf33-47e7-8a08-afbc71ba0bf8
> [1/7] checking root items                      (0:03:09 elapsed, 9467877 items checked)
> WARNING: unaligned total_bytes detected for devid 2, have 4000785964544 should be aligned to 4096
> WARNING: this is OK for older kernel, but may cause kernel warning for newer kernels
> WARNING: this can be fixed by 'btrfs rescue fix-device-size'
> [2/7] checking extents                         (0:38:38 elapsed, 6910485 items checked)
> WARNING: minor unaligned/mismatch device size detected
> WARNING: recommended to use 'btrfs rescue fix-device-size' to fix it
> [3/7] checking free space cache                (0:02:26 elapsed, 3730 items checked)
> [4/7] checking fs roots                        (6:43:40 elapsed, 6614818 items checked)
> [5/7] checking csums (without verifying data)  (0:10:36 elapsed, 1419101 items checked)
> [6/7] checking root refs                       (0:00:00 elapsed, 4 items checked)
> [7/7] checking quota groups skipped (not enabled on this FS)
> found 3308275023872 bytes used, no error found
> total csum bytes: 3119386928
> total tree bytes: 113221238784
> total fs tree bytes: 108770082816
> total extent tree bytes: 971456512
> btree space waste bytes: 15308811797
> file data blocks allocated: 3195053785088
>  referenced 3195047018496

#######################################################################

Machine and filesystem details

> $ uname -a
> Linux dumbo 5.3.18-150300.59.60-default #1 SMP Fri Mar 18 18:37:08 UTC 2022 (79e1683) x86_64 x86_64 x86_64 GNU/Linux
> 
> # btrfs --version
> btrfs-progs v4.19.1
> 
> # btrfs fi show
> Label: 'DUMBO_BACKUP_4TB'  uuid: 50651b41-bf33-47e7-8a08-afbc71ba0bf8
>         Total devices 2 FS bytes used 3.08TiB
>         devid    1 size 3.64TiB used 3.64TiB path /dev/sdd1
>         devid    2 size 3.64TiB used 3.63TiB path /dev/sdc1
> 
> # btrfs fi df /mnt/DUMBO_BACKUP_4TB/
> Data, RAID1: total=3.36TiB, used=2.97TiB
> Data, DUP: total=13.50MiB, used=2.81MiB
> Data, single: total=1.00GiB, used=0.00B
> System, RAID1: total=32.00MiB, used=560.00KiB
> System, single: total=32.00MiB, used=0.00B
> Metadata, RAID1: total=284.94GiB, used=108.05GiB
> Metadata, DUP: total=512.00MiB, used=64.00KiB
> Metadata, single: total=1.00GiB, used=0.00B
> GlobalReserve, single: total=512.00MiB, used=0.00B

-- 
Johannes Kastl
Linux Consultant & Trainer
Tel.: +49 (0) 151 2372 5802
Mail: kastl@b1-systems.de

B1 Systems GmbH
Osterfeldstraße 7 / 85088 Vohburg
http://www.b1-systems.de
GF: Ralph Dehner
Unternehmenssitz: Vohburg / AG: Ingolstadt,HRB 3537

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 840 bytes --]

             reply	other threads:[~2022-04-23 18:45 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-23 18:39 Johannes Kastl [this message]
2022-04-23 23:07 ` 'btrfs rescue' command (recommended by btrfs check) fails on old BTRFS RAID1 on (currently) openSUSE Leap 15.3 Qu Wenruo
2022-04-24  9:10   ` Johannes Kastl
2022-04-24  9:21     ` Qu Wenruo
2022-05-18 10:38       ` Johannes Kastl
2022-05-18 10:59         ` Qu Wenruo
2022-05-20 15:14           ` Johannes Kastl
2022-05-20 20:21             ` Johannes Kastl
2022-05-21  1:10               ` Qu Wenruo
2022-05-24  7:44                 ` Johannes Kastl

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=17981e45-a182-60ce-5a02-31616609410a@b1-systems.de \
    --to=kastl@b1-systems.de \
    --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.