linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Jakob Schöttl" <jschoett@gmail.com>
To: Qu Wenruo <quwenruo.btrfs@gmx.com>, linux-btrfs@vger.kernel.org
Subject: Re: Cannot 'mount -o degraded /dev/replacement' after a replace
Date: Sat, 9 Feb 2019 14:45:00 +0100	[thread overview]
Message-ID: <57d3a28d-bf6e-7f89-3a2d-ebcb90fc6e32@gmail.com> (raw)
In-Reply-To: <5441dc9d-a552-e77e-f74d-fe6ef702d400@gmx.com>

Thanks Qu,

Am 09.02.19 um 13:16 schrieb Qu Wenruo:
> On 2019/2/9 下午6:36, Jakob Schöttl wrote:
>> Hi,
>>
>> I've setup a RAID1 with two disks (disk1 and disk2) and I'm testing the
>> btrfs replace command.
>>
>> After replacing disk2 with disk3, I can only mount
>> (a) disk1 or disk3 (if both disk are plugged) and
>> (b) the original disk1 (degraded, if disk3 is unplugged).
>>
>> I cannot mount the replacement disk3 if disk1 is unplugged.
> Sounds like there is one single chunk on disk1, which caused the problem.
>
>>> mount: /mnt: wrong fs type, bad option, bad superblock on /dev/loop3,
>> missing codepage or helper program, or other error.
> dmesg please.
[60456.856883] BTRFS: device label datavol devid 1 transid 5 /dev/loop1
[60456.940785] BTRFS: device label datavol devid 2 transid 5 /dev/loop2
[60525.211389] BTRFS info (device loop1): allowing degraded mounts
[60525.211395] BTRFS info (device loop1): disk space caching is enabled
[60525.211398] BTRFS info (device loop1): has skinny extents
[60525.211401] BTRFS info (device loop1): flagging fs with big metadata 
feature
[60525.213854] BTRFS warning (device loop1): devid 2 uuid 
0b4e0b31-e2b1-40a0-8360-09978f58a2e4 is missing
[60525.214639] BTRFS info (device loop1): checking UUID tree
[60525.386695] BTRFS info (device loop1): dev_replace from <missing 
disk> (devid 2) to /dev/loop3 started
[60525.394403] BTRFS info (device loop1): dev_replace from <missing 
disk> (devid 2) to /dev/loop3 finished
[60533.721841] BTRFS info (device loop3): allowing degraded mounts
[60533.721846] BTRFS info (device loop3): disk space caching is enabled
[60533.721850] BTRFS info (device loop3): has skinny extents
[60533.723703] BTRFS error (device loop3): failed to read chunk root
[60533.773553] BTRFS error (device loop3): open_ctree failed

> And btrfs-progs version please.
$ pacman -Q btrfs-progs
btrfs-progs 4.20.1-2
$ uname -a
Linux jathink 4.20.7-arch1-1-ARCH #1 SMP PREEMPT Wed Feb 6 18:42:40 UTC 
2019 x86_64 GNU/Linux

> Maybe mkfs is too old to leave SINGLE profile chunks on the original fs.
>
> And you could verify the chunk mapping by executing 'btrfs ins dump-tree
> -t chunk <device>' and paste the output.

When only /dev/loop3 is plugged:

# btrfs inspect-internal dump-tree -t chunk /dev/loop3
btrfs-progs v4.20.1
warning, device 1 is missing
warning, device 1 is missing
warning, device 1 is missing
warning, device 1 is missing
bad tree block 198180864, bytenr mismatch, want=198180864, have=0
ERROR: cannot read chunk root
ERROR: unable to open /dev/loop3

When only /dev/loop1 is plugged:

# btrfs inspect-internal dump-tree -t chunk /dev/loop1
btrfs-progs v4.20.1
warning, device 2 is missing
chunk tree
leaf 198180864 items 10 free space 15005 generation 8 owner CHUNK_TREE
leaf 198180864 flags 0x1(WRITTEN) backref revision 1
fs uuid 005a8d59-a561-4371-869e-b0ccc4a4862b
chunk uuid b3e609f1-a7fe-4add-bc51-6231f0bbf320
     item 0 key (DEV_ITEMS DEV_ITEM 1) itemoff 16185 itemsize 98
         devid 1 total_bytes 307200000 bytes_used 306053120
         io_align 4096 io_width 4096 sector_size 4096 type 0
         generation 0 start_offset 0 dev_group 0
         seek_speed 0 bandwidth 0
         uuid 043443c7-ac91-4085-a5e4-983b59dd0803
         fsid 005a8d59-a561-4371-869e-b0ccc4a4862b
     item 1 key (DEV_ITEMS DEV_ITEM 2) itemoff 16087 itemsize 98
         devid 2 total_bytes 307200000 bytes_used 109051904
         io_align 4096 io_width 4096 sector_size 4096 type 0
         generation 0 start_offset 0 dev_group 0
         seek_speed 0 bandwidth 0
         uuid 0b4e0b31-e2b1-40a0-8360-09978f58a2e4
         fsid 005a8d59-a561-4371-869e-b0ccc4a4862b
     item 2 key (FIRST_CHUNK_TREE CHUNK_ITEM 22020096) itemoff 15975 
itemsize 112
         length 8388608 owner 2 stripe_len 65536 type SYSTEM|RAID1
         io_align 65536 io_width 65536 sector_size 4096
         num_stripes 2 sub_stripes 0
             stripe 0 devid 2 offset 1048576
             dev_uuid 0b4e0b31-e2b1-40a0-8360-09978f58a2e4
             stripe 1 devid 1 offset 22020096
             dev_uuid 043443c7-ac91-4085-a5e4-983b59dd0803
     item 3 key (FIRST_CHUNK_TREE CHUNK_ITEM 30408704) itemoff 15863 
itemsize 112
         length 33554432 owner 2 stripe_len 65536 type METADATA|RAID1
         io_align 65536 io_width 65536 sector_size 4096
         num_stripes 2 sub_stripes 0
             stripe 0 devid 2 offset 9437184
             dev_uuid 0b4e0b31-e2b1-40a0-8360-09978f58a2e4
             stripe 1 devid 1 offset 30408704
             dev_uuid 043443c7-ac91-4085-a5e4-983b59dd0803
     item 4 key (FIRST_CHUNK_TREE CHUNK_ITEM 63963136) itemoff 15751 
itemsize 112
         length 67108864 owner 2 stripe_len 65536 type DATA|RAID1
         io_align 65536 io_width 65536 sector_size 4096
         num_stripes 2 sub_stripes 0
             stripe 0 devid 2 offset 42991616
             dev_uuid 0b4e0b31-e2b1-40a0-8360-09978f58a2e4
             stripe 1 devid 1 offset 63963136
             dev_uuid 043443c7-ac91-4085-a5e4-983b59dd0803
     item 5 key (FIRST_CHUNK_TREE CHUNK_ITEM 131072000) itemoff 15671 
itemsize 80
         length 33554432 owner 2 stripe_len 65536 type METADATA
         io_align 65536 io_width 65536 sector_size 4096
         num_stripes 1 sub_stripes 1
             stripe 0 devid 1 offset 131072000
             dev_uuid 043443c7-ac91-4085-a5e4-983b59dd0803
     item 6 key (FIRST_CHUNK_TREE CHUNK_ITEM 164626432) itemoff 15591 
itemsize 80
         length 33554432 owner 2 stripe_len 65536 type SYSTEM
         io_align 65536 io_width 65536 sector_size 4096
         num_stripes 1 sub_stripes 1
             stripe 0 devid 1 offset 164626432
             dev_uuid 043443c7-ac91-4085-a5e4-983b59dd0803
     item 7 key (FIRST_CHUNK_TREE CHUNK_ITEM 198180864) itemoff 15479 
itemsize 112
         length 33554432 owner 2 stripe_len 65536 type SYSTEM|DUP
         io_align 65536 io_width 65536 sector_size 4096
         num_stripes 2 sub_stripes 1
             stripe 0 devid 1 offset 198180864
             dev_uuid 043443c7-ac91-4085-a5e4-983b59dd0803
             stripe 1 devid 1 offset 231735296
             dev_uuid 043443c7-ac91-4085-a5e4-983b59dd0803
     item 8 key (FIRST_CHUNK_TREE CHUNK_ITEM 231735296) itemoff 15367 
itemsize 112
         length 20905984 owner 2 stripe_len 65536 type METADATA|DUP
         io_align 65536 io_width 65536 sector_size 4096
         num_stripes 2 sub_stripes 1
             stripe 0 devid 1 offset 265289728
             dev_uuid 043443c7-ac91-4085-a5e4-983b59dd0803
             stripe 1 devid 1 offset 286195712
             dev_uuid 043443c7-ac91-4085-a5e4-983b59dd0803
     item 9 key (FIRST_CHUNK_TREE CHUNK_ITEM 252641280) itemoff 15255 
itemsize 112
         length 10485760 owner 2 stripe_len 65536 type DATA|DUP
         io_align 65536 io_width 65536 sector_size 4096
         num_stripes 2 sub_stripes 1
             stripe 0 devid 1 offset 1048576
             dev_uuid 043443c7-ac91-4085-a5e4-983b59dd0803
             stripe 1 devid 1 offset 11534336
             dev_uuid 043443c7-ac91-4085-a5e4-983b59dd0803



  reply	other threads:[~2019-02-09 13:45 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-09 10:36 Cannot 'mount -o degraded /dev/replacement' after a replace Jakob Schöttl
2019-02-09 12:16 ` Qu Wenruo
2019-02-09 13:45   ` Jakob Schöttl [this message]
2019-02-09 15:32     ` Andrei Borzenkov
2019-02-09 15:57       ` Jakob Schöttl
2019-02-09 15:36 ` Andrei Borzenkov
2019-02-10 18:44 ` Chris Murphy
2019-02-11  1:36   ` Qu Wenruo

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=57d3a28d-bf6e-7f89-3a2d-ebcb90fc6e32@gmail.com \
    --to=jschoett@gmail.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=quwenruo.btrfs@gmx.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).