Skip to content

Instantly share code, notes, and snippets.

@jdoss
Last active July 6, 2023 17:15
Show Gist options
  • Save jdoss/7f32ed1a4d16b60a0dcbbfbd4ed46210 to your computer and use it in GitHub Desktop.
Save jdoss/7f32ed1a4d16b60a0dcbbfbd4ed46210 to your computer and use it in GitHub Desktop.
Samsung SSD 980 PRO Firmware 3B2QGXA7 to 5B2QGXA7 Upgrade on Linux
#!/bin/bash
# MIT License
#
# USE AT YOUR OWN RISK! FIRMWARE UPGRADES HAVE RISKS!
#
# Copyright (c) 2023 Joe Doss
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
# Find your firmware URL here https://semiconductor.samsung.com/consumer-storage/support/tools/
# Uncomment the line below and replace it with your drive URL from the link above!
# FIRMWARE_URL=https://semiconductor.samsung.com/resources/software-resources/Samsung_SSD_980_PRO_5B2QGXA7.iso
if [[ ! ${FIRMWARE_URL} ]]; then
echo "Uncomment FIRMWARE_URL and replace it with the URL for your SSD drive from the link above!"
exit 1
fi
if [ -f /etc/redhat-release ] ; then
sudo dnf install -y install gzip unzip cpio
elif [ -f /etc/SuSE-release ] ; then
sudo zypper install -y install gzip unzip cpio
elif [ -f /etc/debian_version ] ; then
sudo apt-get -y install gzip unzip cpio
else
echo "Unknown Linux distro! Please make sure gzip, unzip, and cpio are installed!!"
fi
mkdir -p /tmp/samsung_ssd_fw_upgrade/{iso,rootfs}
cd /tmp/samsung_ssd_fw_upgrade
curl ${FIRMWARE_URL} -o firmware.iso
sudo mount /tmp/samsung_ssd_fw_upgrade/firmware.iso /tmp/samsung_ssd_fw_upgrade/iso
cd /tmp/samsung_ssd_fw_upgrade/rootfs
gzip -dc /tmp/samsung_ssd_fw_upgrade/iso/initrd | cpio -idv --no-absolute-filenames
sudo umount /tmp/samsung_ssd_fw_upgrade/iso
cd /tmp/samsung_ssd_fw_upgrade/rootfs/root/fumagician
sudo ./fumagician
rm -rf /tmp/samsung_ssd_fw_upgrade/
echo "Reboot to activate the new firmware version!"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment