Thursday, December 4, 2014

Updating Seagate Hard Drive Firmware from Fedora 20

Recently I've grown tired of seeing constant warnings in my S.M.A.R.T. diagnostic information about outdated firmware on my pair of Seagate Barracuda drives (of the 7200.12 iteration, which according to the internet, should have lost my data and caught fire about five times over now). I've updated firmware on multiple SSDs, but never a traditional spinning rust drive. The process is a little klunky, but feel free to play along!



I am not responsible if this wipes your drives, you should probably have backups first, I am also not responsible for the data that will be lost on the thumbdrive you format to make a bootable firmware updating stick!

First, you need the model number of your drive. Seagate recommends using their 'Drive Detect' software, which, of course, is a Windows application. You could try running it in Wine I suppose, but its just as easy to grab the information using smartctl.

As root (adjust device path as needed):

# smartctl -a /dev/sd*


Which will spit out all manner of information about the drive (including the warning that's been annoying me). The critical line in this case is:

Device Model:     ST3500418AS

Also of note is the firmware version:

Firmware Version: CC37


According to the Seagate page for Barracuda drives, the latest firmware for my drive is CC49. So, at least smartctl hasn't been lying about there being an update.

Seagate provides two firmware updater options, yet another Windows executable, and a bootable ISO. Download the ISO option. If you kick it old school, you can burn ISO to a CD and boot it (or if you're really oldschool, you can extract the ISO, and start noodling with what is all included with the included FreeDOS distribution and see if you can cut it down to fit on a floppy). I'm not a big fan of wasting media on something like this (plus I can only find my spool of DVD-R discs...), so let's make that ISO into a bootable USB stick.

The Seagate ISO is a little unusual in that it chainloads some "Bootable CD Wizard" (BCDW) nonsense instead of a more typical boot arrangement. This rules out simply using dd to image the thumbdrive, UNetbootin isn't an option either. What does work is chainloading the image that is chainloaded by BCDW using syslinux. Get the 256M FreeDOS image from here. Extract the image, and write it to your thumbdrive (CAUTION: ALL DATA ON THE THUMBDRIVE WILL BE LOST):

# dd if=FreeDOS-1.1-memstick-2-256MB.img of=/dev/sd* bs=1M
# sync

Where 'sd*' is your thumbdrive. Note that the blocksize is set to 1M (not 512k as commonly suggested), I experienced boot errors otherwise.

Now, extract (or mount) the "Barracuda12-ALL-CC49.iso" file you downloaded from Seagate, and copy the "PH-CC49.ima" to the root of your new FREEDOS stick. Set syslinux to chainload into the image file by editing 'syslinux.cfg' on the thumbdrive to look like the one below:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
default fdos
prompt 1
timeout 200
say -
say Welcome to FreeDOS 1.1 bootable USB flash drive!
say Created by Christian Taube - http://chtaube.de/FreeDOS/BootFromUSB
say -
say Press ENTER to boot FreeDOS, or choose from these alternatives:
say ---------------------------------------------------------------
say :    fdos :: FreeDOS 1.1
say :seaflash :: Seagate firmware update utility
say :    odin :: Boot ODIN 0.6 floppy disk image (tiny FreeDOS)
say : memtest :: Run Memtest86+ 4.20
say ---------------------------------------------------------------
say Example: To boot Memtest86+, type "memtest" and hit Enter.

label fdos
    menu label fdos - Load FreeDOS 1.1 from USB flash drive
    com32 /fdos/bin/chain.c32
    append freedos=/fdos/bin/kernel.sys

label seaflash
    menu label seaflash - Load SeaFlash firmware update utility
    linux /img/memdisk
    initrd /PH-CC49.ima

label odin
    menu label odin - Load ODIN 0.60 floppy disk image
    linux /img/memdisk
    initrd /img/fdodin06.144

label memtest
    menu label memtest - Load Memtest86+ 4.20
    linux /img/memtest.bin

Maybe sync again make sure everything is written to the thumbdrive, and reboot into UEFI / BIOS. Set your drive controller to IDE instead of AHCI mode. The tool won't work otherwise. If you are using a UEFI system, make sure it is configured to allow booting from legacy (MBR) devices. Save those settings, and reboot, doing whatever it takes to boot from the USB drive.

Once the syslinux bootloader has loaded, type 'seaflash' and hit <Enter> to boot into the SeaFlash firmware updater. Follow the instructions on screen. I highly recommend selecting the option to list compatible devices to make sure it sees your drives. Also take note, once you select the option to update, it will update all compatible drives.

Once its done, power off, then boot into UEFI / BIOS and set the drive controller back to AHCI mode (assuming it was set to AHCI before). You can also disable legacy boot again if you feel so inclined. You should be done!

No comments:

Post a Comment