All of lore.kernel.org
 help / color / mirror / Atom feed
* unable to run mkfs.btrfs for host managed sata hdd
@ 2021-10-29 12:48 Jingyun He
  2021-10-29 13:22 ` David Sterba
  0 siblings, 1 reply; 4+ messages in thread
From: Jingyun He @ 2021-10-29 12:48 UTC (permalink / raw)
  To: linux-btrfs

Hello, all
I have a LSI 2308 HBA in IT mode, and attached a sata host managed disk.
And run mkfs.btrfs /dev/sdb -O zoned -d single -m single -f
get following errors:
btrfs-progs v5.13.1
ERROR: superblock magic doesn't match
Resetting device zones /dev/sdb (67056 zones) ...
ERROR: error during mkfs: Operation not permitted

the lsscsi shows it is disk, instead of zbc

[6:0:4:0]    disk    ATA      HGST HSH721414AL T10D  /dev/sdb

Can anyone help me with this?

Thanks.

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

* Re: unable to run mkfs.btrfs for host managed sata hdd
  2021-10-29 12:48 unable to run mkfs.btrfs for host managed sata hdd Jingyun He
@ 2021-10-29 13:22 ` David Sterba
  2021-10-29 13:52   ` Jingyun He
  0 siblings, 1 reply; 4+ messages in thread
From: David Sterba @ 2021-10-29 13:22 UTC (permalink / raw)
  To: Jingyun He; +Cc: linux-btrfs

On Fri, Oct 29, 2021 at 08:48:45PM +0800, Jingyun He wrote:
> Hello, all
> I have a LSI 2308 HBA in IT mode, and attached a sata host managed disk.
> And run mkfs.btrfs /dev/sdb -O zoned -d single -m single -f
> get following errors:
> btrfs-progs v5.13.1
> ERROR: superblock magic doesn't match
> Resetting device zones /dev/sdb (67056 zones) ...
> ERROR: error during mkfs: Operation not permitted

Can you also reset the zones by 'blkzone reset' under the same user
account that also runs the 'mkfs.btrfs' command?

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

* Re: unable to run mkfs.btrfs for host managed sata hdd
  2021-10-29 13:22 ` David Sterba
@ 2021-10-29 13:52   ` Jingyun He
  2021-10-29 14:21     ` David Sterba
  0 siblings, 1 reply; 4+ messages in thread
From: Jingyun He @ 2021-10-29 13:52 UTC (permalink / raw)
  To: dsterba, Jingyun He, linux-btrfs

Hi,
Thanks for your reply,
I run these commands under root account.

After debugging this furthermore,

The issue looks like LSI 2308 doesn't report it as a host managed device.

If I connect it to the onboard SATA port, everything is working fine.

I'm not sure if there is any method to run mkfs.btrfs forcely, as even
LSI 2308 didn't report it as a host managed device, but it can pass
most of the libzbc tests.

On Fri, Oct 29, 2021 at 9:23 PM David Sterba <dsterba@suse.cz> wrote:
>
> On Fri, Oct 29, 2021 at 08:48:45PM +0800, Jingyun He wrote:
> > Hello, all
> > I have a LSI 2308 HBA in IT mode, and attached a sata host managed disk.
> > And run mkfs.btrfs /dev/sdb -O zoned -d single -m single -f
> > get following errors:
> > btrfs-progs v5.13.1
> > ERROR: superblock magic doesn't match
> > Resetting device zones /dev/sdb (67056 zones) ...
> > ERROR: error during mkfs: Operation not permitted
>
> Can you also reset the zones by 'blkzone reset' under the same user
> account that also runs the 'mkfs.btrfs' command?

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

* Re: unable to run mkfs.btrfs for host managed sata hdd
  2021-10-29 13:52   ` Jingyun He
@ 2021-10-29 14:21     ` David Sterba
  0 siblings, 0 replies; 4+ messages in thread
From: David Sterba @ 2021-10-29 14:21 UTC (permalink / raw)
  To: Jingyun He; +Cc: dsterba, linux-btrfs

On Fri, Oct 29, 2021 at 09:52:34PM +0800, Jingyun He wrote:
> Hi,
> Thanks for your reply,
> I run these commands under root account.
> 
> After debugging this furthermore,
> 
> The issue looks like LSI 2308 doesn't report it as a host managed device.
> 
> If I connect it to the onboard SATA port, everything is working fine.
> 
> I'm not sure if there is any method to run mkfs.btrfs forcely, as even
> LSI 2308 didn't report it as a host managed device, but it can pass
> most of the libzbc tests.

mkfs relies on the kernel interfaces to access the zone information, ie.
the ioctls to report and reset the zones. AFAIK libzbc works in a
different way and tracks the zone information outside of the device and
can work as an emulation layer.

https://zonedstorage.io/projects/libzbc/
"libzbc command implementation is compliant with the latest published
versions of the ZBC and ZAC standards defined by INCITS technical
committees T10 and T13 (respectively)."

You could connect the two together so there's normal block device that
also works as a native host-managed zoned devices.  For testing I've
been using TCMU runner that utilizes the libzbc library and exports the
block devices backed by file images.

But if the problem is on the lower layer where the LSI controller does
not pass the ZBC ioctls at all I don't see a way how you could use the
combination because simply calling zone reset would not work and that's
quite fundamental limitation.

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

end of thread, other threads:[~2021-10-29 14:21 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-29 12:48 unable to run mkfs.btrfs for host managed sata hdd Jingyun He
2021-10-29 13:22 ` David Sterba
2021-10-29 13:52   ` Jingyun He
2021-10-29 14:21     ` David Sterba

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.