Skip to content

Instantly share code, notes, and snippets.

@klingtnet
Last active September 16, 2023 23:37
Show Gist options
  • Star 40 You must be signed in to star a gist
  • Fork 5 You must be signed in to fork a gist
  • Save klingtnet/22ab0b907e2d9d20f98c72c93ea5dd37 to your computer and use it in GitHub Desktop.
Save klingtnet/22ab0b907e2d9d20f98c72c93ea5dd37 to your computer and use it in GitHub Desktop.
How to upgrade [Lenovo] NVMe SSD firmware on Linux

The instructions were tested on a Lenovo X1 Carbon 5th Gen (X1C5) on Arch Linux but should be applicable to other Lenovo models and Linux distributions.

BACKUP YOUR DATA! I created a bootable Ubuntu Image like this:

$ sudo sh -c 'curl --location --silent --fail "http://releases.ubuntu.com/18.04/ubuntu-18.04.1-desktop-amd64.iso" | pv > /dev/<your-usb-drive>'
# note that pv is only there to show progress, it is perfectly fine to redirect curl to the usb drive directly.

then I booted from this drive by pressing F12 on reboot and dumped my NVMe disk to an external hard drive like this:

$ sudo sh -c 'cat /dev/nvme0n1 | pv --size 477G > /mnt/<external-harddrive>/something.img'

This took about an hour and trust me, if something fails you would be grateful having spend this hour instead of loosing your data.

Now we are ready to start.


  1. Install nvme-cli, they have instructions for all major distros and compiling it from source is also rather easy.
  2. Download the firmware update, in my case it was this one: https://download.lenovo.com/pccbbs/mobiles/fwnv25.zip
  3. Unzip it.
  4. Check you current firmware version:
$ sudo nvme id-ctrl /dev/nvme0 | grep fr
fr        : 1.9.<something>
frmw      : 0x2
  1. Download the extracted update to your nvme drive:
$ sudo nvme fw-download /dev/nvme0 --fw=/path/to/update.img
# in my case the update file was called NVME_End2End_Lenovo_512_dvt_OPAL_Encrypt_and_Signature.bin
  1. Commit the update
$ sudo nvme fw-commit /dev/nvme0 --slot=0 --action=2

if this fails, try action=1, which succeeded on my drive (could take some seconds before the command returns).

  1. Reboot
  2. Check if the firmware upgrade was done:
 sudo nvme id-ctrl /dev/nvme0 | grep fr
fr        : 2.7.8341
frmw      : 0x2

This guide is based on information from the following links:

I got a massive speed-up from this update, previously my boot-time took about 15-20 seconds, now I'm ready in 5s or something:

$ systemd-analyze blame
           559ms dev-mapper-archgroup\x2droot.device
           410ms lvm2-monitor.service
           239ms swapfile.swap
           236ms org.cups.cupsd.service
           227ms ModemManager.service
           226ms tlp.service
           197ms upower.service
           178ms systemd-timesyncd.service
           159ms systemd-logind.service
           129ms systemd-journal-flush.service
           128ms polkit.service
           110ms systemd-modules-load.service
           101ms boot.mount
            95ms systemd-udev-trigger.service
            92ms NetworkManager.service
            89ms thermald.service
            60ms systemd-tmpfiles-clean.service
            56ms systemd-udevd.service
            53ms systemd-journald.service
            51ms lvm2-pvscan@254:0.service
            48ms avahi-daemon.service
            43ms udisks2.service
            42ms systemd-fsck@dev-disk-by\x2duuid-4902a621\x2d2995\x2d4df1\x2da2aa\x2d64c85223c6a5.service
            41ms systemd-fsck@dev-disk-by\x2duuid-B364\x2d37C8.service
            41ms rfkill-unblock@all.service
            41ms alsa-restore.service
            41ms systemd-tmpfiles-setup.service
            40ms systemd-binfmt.service
            40ms unmount-webdrives-on-shutdown.service
            40ms dev-hugepages.mount
            38ms user@1001.service
            37ms systemd-random-seed.service
            32ms systemd-tmpfiles-setup-dev.service
            25ms bluetooth.service
            25ms wpa_supplicant.service
            21ms colord.service
            20ms ntpd.service
            18ms systemd-backlight@leds:tpacpi::kbd_backlight.service
            ...
@funnylookinhat
Copy link

Thanks for sharing this! Do you know if there's a way to determine if your disk is the correct type for this firmware update?

@klingtnet
Copy link
Author

@funnylookinhat In my case I just looked up what model of SSD was installed by running sudo nvme id-ctrl /dev/nvme0 and then looked into the firmware-update README to confirm that the model was mentioned.

@oskar456
Copy link

oskar456 commented Feb 6, 2019

Thank you! I just updated the NVME in my Dell XPS 13 9370 from problematic version AADA4102 to AADA4106 using the firmware image extracted from update package for Windows from Dell:

  1. $ 7z x Toshiba\ KXG50ZNV256G_KXG50ZNV512G_KXG50ZNV1T02\ MFW44_ZPE.exe
  2. $ 7z x XG5-AADA4106-64bit.exe
  3. $ sudo nvme fw-download /dev/nvme0 --fw=AADA4106.sig
  4. $ sudo nvme fw-commit /dev/nvme0 --slot=0 --action=1
  5. reboot system

@matsp
Copy link

matsp commented May 6, 2019

@oskar456 Worked for me as well, thanks!

@Manouchehri
Copy link

Does flashing a OPAL enabled firmware on a non-OPAL drive work? If so, does it actually allow using OPAL? (Wondering if it's just a software limitation and not hardware.)

@andrejpodzimek
Copy link

@oskar456 Thanks for the howto! I've just updated my NVME SSD successfully. The file naming has changed (slightly) in this AADA4107 version, but it's still the same process with two extractions.

@stefan-jevtic
Copy link

@klingtnet I followed your guide but didn't worked for me. I have Lenovo Thinkpad T480 running Manjaro xfce on Intel SSD Pro 7600p. I found this firmware update https://pcsupport.lenovo.com/gb/en/products/laptops-and-netbooks/thinkpad-t-series-laptops/thinkpad-t480-type-20l5-20l6/downloads/driver-list/component?name=Storage but it says that's for Windows 10(64 bit). I checked README file and my SSD is listed there. Anyway, i followed your guide: created bootable usb with linux mint, backed up my data, booted mint, downloaded zip file with firmware update, ran all commands listed above, shuted down mint and booted manjaro, checked the firmware version and it remains the same. My current firmware version is L08P but on Intel's website the latest firmware version is 004P. What i did wrong? Can you help me to update firmware. I'm desperate to get full performance from my SSD.

@klingtnet
Copy link
Author

Please excuse my late reply. Unfortunately I can not say what is going wrong here. Did you try another --action value for fw-commit command, e.g. --action=1?

@stefan-jevtic
Copy link

@klingtnet Yes, i tried that but i got an error, with --action=2 i got success message but the firmware version remains the same.

@localxoct
Copy link

Awesome mate. Worked like a charm on my ThinkCentre M710q with Samsung MZVLW256HEHP-000L7. Now on 5L7QCXB7. Thank you!

@openmindead
Copy link

openmindead commented Nov 5, 2021

Just a link to the updated archive with more supported SSDs' firmwares.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment