Terastation Data Recovery

At the forums we face the problem that someone cannot access his Terastation/TerastationPro anymore quite often. Most of the time there is valuable data on it which is really needed to extract again.

This article is all about how you can recover your data. Once you have recovered your data, you almost certainly want to proceed to the next stage of getting your TeraStation back into an operational state. There is a separate article that covers TeraStation Recovery at the hardware level. Often the hardware recovery will also allow you to recover your data without doing the data recovery steps described in this article, but if that level of recovery goes wrong your data is likely to be lost beyond any chance of getting it back. You therefore have to decide how important your data is to you and whether you are prepared to take that risk.

How To

RAID5

With RAID5 the data is distributed accross all disks and one disk stores an XOR checksum of the remaining (n-1) disks. So you can loose 1 disk.

In theory you should be able to connect all disks to a workstation, and repair it there. In practice this does not work, as the byte order of a recular workstation (i386) is different and the MD driver is not endian agnostic. An Apple Mac is required for this.

Data Recovery Method With PPC Apple Mac

This part contained some confusing and outdated information so I rewrote it all having just used the information successfully.

It is possible in some cases to recover a Terastation array in situations where the system flashes all four red lights and shows in the web interface that the array is dead and should be recreated, losing all your files. I've done so successfully.

To recover a Terastation array (assuming RAID5 here) you need the following:

You don't need to erase or change the current operating system on the PPC Mac in any way. After the process it will be exactly as it was, so don't worry.

I'll just assume the reader knows nothing at all about linux, and give the necessary commands. If you know what you're doing you can just figure out what you need from the following.

Download and burn the LiveCD (I hope you know how to do this). Insert it into your PPC Mac, and press down the C key during boot up to have your Mac start up from the CD instead of the hard disk. You should be shown the Grub bootloader window with a nice string of c's on the prompt. Erase them, press enter. The system will start up, and ask for your country and keyboard details. Choose the appropriate values, and watch as the Ubuntu happily recognizes your RAID array and does all the necessary work.

After a while you've got the desktop open. Click on the Applications menu, from there System tools, and Root terminal. Now you've got a beautiful command window in front of you. Now you need to choose whether you want to attempt to back up the files before trying the repair, or just repair the array and hope that's enough.

Backing up the files

If you inserted an USB disk drive in addition to your Terastation array, it will probably be automounted under /media folder under the disk's name. My Lacie 320G USB disk was mounted as LACIE. The commands above assume you want to mount the system in read only mode (does someone want to comment on the parameters? I mounted mine without any but I'm not 100% sure I should've done that. My array is now fine, though.) I also assume the disk you're backing the files up to contains enough space for your Terastation files. I only had 40GB of data there so I was ok.

When done, reboot.

Note: My data partition failed but the OS partition (/mnt/md0) still worked. I had previously enabled telnet access, and was able to get onto the box and used the command

And was able to remount the partition, edited /etc/samba/smb.conf to point to /tmp/foo and then copy the files off the terastation. --Thereza 18:42, 31 May 2010 (UTC)

Repairing the Terastation array

This is the hard part. Open up the Root terminal as mentioned above, and type this:

root@ubuntu:~# xfs_repair /dev/md1

..and wait. That's it. Note: You can't repair a mounted drive, so you need to reboot after the data backup done above, or just skip that part. If you do so, I won't be held accountable for a single lost file.

If you want to see some information about your RAID array use this:

root@ubuntu:~# mdadm -E /dev/md1

Pay attention to the State. It should show clean,no-errors but I assume it's clean,degraded or something if you're reading this.

Below is some detailed information some people may find interesting or useful. I haven't touched them, but I didn't need any of it to solve my problem with the array. One reason for this was probably that a year or two has passed and the newer Ubuntu LiveCD does much of the required work automatically.

Technical information

Here's a quick command reference for linux software RAID newbies like myself - these steps will allow you to locate, repair, assemble and mount the arrays for backup/recovery purposes:

This was good news, the system partition was clean and ready to assemble and mount. But my first concern is my data, because I'm going to blow away the system partition with the help of the how-to [2].
Let's find that RAID 5 data array:

My system crashed (Ubuntu runs a little hot on a Powerbook) and I lost the actual output which showed that the array was rebuilding. It took 7 hours to complete. Once done, all I need to do is assemble the array (using the UUID from the output above) and mount it:

I should note that in the Terastation forums, I read reports of users resurrecting their system partitions and having their data partition appear intact- this was NOT the case when I performed the fresh "blast" of the system partition outline here- After updating the Firmware the TS does not respond

Instead, I found that upon booting up the system, my original RAID 5 partition was deleted and creation of new raid array 1 hand begun automatically in spanning mode. Perhaps this could have been averted if I had copied my original fstab.conf file into the /etc folder on the system partition? Too late now. Sure glad I went through the trouble of rebuilding the RAID 5 array and backing up the data!
--Thirdpig 01:47, 16 December 2006 (CET)

Data Recovery on x86 (Windows) using UFS Explorer

As with some other readers, I did not have access to a PPC box to recover data from my bricked Raid 5 TeraStation. Looking around on the net for some way to read the XFS Raid from a Windows box, I stumbled upon UFS Explorer[3] which can recover data from Linux partitions and RAID setups on a Windows box.

Initially, the software could see the partitions but failed to recognize the file system on the RAID. I have spent a few days working with them and they have come up with a new version which can now read the data from an TeraStation XFS formated Raid 5 setup.

The initial hardware setup simply involves connecting the four drives to an Windows box. Depending on your hardware setup, uou may need to get an additional IDE card to accomplish this. Once the hardware setup is completed, you can download the trial version of UFS Explorer at the link above and follow these steps.

Create a virtual raid (my disk order was 1, 3, 2, 4) but it may need adjusting depending on how you connected the disks

Select Raid 5, Stripe Size 64K and Left-Symetric.

Once the raid partition is created, right-click and select "Fine File System".

If all works, you should then see the folder structure of the drive. The trial version of the software will let you browse all files and copy files which are <= 64K. The registration for an individual (non business) license is near 50 Euro. Depending on your data, it is more than worth the cost!

RAID1

With RAID1 the data is duplicated on each disk, so you can lose all but 1 disk and still have your data available. You rarely use more than two disks, as you lose the capacity of all but one disk. The Terastations system partition is a RAID1 with 4 disks.
Note: the Terastations can only do RAID1 for data on two drives.

As all the data is available on each disk, you can simply move just one disk to a different system and access it bypassing the RAID layer. This works on i386 or PowerPC.

As the RAID will be ignored, or not even detected, you should not modify anything or a rebuild will be requierd.

Warning: if an XFS partition, or for that matter any journaling FS, was not cleanely shutdown, the journal will be replayed even if you mount the disk read only. What, of cause, is a modification.

RAID0

With RAID0 the data is split into stripes and the stripes are distributed over all the disks. If you loose one disk, your data is lost.

Like RAID5 the system you connect your disks to, must be able to detect the RAID to allow you to access your data. So again a PowerPC is required, on the other hand does the TeraStation not support RAID0 anyway.

I doubt the Terastations do RAID0... in the interface the options are RAID5, RAID1, and Spanning.

Span / Linear

When you use span or linear the disks are chaines sequentially. So you could attach one disk at a time to any system, dump the partition and chain them together. You will require some huge ammound of storage but the byte order should not matter.

Standard

When you use standard mode, the terastation will not use any RAID. You can attache one disk at a time to any system and copy the data.

System Partition

If you run out of space on the system partition, which is a mirror set (RAID1), you can access the partition as above.

To mount the partition using the UUID of the partition, but need to use Ubuntu Linux.

To find them type...

cd /dev/disk/by-uuid
ls -l

This will give you a list of UUIDs currently available.
You should be able to see the currently mounted UUIDs from the redirection arrows

To mount the UUID, type the following...

sudo mount -U aaaaa-bbbbb-ccccc-ddddd-eeeee /mnt

This will mount it to the /mnt folder.
From here you can do what you need to.

Some official info from Buffalo on the RAID Configuration

Couldn't think of a better place for this stuff, but here is some information I received from Buffalo Support on the RAID information for the TS-TGL Terastation Pro:

1. What is the starting sector of the raid array?

Device Boot Start End Blocks Id System
/dev/sda1 63 771119 385528+ 83 Linux
/dev/sda2 771120 1044224 136552+ 82 Linux swap
/dev/sda3 1044225 312223276 155589526 83 Linux
/dev/sda4 312223277 312576704 176714 83 Linux
These are DISK1 partition tables.
You can see it by using command 'mfdisk -c /dev/sda'
the /dev/sda1 is for system files (rootfs) which is RAID1.
the /dev/sda3 is data area which is: RAID1,5.
others are not RAID.