LinuxCommandLibrary

wdctl

Control and configure Western Digital storage devices

TLDR

Display the watchdog status

$ wdctl
copy

Display the watchdog status in a single line in key-value pairs
$ wdctl [[-O|--oneline]]
copy

Display only specific watchdog flags (list is driver specific)
$ wdctl [[-f|--flags]] [flag_list]
copy

SYNOPSIS

wdctl [options] [device]

PARAMETERS

show
    Displays detailed information about a specific drive or all drives. Can specify the device name, or show all devices.

identify
    Displays identification information about a specific drive.

smart-info
    Retrieves and displays SMART (Self-Monitoring, Analysis and Reporting Technology) attributes of a drive to see overall health and temperature monitoring.

update-firmware
    Updates the firmware of a specific drive. Requires a firmware image file.

security-erase
    Initiates a security erase on a drive. Note: This operation will overwrite the drive.

help
    Displays help information about the `wdctl` command and available subcommands.


    Specifies the device to operate on, e.g., `/dev/sda` or `/dev/nvme0n1`.

-d
    Can be used to specify the path for the device to manage.

DESCRIPTION

The `wdctl` command is a utility for interacting with and managing Western Digital (WD) storage devices on Linux systems. Primarily designed for SAS and NVMe drives, it allows users to query drive information, manage firmware, monitor health, and perform other diagnostic or administrative tasks.

It's especially useful in server environments where WD drives are common and need to be monitored or managed in bulk. `wdctl` is the primary mechanism for administrators to get critical insight and control of their attached WD storage devices.

Without root access, running `wdctl` will error with `Permission denied`. This tool requires appropriate permissions to access the raw device files representing the drives. You may need to adjust udev rules or run with `sudo`.

CAVEATS

Firmware updates can be risky; ensure you have backups and understand the process before proceeding. The security erase function will permanently delete all data from the drive. Improper use of `wdctl` can lead to data loss or device instability.

DEVICE NAMING

Linux device names for WD drives will vary depending on the interface (SATA, SAS, NVMe). Common examples are `/dev/sda`, `/dev/sdb` for SATA/SAS, and `/dev/nvme0n1`, `/dev/nvme1n1` for NVMe drives. Use commands like `lsblk` or `fdisk -l` to identify the correct device name before using `wdctl`.

ERROR HANDLING

When an operation fails, `wdctl` typically provides an error message. Pay close attention to these messages as they can provide clues as to the root cause, such as permission issues, device unavailability, or incompatible firmware.

HISTORY

The `wdctl` command is a relatively recent addition to Linux tools, specifically designed by Western Digital for managing their storage devices. It arose from the need for a standardized and reliable way to interact with WD drives, particularly in enterprise environments where more generic tools might not offer the specific features or detail required.

SEE ALSO

smartctl(8), hdparm(8), nvme(1)

Copied to clipboard