---
name: "nvme_init_ns_attach-libnvme3"
section: "2"
platform: "linux"
package: "nvme-cli"
version: "3.2-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/nvme_init_ns_attach-libnvme3"
---

# nvme\_init\_ns\_attach-libnvme3(2)

Initialize passthru command for Namespace Attach/Detach

## NAME

nvme\_init\_ns\_attach - Initialize passthru command for Namespace Attach/Detach

## SYNOPSIS

**void nvme\_init\_ns\_attach** **(struct libnvme\_passthru\_cmd \*cmd** *,* **\_\_u32 nsid** *,* **enum nvme\_ns\_attach\_sel sel** *,* **struct nvme\_ctrl\_list \*ctrlist** *);*

## ARGUMENTS

- cmd

  Passthru command to use

- nsid

  Namespace ID to execute attach selection

- sel

  Attachment selection, see *enum nvme\_ns\_attach\_sel*

- ctrlist

  Controller list buffer to modify attachment state of nsid

## DESCRIPTION

Initializes the passthru command buffer for the Namespace Attach/Detach command.
