Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save peterwillcn/d58cfc8fc0ea280019da18ec172d5149 to your computer and use it in GitHub Desktop.
Save peterwillcn/d58cfc8fc0ea280019da18ec172d5149 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
            ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment