All of lore.kernel.org
 help / color / mirror / Atom feed
* "btrfs replace" ERROR: checking status of targetdev
@ 2021-05-01 21:39 Yan Li
  2021-05-01 22:16 ` Yan Li
  2021-05-02  0:44 ` Qu Wenruo
  0 siblings, 2 replies; 5+ messages in thread
From: Yan Li @ 2021-05-01 21:39 UTC (permalink / raw)
  To: linux-btrfs; +Cc: Yan Li

Hi!

I have a raid1 btrfs with one device missing:
$ sudo mount -o compress-force=zstd:9,relatime,space_cache=v2,degraded
/dev/mapper/open_offsite_bak1 /mnt/offsite_bak
$ sudo btrfs fi show /mnt/offsite_bak
Label: none  uuid: 99acc0da-127f-4034-8d53-07851cbbccba
Total devices 4 FS bytes used 8.75TiB
devid    1 size 4.55TiB used 3.53TiB path dm-11
devid    2 size 12.73TiB used 8.76TiB path dm-12
devid    4 size 3.64TiB used 2.62TiB path dm-14
*** Some devices missing

Now I'm trying to replace it with another drive according to the
instructions on the wiki
(https://btrfs.wiki.kernel.org/index.php/Using_Btrfs_with_Multiple_Devices#Using_btrfs_replace):

$ sudo btrfs replace start -r 3 /dev/mapper/open_offsite_bak5 /mnt/offsite_bak/
ERROR: checking status of dm-13: No such file or directory

/dev/mapper/open_offsite_bak5 indeed is a link to /dev/dm-13.
$ sudo btrfs replace start -r 3 /dev/dm-13 /mnt/offsite_bak/
shows exactly the same error.

The device is fine if I try:
sudo dd if=/dev/dm-13 of=/dev/null count=1

There's no error message in dmesg.

What could be the problem? I feel like it should be a stupid error on
my part but I just can't figure out. "btrfs replace" doesn't support
using a devicemapper device?

Kernel: 5.11.0-16-generic
btrfs-progs: 5.10.1-1build1
Both from Ubuntu 21.04 with latest updates.

Thanks!

--
Yan

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: "btrfs replace" ERROR: checking status of targetdev
  2021-05-01 21:39 "btrfs replace" ERROR: checking status of targetdev Yan Li
@ 2021-05-01 22:16 ` Yan Li
  2021-05-02  0:44 ` Qu Wenruo
  1 sibling, 0 replies; 5+ messages in thread
From: Yan Li @ 2021-05-01 22:16 UTC (permalink / raw)
  To: linux-btrfs; +Cc: Yan Li

On Sat, May 1, 2021 at 2:39 PM Yan Li <elliot.li.tech@gmail.com> wrote:
> $ sudo btrfs replace start -r 3 /dev/mapper/open_offsite_bak5 /mnt/offsite_bak/
> ERROR: checking status of dm-13: No such file or directory

If I run the above command in the /dev directory, it would segfault
instead of reporting the error. Now this looks like a bug in the
`btrfs' program. Guess I'll have to compile the latest source code and
try.

-- 
Yan

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: "btrfs replace" ERROR: checking status of targetdev
  2021-05-01 21:39 "btrfs replace" ERROR: checking status of targetdev Yan Li
  2021-05-01 22:16 ` Yan Li
@ 2021-05-02  0:44 ` Qu Wenruo
  2021-05-02  2:08   ` Yan Li
  1 sibling, 1 reply; 5+ messages in thread
From: Qu Wenruo @ 2021-05-02  0:44 UTC (permalink / raw)
  To: Yan Li, linux-btrfs



On 2021/5/2 上午5:39, Yan Li wrote:
> Hi!
>
> I have a raid1 btrfs with one device missing:
> $ sudo mount -o compress-force=zstd:9,relatime,space_cache=v2,degraded
> /dev/mapper/open_offsite_bak1 /mnt/offsite_bak
> $ sudo btrfs fi show /mnt/offsite_bak
> Label: none  uuid: 99acc0da-127f-4034-8d53-07851cbbccba
> Total devices 4 FS bytes used 8.75TiB
> devid    1 size 4.55TiB used 3.53TiB path dm-11
> devid    2 size 12.73TiB used 8.76TiB path dm-12
> devid    4 size 3.64TiB used 2.62TiB path dm-14
> *** Some devices missing
>
> Now I'm trying to replace it with another drive according to the
> instructions on the wiki
> (https://btrfs.wiki.kernel.org/index.php/Using_Btrfs_with_Multiple_Devices#Using_btrfs_replace):
>
> $ sudo btrfs replace start -r 3 /dev/mapper/open_offsite_bak5 /mnt/offsite_bak/
> ERROR: checking status of dm-13: No such file or directory
>
> /dev/mapper/open_offsite_bak5 indeed is a link to /dev/dm-13.
> $ sudo btrfs replace start -r 3 /dev/dm-13 /mnt/offsite_bak/
> shows exactly the same error.
>
> The device is fine if I try:
> sudo dd if=/dev/dm-13 of=/dev/null count=1
>
> There's no error message in dmesg.
>
> What could be the problem? I feel like it should be a stupid error on
> my part but I just can't figure out. "btrfs replace" doesn't support
> using a devicemapper device?
>
> Kernel: 5.11.0-16-generic
> btrfs-progs: 5.10.1-1build1

It looks like a bug in btrfs-progs.

Fixed in v5.11 btrfs-progs.

Would you please try to use v5.11 btrfs-progs to see if it solves your
problem.

Thanks,
Qu
> Both from Ubuntu 21.04 with latest updates.
>
> Thanks!
>
> --
> Yan
>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: "btrfs replace" ERROR: checking status of targetdev
  2021-05-02  0:44 ` Qu Wenruo
@ 2021-05-02  2:08   ` Yan Li
  2021-05-02  2:28     ` Qu Wenruo
  0 siblings, 1 reply; 5+ messages in thread
From: Yan Li @ 2021-05-02  2:08 UTC (permalink / raw)
  To: Qu Wenruo; +Cc: linux-btrfs

On Sat, May 1, 2021 at 5:44 PM Qu Wenruo <quwenruo.btrfs@gmx.com> wrote:
> It looks like a bug in btrfs-progs.
>
> Fixed in v5.11 btrfs-progs.
>
> Would you please try to use v5.11 btrfs-progs to see if it solves your
> problem.

Indeed. This is fixed in 5.11. Thanks!

-- 
Yan

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: "btrfs replace" ERROR: checking status of targetdev
  2021-05-02  2:08   ` Yan Li
@ 2021-05-02  2:28     ` Qu Wenruo
  0 siblings, 0 replies; 5+ messages in thread
From: Qu Wenruo @ 2021-05-02  2:28 UTC (permalink / raw)
  To: Yan Li; +Cc: linux-btrfs



On 2021/5/2 上午10:08, Yan Li wrote:
> On Sat, May 1, 2021 at 5:44 PM Qu Wenruo <quwenruo.btrfs@gmx.com> wrote:
>> It looks like a bug in btrfs-progs.
>>
>> Fixed in v5.11 btrfs-progs.
>>
>> Would you please try to use v5.11 btrfs-progs to see if it solves your
>> problem.
>
> Indeed. This is fixed in 5.11. Thanks!
>

Just a note for anyone maintaining btrfs-progs for various distros, the
fix is commit 2347b34af4d8 ("btrfs-progs: fix device mapper path
canonicalization").

Thanks,
Qu

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-05-02  2:31 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-01 21:39 "btrfs replace" ERROR: checking status of targetdev Yan Li
2021-05-01 22:16 ` Yan Li
2021-05-02  0:44 ` Qu Wenruo
2021-05-02  2:08   ` Yan Li
2021-05-02  2:28     ` Qu Wenruo

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.