Western Digital Drive Update Guide Without Windows/WD Dashboard

To streamline the update process I wrote a bash script for Ubuntu / Linux Mint. It combines this and Oleksadrs post:

2 Likes

@not_a_feature it never occurred to me that the fluf file is the direct firmware image that you can send via nvme … :slight_smile:

I’ve made some updates to your script, some drives have more than onve firmware version available and you need to select which one you will upgrade to, I am guessing you can do some lookup with dependencies and look for the currently installed firmware rev and then decide to which version you should upgrade to and if it’s latest, but I only fixed it so I can upgrade my drive if I select the correct one :slight_smile:

updated rev:
https://gist.github.com/Klaas-/ffa1e0759f0b9e6a1fcc94c2fb1aa8d7
feel free to integrate into yours, then I’ll remove my fork.

I also fixed some stuff shellcheck complained about.

Example of a disk with two firmwares available:
WD_BLACK SN850X 1000GB

and maybe some todos for anyone who wants to play around some more:
there are multiple firmware slots, maybe it would be a good idea to check which slot is supposed to be used for a new firmware ( nvme-fw-commit(1) — Arch manual pages )

My disk has two slots for example. Both are read/write so you should check which slot is running current firmware and update the other one.
also you can see if you can apply the firmware online:

$ nvme id-ctrl /dev/nvme0 -H|grep -i Firm
[9:9] : 0x1 Firmware Activation Notices Supported
[4:4] : 0x1 Firmware Activate Without Reset Supported
[3:1] : 0x2 Number of Firmware Slots
[0:0] : 0 Firmware Slot 1 Read/Write
$ nvme fw-log /dev/nvme0
Firmware Log for device:nvme0
afi : 0x2
frs1 : 0x4457313133303236 (620311WD)
frs2 : 0x4457313633303236 (620361WD)

3 Likes

The script worked like a charm to upgrade an SN850X 1TB from 620331WD to 620361WD. Thank you very much!

2 Likes

deleted my fork, changes now incorporated into original script

3 Likes

Thanks to you and @not_a_feature the script worked beautifully.

1 Like

I’ve been watching this thread while getting increasingly irritated by my WD SN770’s propensity to flub a wake-from-s2-idle and cause the kernel to remount all my filesystems read-only.

Yesterday, irritation exceeded trepidation and encouraged by @Klaas successfully hacking on @not_a_feature’s script I decided to take the plunge. In case it matters:

$ uname -r
6.1.0-1027-oem
$ lsb_release -a
No LSB modules are available.
Distributor ID:	Linuxmint
Description:	Linux Mint 21.1
Release:	21.1
Codename:	vera

My first attempt at running the script failed. The output gave me the clue I needed. Mint does not include the nvme-cli package and so the command-line tools were not available.
Suggestion: the script be modified to check this and bale early. Happy to submit a patch (not sure it warrats a pull request).

With nvme-cli installed the script ran and produced some unexpected and faintly troubling output.

Model: WD_BLACK SN770 500GB
Firmware Revision: 731030WD

Firmware File: 731120WD.fluf
Dependencies:
731030WD
731100WD

Downloading firmware from https://wddashboarddownloads.wdc.com/wdDashboard/firmware/WD_BLACK_SN770_500GB/731120WD/731120WD.fluf...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 2732k  100 2732k    0     0  2442k      0  0:00:01  0:00:01 --:--:-- 2443k

Firmware download success
Firmware download complete. Switching to new firmware...
Success committing firmware action:3 slot:2
Multiple Update Detected (MUD) Value: 2202615
Detected an overlapping firmware/boot partition image update command sequence due to processing a command from a Management Endpoint
Detected an overlapping firmware/boot partition image update command sequence due to processing a command from an Admin SQ on a controller
Firmware update process completed. Please reboot.

I steeled myself for a bricked SSD and rebooted. Happily, everything seemed peachy (and continues to be so).

$ cat /sys/class/nvme/nvme0/firmware_rev
731120WD

Perhaps one of you knowledgeable contributors could help NVMe newbies (like me) understand what ‘Multiple Update’ means in this context.

Thanks for making this available. I’ll report back if it didn’t fix my read-only filesystem problem.

Dino

2 Likes

Hi,

that’s a wonderful suggestion.

I’ve add the requirements checks and converted the gist into a proper repository.

3 Likes

Reporting back to say that since I updated its firmware to 731120WD my WD_BLACK SN770 (details above) has not failed on wake from S2idle in 35 days.

I can’t say that the relationship between S2idle events and drive failures was random but there was no discernible pattern to those failures. Most often the drive would fail every other week although there were several failures that were separated by only a day or two. The longest run between failures was 9 weeks but that was an outlier.

My Framework 13 enters S2idle at least once a day; often many times more. I almost never shut it down. The same usage profile has continued since the firmware was updated.

I’m declaring this a success but will return to update you if the problem ever recurs.

Dino

1 Like

:warning: News: Use the interactive tool wd-fw-update.

2 Likes

Thank you for the FW guide, successfully upgraded my SN740 2TB FW by a SN770M one.

So far no issues switching from 73110000 to 731120WD

Hope now my dell would stop freezing after deep sleep

1 Like

4 posts were split to a new topic: WD Green SSD Firmware Download Failed

Hey, Thanks for the guide, I don’t know if this guide is just for nvme devices or can be applied on SATA SSDs as well, but I’ve tried it on my WD SA510 500G device and am getting “Firmware download Failed” error, here are my logs paste-bin It looks like that I have the same error as @Adsubia (community dot frame dot work/t/western-digital-drive-update-guide-without-windows-wd-dashboard/20616/33) with his first SSD if you look at the end of my logs, but I don’t see if he manged to solve the problem or not. I’m pretty sure that I’ve found the correct fluf file here: wdDashboard/firmware/WD_Blue_SA510_2.5_500GB/52046100/device_properties.xml

(Looks like I can’t put more than 2 links in my comment :|)

I’m having a bad time with this WD SSD, it become read-only randomly after a while and it’s brand new, and there is a firmware update clearly addressing this issue wd-website but I cannot update to it (even in a windows installation the WD Dashboard is not recognizing my device)

Anyone have any idea what I can do to apply this firmware updete?

1 Like

Trying to update the SSDs in my FW16 the script finishes without error messages and asks me to reboot, but the actual firmware on the drives remains the same.

ekkehard@FW16:~$ cat /sys/class/nvme/nvme0/model
WD_BLACK SN770 2TB                      
ekkehard@FW16:~$ cat /sys/class/nvme/nvme1/model
WD_BLACK SN770M 2TB                     
ekkehard@FW16:~$ 
ekkehard@FW16:~$ cat /sys/class/nvme/nvme0/firmware_rev
731100WD
ekkehard@FW16:~$ cat /sys/class/nvme/nvme1/firmware_rev
731100WD
ekkehard@FW16:~$ .local/bin/wd_fw_update 
Western Digital SSD Firmware Update Tool

[?] Select the NVME drive you want to update: 
 > /dev/nvme0n1
   /dev/nvme1n1

[sudo] Passwort für ekkehard: 
Current Active Firmware Slot (afi): 1
[?] Select update action, Mode 2 is recommended: 
   0 Downloaded image replaces the image indicated by the Firmware Slot field. This image is not activated.
   1 Downloaded image replaces the image indicated by the Firmware Slot field. This image is activated at the next reset.
 > 2 The image indicated by the Firmware Slot field is activated at the next reset.
   3 The image specified by the Firmware Slot field is requested to be activated immediately without reset.

 85%|█████████████████████████████████████████████████████████████████████████████████████████████████████▌                  | 2.26M/2.67M [00:00<00:00, 7.89MB/s]
========== Summary ==========
NVME location:     /dev/nvme0n1
Model:             WD_BLACK SN770 2TB
Firmware Version:  731100WD --> 731120WD
Installation Slot: 1
Active Slot:       1 --> 1
Activation Mode:   2
Temporary File:    /tmp/wd_fw_updatecx6arvrg.fluf


[?] The summary is correct. Continue (y/N): y

100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 2.67M/2.67M [00:02<00:00, 1.06MB/s]
Update complete. Please reboot.

The current version should be 731120WD as reported by the updater, but it doesn’t stick.

I’m currently on vacation/I’ll take a closer look when I’m back.
Have you tried a different activation mode / a different slot?

You could also run the updater with the “-vv” flag to see more output.

Alternatively you could perform the steps manually with the nvme toolkit and observe the behaviour.

ekkehard@FW16:~$ .local/bin/wd_fw_update 
Western Digital SSD Firmware Update Tool

[?] Select the NVME drive you want to update: 
 > /dev/nvme0n1
   /dev/nvme1n1

[sudo] Passwort für ekkehard: 
Current Active Firmware Slot (afi): 1
[?] Select update action, Mode 2 is recommended: 
   0 Downloaded image replaces the image indicated by the Firmware Slot field. This image is not activated.
 > 1 Downloaded image replaces the image indicated by the Firmware Slot field. This image is activated at the next reset.
   2 The image indicated by the Firmware Slot field is activated at the next reset.
   3 The image specified by the Firmware Slot field is requested to be activated immediately without reset.

 85%|█████████████████████████████████████████████████████████████████████████████████████████████████████▉                  | 2.27M/2.67M [00:00<00:00, 7.76MB/s]
========== Summary ==========
NVME location:     /dev/nvme0n1
Model:             WD_BLACK SN770 2TB
Firmware Version:  731100WD --> 731120WD
Installation Slot: 1
Active Slot:       1 --> 1
Activation Mode:   1
Temporary File:    /tmp/wd_fw_update5yw69za3.fluf


