Skip to content

Recover from TeraStation Live Boot Errors

December 22, 2008

If you found this post odds are that your TeraStation is in problems won’t boot, and Buffalo’s Tech Support is telling you to format your disks, and wipe out your data. First things first, hard disks today are very reliable, you have multiple copies of your data in the TS disks do not wipe them out and cause your own misery.

To follow this recovery procedure you’ll need 

  1. Telnet or SSH access to you TeraStation, check this article on how to do it
  2. A Linux PC (Debian, Ubuntu, Red Hat), or Linux Live CD for to boot on you Windows PC
  3. SATA Cables or powered SATA USB Adapter

Well it had to happen I was so happy with my TeraStation that it finally had to die or show some stupid design flaw.

I got a PS3 for my birthday and immediately  wanted to stream all my music from the TS to it. Buffalo sell’s the thing with a build it DLNA Mediaserver so I thought the process would be simple enough… Big mistake.

If your music library has few files you may be able to get along with the TS Live mediaserver but I would seriously discourage its use.

The problem arises that, by default, the TS stores all media server information in its root partition, under /mnt/mediaserver. This, in my opinion, is a design flaw since the root partition is very small and almost full in every TS shipped out of the factory. So even on a factory unmodified unit the size of this partition is less than 500Mb and full to 80%. That gives you very little space to store the media server information. On a modified unit, on which you may have installed additional tools the space on this partition maybe even less. 

Now when the root partition is full all sorts of strange things start happening to your TS and you better get ready because you’re in for a tough ride. 

So going back a bit, I configured the PCast, and had it recreate the media server database, after a full 24 hours the PS3 would see a lot of directories in the TS but no files, music, pictures, nothing. So I thought that the CPU on the TS was slow that it was still indexing all the media, and left it running for another day. 

Day 2 same results, so disappointed I finally disabled PCast and thought that the TS cannot handle a media library this size.

After disabling the PCast server I tried to login to the TS admin interface and after logging in I would be kicked out again, and again. No error message nothing just sent back to the login page.

I rebooted the TS and horror, of horrors, it never came back up again, no network, not found by the NAS Navigator utility, firmware updater nothing!

So if you’re in the same place as I was DO NOT REBOOT YOUR TS. Open a telnet session, of if configured SSH, to the TS and delete all the files in /mnt/mediaserver. You can also delete the TS manuals from /mnt/info and save an additional 23Mb.

  1. ssh root@<ts_ip_address>
  2. rm -fr /mnt/mediaserver/data
  3. rm -fr /mnt/info

You should now be able to login in the administration interface and your TS should be ok.

If you already rebooted the TS, and you are getting E04 system errors, and the TS wont even go into Emergency Mode (EM Mode). Then you need to ignore all procedures you will find online telling you to delete partitions, loose your data, and disk formating…

Your data is there, untouched in the disks so don’t go ahead and delete it, causing your own demise. All you need to do now is to connect each disk into a Linux box and delete the afore mentioned files. All the disks in the TS are SATA, so I used a USB to SATA & IDE Adapter and plugged each disk to my laptop. You can use any SATA adapter as long as it has power supply, a USB port will not have enough juice to power the hard disk.

Now you need to download a Ubuntu Live CD, and boot you PC with it. No files on your computer’s disk will be changed so you can do this on a Windows machine as well.

  1. boot the Live CD
  2. connect each disk (or all disks if you have enough connectors) to your PC or laptop
  3. open a terminal window
  4. sudo bash
  5. mount -t xfs /dev/sda2 /mnt
  6. cd /mnt
  7. rm -fr /mnt/mediaserver/data
  8. rm -fr /mnt/info
  9. umount /dev/sda2
  10. repeat steps 5 to 9 for each disk. If you connected all disks at once you need to use /dev/sda, /dev/sdb, /dev/sdc and /dev/sdd in step 5

Plug all your disks back into the TS and boot it. You should now be able to access the TS as before, with all your data in it.

If not, and your TS says it cannot mount the disks on the display, then you do:

  1. ssh root@<ts_ip_address>
  2. mdadm –examine /dev/sda6
          Magic : a92b4efc
        Version : 00.90.00
           UUID : 402409dd:8c2c66a9:76da68d3:0e959cec
  Creation Time : Tue May 20 22:34:46 2008
     Raid Level : raid5
    Device Size : 487315584 (464.74 GiB 499.01 GB)
     Array Size : 1461946752 (1394.22 GiB 1497.03 GB)
   Raid Devices : 4
  Total Devices : 3
Preferred Minor : 2

    Update Time : Fri Dec 19 08:42:21 2008
          State : clean
 Active Devices : 3
Working Devices : 3
 Failed Devices : 1
  Spare Devices : 0
       Checksum : a9bb53a5 - correct
         Events : 0.2210788

         Layout : left-symmetric
     Chunk Size : 64K

      Number   Major   Minor   RaidDevice State
this     0       8        6        0      active sync   /dev/sda6

   0     0       8        6        0      active sync   /dev/sda6
   1     1       8       22        1      active sync   /dev/sdb6
   2     2       8       38        2      active sync   /dev/sdc6
   3     3       0        0        3      faulty removed

Notice that /dev/sdd6 (in my case) is faulty, you need to see which one if faulty in your situation then you need to:

root@YourHost:/# mdadm  --stop /dev/md2
mdadm: stopped /dev/md2

root@YourHost:/# mdadm -a /dev/md2 /dev/sdd6
mdadm: re-added /dev/sdd6

root@YourHost:/# cat /proc/mdstat
Personalities : [linear] [raid0] [raid1] [raid5] [raid4]
md2 : active raid5 sdd6[3] sda6[0] sdc6[2] sdb6[1]
      1461946752 blocks level 5, 64k chunk, algorithm 2 [4/3] [UUU_]
      [>....................]  recovery =  1.7% (8464512/487315584) finish=495.7min speed=16009K/sec

md1 : active raid1 sdd2[0] sda2[3] sdb2[2] sdc2[1]
      497920 blocks [4/4] [UUUU]

md0 : active raid1 sdd1[0] sda1[3] sdc1[2] sdb1[1]
      297088 blocks [4/4] [UUUU]

unused devices:

Now what you do is wait. After 500 minutes… you should get

root@YourHost:/# cat /proc/mdstat
Personalities : [linear] [raid0] [raid1] [raid5] [raid4]
md2 : active raid5 sdd6[3] sda6[0] sdc6[2] sdb6[1]
      1461946752 blocks level 5, 64k chunk, algorithm 2 [4/4] [UUUU]

md1 : active raid1 sdd2[0] sda2[3] sdb2[2] sdc2[1]
      497920 blocks [4/4] [UUUU]

md0 : active raid1 sdd1[0] sda1[3] sdc1[2] sdb1[1]
      297088 blocks [4/4] [UUUU]

unused devices:


Now the md2 array (array where you data files are) is back up and running. You can now mount it by hand running

root@YourHost:/# mount /dev/md2 /mnt/array1

Before you reboot your TS there’s one more change you need to do. Edit the /etc/melco/diskinfo file and where you see “array1=off” replace off with raid5. Like so

root@YourHost:/# vi /etc/melco/diskinfo


You can now safely reboot your TS and it will be back up and running with all your data intact!
If you forget to do these last step of editing the /etc/melco/diskinfo file your TS will still complain and display disk errors when booting and the web interface will tell you to format the disks.
Again misleading information, that will make you wipe out your data. Buffalo should be more careful and redesign the TeraStation partitions.

It is unacceptable that a 2 TB device stops working and give all sorts of errors for lack of space in a boot partition, and then technical support tells you to format the disks, effectively resolving the lack of space problem but wiping out your data in the process. NICE!


From → TeraStation

  1. David Valentine permalink

    THANK YOU for posting this. I tried everything suggested in the BuffaloTech forums to no avail. For some reason, /dev/sdd6 kept getting corrupted, but the disk seemed fine. One thing that your post showed me was that I needed to change *two* things in my /etc/melco/diskinfo

    array1=off <== wrong
    disk1=normal <== wrong

    Array1 had to change to raid5 as you instructed, but I am wondering if the "disk1=normal" flag caused the firmware to flash to disk1 (which I think actually is sdd6, judging by the order in which mdstat lists them), corrupting it. I've changed it to "disk1=array1", and I'm hopeful that will finally bring my Terastation Live back.

Trackbacks & Pingbacks

  1. Recover from PCast Disaster in my TeraStation Live | DataRecovery

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: