Author Topic: Kane88's TFTP boot process 2020. (Work In Progress 4/18/2020)  (Read 4384 times)

Kane88

  • Buffalo
  • ***
  • Posts: 161
Kane88's TFTP boot process 2020.  (Work In Progress 4/18/2020)

This is what I have so far- for the Buffalo NAS wiki.  Use this at your own risk.

I will update this more when I have more time.


Introduction:
-------------

This TFTP boot guide is for Windows users.  This process might work in wine, but it is not tested nor is supported in wine.  I don't use linux as a daily driver OS.

The process is in qnd (quick and dirty) working order as a rough draft.  It will need some tweaking or adjustments- specific to your Buffalo NAS model.

It works (at least in theory) with pretty much all Linkstation and Terastation devices that do NOT boot directly into EM Emergency Mode.

It certainly does work with the very common Linkstation 210, 220, 410, and 420 units.  It has been tested working with the 220 and 420 series.

This is a shotgun- drop back and punt approach to reload the firmware on a set of newly wiped drives.

The firmware update itself is relatively easy, once the basic device configuration is done.

Warning: THIS PROCESS WILL ERASE ANY AND ALL DATA ON THE NAS DISKS!  YOU WILL LOSE DATA!  BACKUP YOUR DATA BEFORE TRYING THIS.  If in doubt, use a spare set of empty disks.



What you need:
--------------

*A basic home wifi router that has DHCP capabilities and should have some network ports too.

*Two wired network Windows OS PCs.  They can be desktops or laptops, but they must be wired.  The PCs should be conneted to network ports directly on your router.  If they're not connected to the router, then use ports that are on the same network switch.  Anything that runs Windows XP or higher should be fine.  Do not use wireless for this process.  Wireless is not supported, nor is it a good idea to ever update any firmware for any network device over a wireless connection.

*One Buffalo Linkstation OR Terastation NAS in need of a firmware flash or reload, such as an LS220D or TS-XEL, that does not boot into EM emergency mode with NAND flash.

Your Buffalo NAS should be connected directly to your router or network switch, along with the PCs.
Do NOT connect the NAS directly to any PC, as other TFTP guides of the past may have suggested.

Your drives must be completely blank or erased.  No partitions can be on the drives.
To erase your drives, use a utility that you are comfortable with.  There are many free such as: Western Digital windlg (this will erase pretty much any disk, I reccomend this for its quick erase function), a utility from your drive manufacturer- such as Seagate or Hitachi, AOMEI Partition Assistant, MiniTool Partition Wizard, windows diskpart, etc.  You can do an internet search on windows diskpart clean, or for other guides on how to use these and other drive erase utilities, if you are not familiar with them.

*Current firmware for your NAS model, downloaded from http://www.buffalotech.com  and enable debug mode.  Enabling debug mode is accomplished by updating your LSupdater.ini or TSupdater.ini with the following:

[Flags]
VersionCheck = 0
NoFormatting = 0

[SpecialFlags]
Debug = 1


*TFTP server application and TFTP boot files



TFTP application setup:
-----------------------

*TFTP application downloaded from (not done yet- a site TBA). (Link below works, it is from the current TFTP wiki article, which linked to a reddit page)
https://drive.google.com/drive/folders/1svyb9LFUq7VBdD9KFJ66TZ5qMgI_X59p

Right click and Download TFTP Boot Recovery TS-XL 1.00.exe, and extract it.  You should have a TFTP Boot Recovery folder with the needed TFTP application, along with NAS Navigator.  There is also an initrd.buffalo and uImage.buffalo that can be removed, as these two files will only work for the TS-XL model.  These files will be replaced by ones- specific to your unit.


Next, boot files for your specific LS or TS NAS model need to be extracted.  There are two ways this can be done:

Use the current buffalo wiki article to extract the boot files.  This method requires the use of passwords.  They must be copied into the TFTP Boot Recovery folder directory.
https://buffalonas.miraheze.org/wiki/Extract_Boot_Files_from_Stock_Firmware

These have to be copied into the TFTP Boot Recovery directory folder from above- initrd.buffalo and uImage.buffalo.
Some devices may have more than one boot file- such as the TS-XEL


PC configuration:
-----------------

PC1: We'll call this your workstation or- main pc.  This should be the pc you're using to view this guide.  This will be the PC you will run the Buffalo Firmware Updater software on.

PC2: We'll call this your TFTP server pc.  This is a secondary PC you have at your home or your office.  In my case, mine is a HTPC.  You will run the TFTP server on this PC.


Configuration:
*Windows firewall must be disabled during the entire process.  Generally, you can run windows firewall on the PC that runs the firmware updater.  But it must be completely turned off on the TFTP server PC.

*Be sure to save and close any open files or documents, and disconnect any open network shares.  Also close any open applications before beginning.

PC1:  This PC will use DHCP.  If for some reason this PC has a static IP address: that is ok too- provided it will be on the same subnet with the NAS that will be repaired.  The NAS will be DHCP.

PC2:  This PC must have its windows firewall turned off.  This PC will use a static IP address for this process.  For Windows 7 and up: go to network and sharing center, then go to the properties of your ethernet adapter.  You will need to assign a Static IP  192.168.11.1 - subnet mask 255.255.0.0 - and the gateway can be left blank.

Verify the two PCs and your NAS are connected to your router, and are on the same switch.  No PCs should be directly connected to the NAS itself.  Make sure the power is OFF on the NAS.


TFTP update process for TS and LS units:
----------------------------------------

Please start the devices in this order.  The NAS will not update if the TFTP server is not running first.

Your NAS should be powered off.  PC1 and PC2 should be powered on, and logged into windows with any and all NAS drive mappings- disconnected and removed from use.

Start the TFTP server application on PC2 by running TFTP Boot.exe.

you should see something like this on the app window:

Preparing to write TFTP configuration settings.
TFTP Configuration settings have been written.
TFTP Server Multithreaded Version 1.4 Windows Built 1.400


Starting TFTP...
alias / is mapped to D:\TFTP Boot Recovery\
listening On: 127.0.0.1:69
listening On: 192.168.11.1:69
permitted clients: all
server port range: all
max blksize: 65464
defult blksize: 512
default interval: 3
overwrite existing files: No
thread pool size: 1

accepting requests..



Leave the TFTP server running, until after the firmware update completes successfully.  Some Buffalo units will boot twice from the TFTP server, because the boot blocks are not loaded on the first pass of the firmware update.

When the NAS boots, the TFTP console will show the boot blocks being passed to the device.  If you do NOT see this, something is wrong.  Your windows firewall might not be off on PC2, or your NAS may be having trouble connecting to the TFTP server.


An LS-VL firmware model unit was used first for this test.  It has also been tested working with LS220, LS420, and TS-XEL series units.
First, get TFTP server app running on PC2 (listed above)

Turn on NAS, wait, red error lights blink 6x indicating no firmware present.
Press and hold the function button for 30 secs, Power blinks blue- it will TFTP boot on the 192.168.11.x network,

release function button, verify 2 sets of blocks are sent from tftp on PC2
NAS unit grabs a dhcp ip address from the router, after it fully boots

after a few mins, power light will go solid blue for LS-VL when done (white for LS220/420)

use nasnavi or your router web console app on PC1, find NAS- it will have a DHCP address at this point.

Run firmware update on PC 1.
right click top line of the firmware update app, enable debug mode check all boxes on right side.
ALL BOXES in the top of the debug screen should be checked, don't worry about the IP info.  I left it alone...

Unit will reboot, LS-VL will TFTP boot again, as boot blocks are not loaded on first pass.

Wait for firmware update process to finish.  One more reboot and eventually- it should finish successfully.

You should be able to login to the unit using the IP address listed in NAS navigator.

LS-VL defaults to japanese, there's a workound here for that.  use the placement of the words from the pic here:
http://dumbpcs.blogspot.com/2012/08/japanese-to-english-language-selection.html

Its the 4th line item on the top line.  switch to English... save, you have to login again afterward...

Then configure your NAS as you normally would.

Done.  Shut down TFTP server on PC2, and switch IP back to what it was beforehand.


----------------------------------

I will refine and update this when I have more time.

Feel free to test and use this at your own risk, and ask any questions or share your feedback.  The method does work, it needs a little tweaking to specific models.

I have tested this method a few times so far, and with the different devices that were listed, and it does work. 

The biggest challenge we face, is getting the specific initrd.buffalo and uImage.buffalo boot files, in to the TFTP application folder directory itself.  This is why in the past, someone did have a TFTP boot share with many different setups.  I still have the files that person hosted, but we need a place to where they can be available- online.


Warning:  back up your data before trying this.  Or use a spare set of disks.
« Last Edit: April 18, 2020, 10:22:50 PM by Kane88 »