Data Recovery
From Terastation
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.
Contents |
Why?
Terastation
these links are broken... i'll fix them if i have time today
The Linkstation Community Forum / Terastation (ppc) / RAID5 corruption due to power failure
The Linkstation Community Forum / Terastation (ppc) / Terastation crash after power failure
The Linkstation Community Forum / Terastation (ppc) / Raid 5 '4 red lights' issue
The Linkstation Community Forum / Terastation (ppc) / 4 red leds blink; loss of power
The Linkstation Community Forum / Terastation (ppc) / No access to Terastaation
TerastationPro
The Linkstation Community Forum / Terastation Pro (ppc) / Error E04 Cant Load Kernel
The Linkstation Community Forum / Terastation Pro (ppc) / RAID 5 Array offline!!
The Linkstation Community Forum / Terastation Pro (ppc) / Terastation Pro Error E14
The Terastation/TerastationPro will only show in the webinterface that rebuilding the array is the only option. But there are other options to get the data back.
How To
How to recover your data, depends on the RAID mode you're using.
RAID5
With RAID5 the data is distributed across all disks and one disk stores an XOR checksum of the remaining (n-1) disks. So you can lose 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.
See Moving disks, or The Linkstation Community Forum / Terastation (ppc) / Terastation crash after power failure.
xfs_repair on the Terastation worked for me. See reb's post : Raid 5 '4 red lights' issue
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:
- a PPC powered Mac (Mac Mini, iMac, whatever) with at least one USB connector
- External USB disk boxes for your disks. I assume you need 4 as I did. They don't have to be identical. Anything works. Mine were of 3 different brands, there was no change.
- Possibly an USB hub to be able to connect (at least) 5 devices to your system
- Enough USB disks to be able to store all the data you want to recover from the damaged array
- A recent Ubuntu LiveCD for PPC (for example [1].)
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
root@ubuntu:~# mount /dev/md1 /mnt ro,noatime,norecovery,noalign root@ubuntu:~# tar cjf /media/YOURMEDIA/terastation.tbz2 /mnt/*
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.
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:
jack@jack-laptop:~# sudo -s
root@jack-laptop:~# cd /dev/disk/by-uuid
root@jack-laptop:/dev/disk/by-uuid# ls
4cada7c0-2343-406a-a900-52c9c0f412f1 897c0d45-19e5-4b7c-b909-fce40d9874c1
549641db-72df-4012-a9a0-fbbca24d1d95 a680d13c-e9de-40a8-91d7-cc04ad7162ef
5efa4f68-93e9-4ed6-aac4-aad67266d9c3
root@jack-laptop:/dev/disk/by-uuid# mdadm --detail 897c0d45-19e5-4b7c-b909-fce40d9874c1
897c0d45-19e5-4b7c-b909-fce40d9874c1:
Version : 00.90.03
Creation Time : Sun Oct 31 16:04:26 2004
Raid Level : raid1
Array Size : 385408 (376.44 MiB 394.66 MB)
Device Size : 385408 (376.44 MiB 394.66 MB)
Raid Devices : 4
Total Devices : 4
Preferred Minor : 0
Persistence : Superblock is persistent
Update Time : Wed Dec 13 16:37:19 2006
State : clean
Active Devices : 4
Working Devices : 4
Failed Devices : 0
Spare Devices : 0
UUID : 586fc2de:f33f4915:b21a2ed6:6eacb444
Events : 0.214
Number Major Minor RaidDevice State
0 8 65 0 active sync /dev/sde1
1 8 33 1 active sync /dev/sdc1
2 8 17 2 active sync /dev/sdb1
3 8 49 3 active sync /dev/sdd1
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:
root@jack-laptop:/dev/disk/by-uuid# mdadm -Q 4cada7c0-2343-406a-a900-52c9c0f412f1
4cada7c0-2343-406a-a900-52c9c0f412f1: is not an md array
4cada7c0-2343-406a-a900-52c9c0f412f1: device 0 in 4 device active raid5 /dev/md1. Use mdadm --examine for more detail.
mdadm: 4cada7c0-2343-406a-a900-52c9c0f412f1 does not appear to be an md device
root@jack-laptop:/dev/disk/by-uuid# mdadm --examine 4cada7c0-2343-406a-a900-52c9c0f412f1
4cada7c0-2343-406a-a900-52c9c0f412f1:
Magic : a92b4efc
Version : 00.90.00
UUID : 34d10443:9659647f:e215e986:417e4a7a
Creation Time : Fri Nov 19 04:03:08 2004
Raid Level : raid5
Device Size : 155589440 (148.38 GiB 159.32 GB)
Array Size : 466768320 (445.14 GiB 477.97 GB)
Raid Devices : 4
Total Devices : 4
Preferred Minor : 1
Update Time : Wed Dec 13 16:55:43 2006
State : clean
Active Devices : 4
Working Devices : 4
Failed Devices : 0
Spare Devices : 0
Checksum : 284f8ae8 - correct
Events : 0.84
Layout : left-symmetric
Chunk Size : 64K
Number Major Minor RaidDevice State
this 0 8 3 0 active sync
0 0 8 3 0 active sync
1 1 8 35 1 active sync /dev/sdc3
2 2 8 51 2 active sync /dev/sdd3
3 3 8 19 3 active sync /dev/sdb3
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:
root@jack-laptop:/etc/mdadm# mdadm --assemble --scan --uuid 34d10443:9659647f:e215e986:417e4a7a root@jack-laptop:/dev/disk/by-uuid# mount -t xfs /dev/md1 /mnt root@jack-laptop:/dev/disk/by-uuid# cd /mnt root@jack-laptop:/mnt# ls
--Thirdpig 03:41, 14 December 2006 (CET)
--Edited by WizardFusion
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- [3]
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
General RAID recovery
If you have Windows box only, you may recover data with commercial software UFS Explorer Professional Recovery.
The software supports both XFS file system and RAID configurations used on TeraStation.
To get data back with UFS Explorer you have to eject drives from TeraStation and connect them directly to Windows PC.
You may use:
- native motherboard connectors (if you have enough to connect all the drives); - additional IDE/SATA card (depending of TeraStation model there are used either IDE (PATA) or SATA drives); - USB adapters/racks.
All the drives must be connected. In case of RAID5 configuration you may use 3 drives out of 4, but RAID will work in 'degraded mode', thus - slower.
In case one drive fails you still could recover data in degraded mode.
Be sure you connecting drives in 'natural' order to be sure of drives order later.
Once drives are connected, download and install UFS Explorer trial (direct download).
Run it. It will show all connected drives. TeraStation drives must be shown as tree with 4 partitions under each. The largest partition on each drive is 'data' partition (first is usually used for firmware purposes, second for swap, third is data and fourth is padding).
Click 'Build RAID' button. It will show mode selection dialog. Choose '...on disk partitions...' (second) mode, click 'Ok'. It will show then 'RAID reconstructor' window.
Select your RAID mode (usually - RAID5). Now add data partition of each TeraStation drive to right list ('include into RAID') in right drives order (data partition of first drive on top, from second - below and so on). If you recovering RAID5 in degraded mode (with one missing drive) you have to add 'virtual disk placeholder' ('Add DPH>>' button) onto place were missing drive should appear.
Set stripe size to 64KB. Keep other parameters as is. Click 'Build'.
UFS Explorer will show new virtual 'RAID' drive with one 'unknown' partition (this is because nasted RAID has no partition structures and it is 'raw' XFS partition).
Right-click it and choose 'File systems: fast detect' to find XFS.
Now file system should be readable. If not - check RAID parameters, especially drives order.
Deleted data recovery
In some cases user may delete data by error. There are also situations when TeraStation during maintenance may initialize ('format') file system and thus delete actual user data.
To recover data, rebuild RAID as shown above, detect valid XFS and run 'RAW recovery': UFS Explorer shows good results in deleted files recovery from XFS.
--User:jdee 21:30, 21 Dec 2007 (EET)
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.
By the way, in case you have chance to connect all the drives to Windows PC you could get all the data on-the-fly with UFS Explorer. It does not require partition dumping.
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.
2. What is the block size?
4096bytes
3. Is there any parity rotation?
left-symmetric
Hope this helps someone! --Wastedlife 06:17, 22 January 2007 (CET)