[?] The summary is correct. Continue (y/N): y

100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 2.67M/2.67M [00:02<00:00, 937kB/s]
CompletedProcess(args=['sudo', 'nvme', 'fw-commit', '-s 1', '-a 1', '/dev/nvme0n1'], returncode=22, stdout='Multiple Update Detected (MUD) Value: 46\nDetected an overlapping firmware/boot partition image update command sequence due to processing a command from an Admin SQ on a controller', stderr='NVMe status: FIRMWARE_IMAGE: The firmware image specified for activation is invalid and not loaded by the controller(0x4107)\n')
An error happened during the update process.
Traceback (most recent call last):
  File "/home/ekkehard/.local/bin/wd_fw_update", line 8, in <module>
    sys.exit(run())
  File "/home/ekkehard/.local/lib/python3.10/site-packages/wd_fw_update/main.py", line 555, in run
    main(sys.argv[1:])
  File "/home/ekkehard/.local/lib/python3.10/site-packages/wd_fw_update/main.py", line 545, in main
    wd_fw_update()
  File "/home/ekkehard/.local/lib/python3.10/site-packages/wd_fw_update/main.py", line 526, in wd_fw_update
    raise RuntimeError("Please try again with caution.")
RuntimeError: Please try again with caution.
ekkehard@FW16:~$

This was without a reboot after the third or fourth attempt. Will edit later if this changed anything.
[edit]
nope, after reboot the same error is displayed with option 1.
[/edit]

I am not an expert on NVMe firmware updates, but I did have the same problem of updates not applying because the utility was broken and I had to do it manually. I’m not sure that all necessary fixes have been made upstream, and the maintainer has blocked me from interacting with all of their repositories for an unknown reason, so I can’t provide patches or clarifications.

First, make sure you are using at least version 1.2.2, as the previous versions generated invalid download URLs without error checking and would try to send a 404 page to your SSD. If this is the case, then the invalid firmware message is correct and is saving you from doom. Update the utility (or just do it manually; see below).

The messages about MUD value and overlapping images seem scary but are apparently not errors and can be ignored.

The process of manually performing the firmware update is not so burdensome so you may just want to try doing it yourself, which is what I did after the utility did not work for me. Just to reiterate it:

  1. Go to https://wddashboarddownloads.wdc.com/wdDashboard/config/devices/lista_devices.xml and find your device, in this case WD_BLACK SN770 2TB
  2. Go to the URL listed for the device, in this case https://wddashboarddownloads.wdc.com/wdDashboard/firmware/WD_BLACK_SN770_2TB/731120WD/device_properties.xml, and replace device_properties.xml with the value from the fwfile node, in this case 731120WD.fluf
  3. Download the firmware for the device, in this case https://wddashboarddownloads.wdc.com/wdDashboard/firmware/WD_BLACK_SN770_2TB/731120WD/731120WD.fluf
  4. Run nvme fw-download -f <path-to-731120WD.fluf> /dev/nvme0 as root to push the firmware to the device
  5. Run nvme fw-commit -s 2 -a 3 /dev/nvme0 as root to activate the firmware to slot 2

The enumeration order of nvme devices can change across boots, so make sure to verify that /dev/nvme0 is still the right one.

It may also be a bug that the utility tries to use /dev/nvme0n1 instead of /dev/nvme0 but I don’t know—again, I am no expert on this process, just someone who had the same issue and did it successfully by doing it manually. Good luck!

3 Likes

Sorry for my English, it’s not very good.
Firstly, thank you for this guide. It made me closer to the right solution.
The problem is like here with the WD Green 120Gb.
I faced with this kind of problem when I tried to know what my model is:


I am not able to see it!
But I searched the model name in the internet, found it in the list you attached and download the proper firmware update file. Then I follow the instructions and faced with another problem. When I need to choose the proper drive, I see this:

(blue one is proper).
And then I tried to update, but receive this error message “Firmware Download Failed”.
Then I found out that this drive may be a USB flash drive with the firmware. This means that this toolkit doesn’t see my SSD. But I can see it in the BIOS and in the Disk manager in Windows.
What do you think it can be?
I’d appreciate it🙏

In the windows physical disk listing, notice that the serial number of your SSD is shown (W9ADELW0) and this is also shown in the updater you boot from the USB device. So, the updater does see the SSD.

Why it fails to load the firmware onto the device, I do not know, sorry.

That one is HDD, but thanks

@Edward_Felder Has worked splendidly for me. Thanks!

zim@fedora:~$ cat /sys/class/nvme/nvme0/model
WD_BLACK SN850X 2000GB                  
zim@fedora:~$ cat /sys/class/nvme/nvme0/firmware_rev
620361WD