not-a-feature / wd_fw_update

Updates the firmware of Western Digital SSDs on Ubuntu / Linux Mint.
https://wd-fw-update.readthedocs.io
GNU General Public License v3.0
22 stars 3 forks source link

Proxmox: Script appears to complete successfully but update not applied #11

Closed peelos closed 3 weeks ago

peelos commented 1 month ago

not sure how best to report this here.

Running proxmox on RAID 1 and the script in a virtual environmnet

appears to work but upon reboot the old firmware is still present:


`(my_env) root@proxos:~# nvme list
Node                  Generic               SN                   Model                                    Namespace Usage                      Format           FW Rev  
--------------------- --------------------- -------------------- ---------------------------------------- --------- -------------------------- ---------------- --------
/dev/nvme1n1          /dev/ng1n1            23325G801723         WD_BLACK SN850X 2000GB                   1           2.00  TB /   2.00  TB    512   B +  0 B   620331WD
/dev/nvme0n1          /dev/ng0n1            24171U801415         WD_BLACK SN850X 2000GB                   1           2.00  TB /   2.00  TB    512   B +  0 B   620361WD
`
script

`(my_env) root@proxos:~# ./my_env/bin/wd_fw_update -vv
[[2024-10-31 10:47:39]] DEBUG:wd_fw_update.main:Namespace(info=False, loglevel=10)
[[2024-10-31 10:47:39]] INFO:wd_fw_update.main:Starting firmware update process.
Western Digital SSD Firmware Update Tool

[[2024-10-31 10:47:39]] DEBUG:wd_fw_update.main:Getting device list.
[[2024-10-31 10:47:39]] DEBUG:wd_fw_update.main:Device list: ['/dev/nvme1n1', '/dev/nvme0n1']

[[2024-10-31 10:47:39]] DEBUG:wd_fw_update.main:Asking for device: ['/dev/nvme1n1', '/dev/nvme0n1']

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

[[2024-10-31 10:47:43]] INFO:wd_fw_update.main:Getting device properties of /dev/nvme1n1
[[2024-10-31 10:47:43]] INFO:wd_fw_update.main:Current Active Firmware Slot: 1
[[2024-10-31 10:47:43]] DEBUG:wd_fw_update.main:Slots with Firmware: {1: '4924458813524816438 (620331WD)'}
[[2024-10-31 10:47:43]] DEBUG:wd_fw_update.main:Getting firmware url.
[[2024-10-31 10:47:43]] DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): wddashboarddownloads.wdc.com:443
[[2024-10-31 10:47:43]] DEBUG:urllib3.connectionpool:https://wddashboarddownloads.wdc.com:443 "GET /wdDashboard/config/devices/lista_devices.xml HTTP/11" 200 46158
[[2024-10-31 10:47:43]] DEBUG:wd_fw_update.main:Firmware versions: ['620241WD', '620361WD']
[?] Select the Firmware Version for WD_BLACK SN850X 2000GB: 
   620241WD
 > 620361WD

[[2024-10-31 10:47:55]] DEBUG:wd_fw_update.main:Firmware properties url: https://wddashboarddownloads.wdc.com/wdDashboard/firmware/WD_BLACK_SN850X_2000GB/620361WD/device_properties.xml
[[2024-10-31 10:47:55]] DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): wddashboarddownloads.wdc.com:443
[[2024-10-31 10:47:55]] DEBUG:urllib3.connectionpool:https://wddashboarddownloads.wdc.com:443 "GET /wdDashboard/firmware/WD_BLACK_SN850X_2000GB/620361WD/device_properties.xml HTTP/11" 200 474
[[2024-10-31 10:47:55]] DEBUG:wd_fw_update.main:Firmware dependencies: ['620241WD', '620281WD', '620311WD', '620331WD']
[[2024-10-31 10:47:55]] DEBUG:wd_fw_update.main:Firmware file url: https://wddashboarddownloads.wdc.com/wdDashboard/firmware/WD_BLACK_SN850X_2000GB/620361WD/620361WD.fluf

[[2024-10-31 10:47:55]] DEBUG:wd_fw_update.main:Firmware slots: [1, 2]
Select the slot to which the firmware should be installed.
[?] Slot ID: Current Firmware Version: 
 > 1: 4924458813524816438 (620331WD)
   2: No firmware.

[?] 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.

[[2024-10-31 10:48:10]] INFO:wd_fw_update.main:Downloading firmware.
[[2024-10-31 10:48:10]] DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): wddashboarddownloads.wdc.com:443
[[2024-10-31 10:48:10]] DEBUG:urllib3.connectionpool:https://wddashboarddownloads.wdc.com:443 "GET /wdDashboard/firmware/WD_BLACK_SN850X_2000GB/620361WD/620361WD.fluf HTTP/11" 200 3129344
  0%|                                                                                                                                                                     | 0.00/2.98M [00:00<?, ?B/s][[2024-10-31 10:48:10]] INFO:wd_fw_update.main:HTTP Status Code: 200

========== Summary ==========
NVME location:     /dev/nvme1n1
Model:             WD_BLACK SN850X 2000GB
Firmware Version:  620331WD --> 620361WD
Installation Slot: 1
Active Slot:       1 --> 1
Activation Mode:   2
Temporary File:    /tmp/wd_fw_updatefep8h854.fluf

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

[[2024-10-31 10:48:13]] INFO:wd_fw_update.main:Loading the firmware file.
[[2024-10-31 10:48:13]] DEBUG:wd_fw_update.main:NVME Download returncode: 1
[[2024-10-31 10:48:13]] INFO:wd_fw_update.main:Commiting / Switching to the firmware file.
[[2024-10-31 10:48:13]] DEBUG:wd_fw_update.main:NVME Commit returncode: 0
100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 2.98M/2.98M [00:03<00:00, 1.02MB/s]
Update complete. Please reboot.
[[2024-10-31 10:48:13]] INFO:wd_fw_update.main:Firmware update process completed.
[[2024-10-31 10:48:13]] INFO:wd_fw_update.main:[END of script]
peelos commented 1 month ago

I managed to upgrade manually - I think the issue is the NVME location: /dev/nvme1n1 rather than nvme1

followed this guide to update manually: https://community.wd.com/t/firmware-upgrade-utility-for-linux/210120/11?u=taurus-forever

not-a-feature commented 1 month ago

You selected "The image indicated by the Firmware Slot field is activated at the next reset." Did you reboot / reset the controller?

peelos commented 1 month ago

You selected "The image indicated by the Firmware Slot field is activated at the next reset." Did you reboot / reset the controller?

also tried option 1 and rebooted with the same effect

not-a-feature commented 1 month ago

Intresting..probably Proxmox is doing some strange NVME virtualisation. Could you please do "wd_fw_update --info" and paste the output?

peelos commented 1 month ago
`========== Device Info ==========
Device                   : /dev/nvme1n1
Model                    : WD_BLACK SN850X 2000GB
Current fw version       : 620361WD
Slot 1 readonly          : False
Slot count               : 2
Current slot             : 2
Slots with firmware      : {1: '4924458813524816438 (620331WD)', 2: '4924458826409718326 (620361WD)'}
Selected slot            : -1
Activation without reset : True
Relative fw urls         : []
Selected version         : 
Firmware url             : 
Activation mode          : -1
Tmp fw file name         : 

========== Device Info ==========
Device                   : /dev/nvme0n1
Model                    : WD_BLACK SN850X 2000GB
Current fw version       : 620361WD
Slot 1 readonly          : False
Slot count               : 2
Current slot             : 1
Slots with firmware      : {1: '4924458826409718326 (620361WD)'}
Selected slot            : -1
Activation without reset : True
Relative fw urls         : []
Selected version         : 
Firmware url             : 
Activation mode          : -1
Tmp fw file name         : 
`
not-a-feature commented 3 weeks ago

NVME drives are usually split into:

After digging into this i suspect that Proxmox does create some kind of non persistent link from /dev/nvme0n1 to the actual block device that the controller uses for firmware updates. This can lead to the illusion that the firmware update is applied when targeting /dev/nvme0n1, but it's likely being redirected to the controller behind the scenes. However, this redirection might not be persistent across reboots, explaining why the update doesn't stick.

I'll check if it is safe to always write to /dev/nvme0 instead of the namespace that is reported from nvme list.

not-a-feature commented 3 weeks ago

Should work now. The nvme cli should now handle everything

peelos commented 3 weeks ago

Many thanks..