Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Well, I am feeling too old for jumping through several burning hoops to upgrade several firmwares via the usual vendor-specific way: Download some DOS tools, waste some time creating a (Free-)DOS boot medium and wasting more time to make the BIOS actually boot from that and finally flash the firmware upgrade.

This is so 1980-ies.

I come across some linux flash tool from the Coreboot project. It seems to support various FLASH-chips. But how does it work in practice?

I guess there are some pitfalls converting vendor supplied firmware upgrades into the right format. Or what about indentifying the right destination chip?

Currently I probably have to upgrade for example:

  • the firmware of some Seagate 1.5 TB disks
  • the firmware of an old Abit Athlon 64 board (Award bios)
  • Bios/Embedded-Controller-Bios of a Thinkpad

How do you upgrade your devices firmware at a Linux system?

share|improve this question

Flashing with FreeDOS, one reboot and no removable devices

  1. Ensure you are using GRUB2 (check if you have the package grub-pc installed on Ubuntu)
  2. Get hold of SYSLINUX's MEMDISK. On Ubuntu, install the package syslinux-common and your memdisk will reside in /usr/lib/syslinux/memdisk
  3. Download fdboot.img, save it in your home directory, or some other directory you can easily type with a US keyboard layout
  4. Embed your flashing software in the FreeDOS image:
    1. sudo -s
    2. mkdir -p /mnt/floppy
    3. mount -o loop -t msdos fdboot.img /mnt/floppy
    4. cp -via FLASH.EXE BIOS.IMG /mnt/floppy/ (FLASH.EXE and BIOS.IMG are examples)
    5. umount /mnt/floppy
  5. Boot your system and interrupt it in the GRUB2 (press ESC)
  6. Press c to enter GRUB2's command line.
  7. Load MEMDISK:
    1. Enter linux16 (hd. Now press tab. A list of harddisks will be shown.
    2. Complete the harddisk choice so that the line says linux16 (hd0,, for example.
    3. Press tab once again to get a list of partitions. You need to find the partition where your /usr/lib/syslinux is mounted on in your Linux installation.
    4. Now you have the harddisk and partition specification, you can complete the path so that it looks like this: linux16 (hd0,msdos3)/usr/lib/syslinux/memdisk. Press enter.
  8. Load FreeDOS:
    1. Use the same tab completion to find fdboot.img, but with the command initrd16 instead of linux16. You'll end up with a line like this: initrd16 (hd0,msdos3)/home/janus/fdboot.img. Press enter.
  9. Write boot and press enter.
  10. The FreeDOS boot menu will appear.
  11. Choose the "safe mode" option, as you don't need the drivers.
  12. In the DOS prompt, write the name of the firmware flashing executable, for example: FLASH.EXE. Press enter.
  13. Wait for the flashing to finish.
  14. The firmware flasher might boot the machine itself, or you might get the prompt back. If you get the prompt back, press Control-Alt-Delete to reboot.
  15. As you didn't change the GRUB configuration permanently, it will boot right back up into your default OS.

If there is not enough space on the image, use the smallest image from chtaube.eu. Uncompress the image and filter it though xxd. Now search for 55aa. It should be at 0x1fe. You can mount the image with offset=$((0x200)) as an additional mount flag. Beware that the $(()) syntax is Bash-specific, but will also work in Zsh.

Alternatively, see https://www.fladi.at/posts/large-freedos-boot-image/

share|improve this answer
You should update your existing answer instead of duplicating it. – maxschlepzig Jul 26 '12 at 18:15
I would suggest putting those lines in grub.cfg to make it a menu entry. Easier to copy & paste them, or at least retype using a real text editor. – derobert Feb 5 '13 at 22:24
@derobert: How do I find the Grub2 device and partition ID reliably? You'd need to know that if baking it into the config. That's why the tab completion is nice. – Janus Troelsen Feb 5 '13 at 23:12
@derobert: Are you sure you are talking about Grub2? That format looks like Grub0.* to me. When is msdos prepended? I'll try to answer your question if you post it. Let me know. – Janus Troelsen Feb 5 '13 at 23:29
@ysangkok that's both grub1 and grub2, msdos is just the partition type... I don't have a question to ask, I thought you did ("How do I find the Grub2 device and partition ID reliably?"). – derobert Feb 5 '13 at 23:37

Every device with upgradeable firmware is probably going to have its own methods for doing that. Motherboards in particular are notoriously incompatible in this regard.

As to hard drives, again, this is a proprietary matter. Seagate provides liveCDs and Windows downloads to perform firmware updates, but not Linux or Unix tools.

You can build bootable images for Thinkpad BIOS updates that can be booted from GRUB.

Otherwise, you're just going to have to check with the manufacturer for tools.

On the other hand, if you're working with microcontrollers, you can often program them with fairly universal tools, though still on a limited basis (e.g., Atmel chips can usually be programmed with avrdude).

share|improve this answer

for Seagate 3TB video (ST3000VX000-9YW1):

sg_write_buffer -v -m 5 -I <FW file> <dev>
share|improve this answer

I have successfully flashed a Seagate Barracuda 7200.12 ST31000528AS (1TB SATA) drive with the following method: (Use at your own risk!)

  1. Download ISO from Seagate: http://www.seagate.com/staticfiles/support/downloads/firmware/Barracuda12-ALL-CC49.iso
  2. mount/extract PH-CC49.ima from .iso file
  3. dd the .ima to a USB thumb-drive: dd if=./PH-CC49.ima of=/dev/sdX bs=512k
  4. Turn off computer and disconnect all drives except drive(s) to be flashed
  5. Boot from USB-thumb drive (this will boot into the Seagate Firmware update utility
  6. Follow simple on screen instructions to flash the drive(s)
  7. Power off, reconnect everything back, and power on

That's it! No Windows, No bulky CD's, no Grub edits, no FreeDos, no flaky Windows .exe's (tried it but it failed with an obscure error message)

Credit goes to the source: http://ubuntuaddicted.blogspot.ca/2014/10/seagate-firmware-flash-using-usb.html (found it by searching PH-CC49.ima)

share|improve this answer
Just want to link your answer to another answer you (looked like the same person?) gave elsewhere: linuxquestions.org/questions/linux-hardware-18/… – Peter Teoh Mar 31 '15 at 6:39
Yes, that was me copy-pasting my answer on both sites. Again, credit goes to the source. – Alecz Apr 1 '15 at 18:16

My small experience is that I used Flashrom to update my Intel Motherboard BIOS and it worked fine. In general it seems like a really nice tool.

share|improve this answer
Could you post an example command line you used for that? – maxschlepzig Sep 15 '10 at 16:50

Using DOS upgrade floppy booted with GRUB as mentioned before works for majority of hardware. In some cases you can find native tools. Dell even prepares repositories which integrates with distro packaging system:


Sadly, most updates requires machine reboot to complete.

share|improve this answer


hdparm --fwdownload (AND BE VERY CAREFUL!)

However, be careful!

share|improve this answer

You can use flashrom to update the BIOS of a motherboard.

Example (Abit KN9 Ultra):

The board is AMD Athlon 64 board, AM2 Socket, Nvidia chipset, released from 2006. It has a 256 KB flash chip that is replaceable. The BIOS is labeled with 'Award', which seems to be trademark of Phoenix.

Flashrom supports that chipset and that flash chip.

The support can be tested with a command like:

# flashrom --programmer internal
Calibrating delay loop... OK.
Found chipset "NVIDIA MCP55".
Enabling flash write... OK.
Enabling full flash access for board "abit KN9 Ultra"... OK.
Found PMC flash chip "Pm49FL004" (512 kB, LPC, FWH) mapped at physical address 0x00000000fff80000.

It makes sense to backup the current contents of the flash chip, first:

# flashrom --programmer internal -c Pm49FL004 -r backup.bin

It then can be compared to a vanilla image file from the vendor (using e.g. xxd and vimdiff).

Some differences are expected - because some BIOS' also store additional information (e.g. DMI) and configuration (e.g. MAC addresses) in the flash. This is also the case with the Abit KN9 Ultra. The DMI data is stored in the first 1872 bytes - and is easily re-generated by the BIOS during boot. The MAC addresses are stored at offset 0x74E30.

The vendor firmware files are packaged in zip archive that contains awdflash.exe and a BIN file, e.g. M520A_23.BIN. In this example, the bin file contains the BIOS image as-is, i.e. it can be directly written do the flash chip with a command like:

# flashrom --programmer internal -c Pm49FL004 -w M520A_23.BIN

Calibrating delay loop... OK.
Found chipset "NVIDIA MCP55".
Enabling flash write... OK.
Enabling full flash access for board "abit KN9 Ultra"... OK.
Found PMC flash chip "Pm49FL004" (512 kB, LPC, FWH) mapped at physical address 0x00000000fff80000.
Reading old flash chip contents... done.
Erasing and writing flash chip... Erase/write done.
Verifying flash... VERIFIED.

Depending on the update, it might be necessary to clear the CMOS for the next reboot - otherwise the BIOS might not start up. On that board the CMOS can be cleared via a jumper setting. Clearing via software is also possible (e.g. via CmosPwd).

For keeping unique default MAC addresses, the new vendor image can be patched before flashing, e.g.:

dd if=backup.bin of=mac.bin bs=1 count=16 skip=$(echo 16 i 74E30 p | dc)
dd if=mac.bin of=M520A_23_with_mac.bin bs=1 seek=$(echo 16 i 74E30 p | dc) \


  • The flash writing may fail due to a motherboard specific board enable (i.e. for disabling write protect) code that is not implemented by flashrom, yet.
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.