HOWTO update firmware on a Western Digital SSD in Linux
WARNING: updating firmware is an inherently risky process. Do not attempt to follow the steps below unless you understand the risks involved. If you brick your SSD, I will not buy you a new one. Western Digital probably won’t either.
Western Digital provides firmware updates for its SSDs via a Windows executable. Those running Linux are left out in the cold. However, Linux tools are adequate to the task. Follow these steps to update your SSD firmware without needing to boot Windows on your machine.
You will need the device name of the drive you want to update. This guide does not tell you how to find that. On my system, the device name is nvme0. I will use that name in the examples below. If your device name is different, substitute it for nvme0.
In a terminal, run:
cat /sys/class/nvme/nvme0/model
This is the model of your drive. Then run:
cat /sys/class/nvme/nvme0/firmware_rev
This is the firmware version of your drive. Now find your model in the Western Digital list of devices. You should see an entry that looks like this:
<lista_device model="WD_BLACK SN850X 1000GB">
<url>
wdDashboard/firmware/WD_BLACK_SN850X_1000GB/620241WD/device_properties.xml
</url>
<url>
wdDashboard/firmware/WD_BLACK_SN850X_1000GB/620361WD/device_properties.xml
</url>
</lista_device>
There are two firmware revisions available for the device, numbered 620241WD
and 620361WD. You will generally want to choose the highest firmware revision
for your update, but you may be forced to go through multiple updates if your
firmware is far behind. We’ll talk about that more below. For now, let us
assume that I want to update to version 620361WD. Take the entire string in
the url field and paste https://wddashboarddownloads.wdc.com/
on the front;
e.g., https://wddashboarddownloads.wdc.com/wdDashboard/firmware/WD_BLACK_SN850X_1000GB/620361WD/device_properties.xml
in this example. When you visit that URL, you should see something like this:
<ffu version="1.0">
<model>WD_BLACK SN850X 1000GB</model>
<fwmode>mode3</fwmode>
<fwversion>620361WD</fwversion>
<fwfile>620361WD.fluf</fwfile>
<dependency model="WD_BLACK SN850X 1000GB">620241WD</dependency>
<dependency model="WD_BLACK SN850X 1000GB">620281WD</dependency>
<dependency model="WD_BLACK SN850X 1000GB">620311WD</dependency>
<dependency model="WD_BLACK SN850X 1000GB">620331WD</dependency>
</ffu>
Look at the firmware version of your drive. (We got that up at the top, remember?) Does that number appear in one of the dependency tags? If it does not, your firmware is too old to be updated directly to the latest version. You will have to go through multiple updates. Go back to the list of devices and choose an older firmware version for the first update.
Once you have selected an update that can be performed, look at the fwfile
tag. Paste https://wddashboarddownloads.wdc.com/
on the front as before;
e.g.,
https://wddashboarddownloads.wdc.com/620361WD.fluf
in this example. That is the firmware file. Download it.
Make sure you have nvme-cli installed. On Fedora, if you do not have it
installed, run sudo dnf install nvme-cli
. Then run the following commands,
substituting the name of your firmware file and device for mine:
nvme fw-download -f 620361WD.fluf /dev/nvme0
nvme fw-commit -s 2 -a 3 /dev/nvme0
You’re done! You need to reboot your computer for the new firmware to take effect. Afterwards, run this command:
nvme fw-log /dev/nvme0
to verify that the update is in use. Enjoy!