Recovering data from Lacie 2big NAS

Posted under tech On By xpk

My Lacie 2big NAS recently died. For weeks, it had been powering off itself randomly. At first I thought it’s a bug with the latest update and the power saving feature. But yesterday, it hung and after power-cycling, it refused to power on. I even tried a new power supply. I get 1 blink on the ethernet link led. The rest of the unit showed no response. There are some 1TB of files on the RAID1 volume that I must recover. Here is how I managed to to do so.

First, remove one of the drives from 2big and plug it into a Linux machine. It is assumed that lvm2 and mdadm are already installed. If not, you’ll need to install them. Use Sata or usb, doesn’t matter. Once connected, I immediately see all the partitions:

$ lsblk /dev/sdj
sdj 8:144 0 1.8T 0 disk
├─sdj1 8:145 0 1M 0 part
├─sdj2 8:146 0 192M 0 part /media/kn/c3f5af22-a9b8-4bf9-b94c-0cd937a6d2b2
├─sdj3 8:147 0 1M 0 part /media/kn/c9e0ada0-ce94-4f53-8e6f-e6196c58b5b6
├─sdj4 8:148 0 1.5G 0 part
├─sdj5 8:149 0 1.5G 0 part
├─sdj6 8:150 0 1G 0 part
├─sdj7 8:151 0 256M 0 part
└─sdj8 8:152 0 1.8T 0 part

$ blkid | grep sdj
/dev/sdj1: PARTLABEL="grub_core" PARTUUID="a02f5c60-378e-49ab-ba8d-2125498e6f44"
/dev/sdj2: UUID="c3f5af22-a9b8-4bf9-b94c-0cd937a6d2b2" TYPE="ext2" PARTLABEL="boot_rescue" PARTUUID="6a756fdf-be0f-4f09-a09e-7d59c19e88ed"
/dev/sdj3: UUID="c9e0ada0-ce94-4f53-8e6f-e6196c58b5b6" TYPE="ext2" PARTLABEL="nv_data" PARTUUID="2a8dcc4e-bd50-4885-9bcc-980da854bfba"
/dev/sdj4: UUID="977f9145-aa5d-7343-6291-fb3bdf778582" UUID_SUB="b978410f-f3fe-701b-a700-3188fff4300c" LABEL="(none):4" TYPE="linux_raid_member" PARTLABEL="root_1" PARTUUID="21c7c070-67e5-4a7c-b15b-b39d193a1b36"
/dev/sdj5: UUID="421baa27-dbc5-da52-9674-9312281f387f" UUID_SUB="9f94c959-b2b9-fa05-20a2-ac27e2c1e6eb" LABEL="(none):5" TYPE="linux_raid_member" PARTLABEL="root_2" PARTUUID="44f510f9-54e9-4c22-a45c-882fa86f033e"
/dev/sdj6: UUID="5ec9b43b-230d-fafa-0483-43eadbe25117" UUID_SUB="ee43437f-038e-e5a4-956a-b9ca827f896c" LABEL="(none):6" TYPE="linux_raid_member" PARTLABEL="var" PARTUUID="3fb9d923-b5a1-4b2c-91bb-4a9de592d436"
/dev/sdj7: UUID="23222bf9-1985-93f8-2a72-3ffe34138b59" UUID_SUB="9c266ddc-5d5c-a7cc-4b8f-8dc2194270be" LABEL="(none):7" TYPE="linux_raid_member" PARTLABEL="swap" PARTUUID="c81e15bc-64bd-446d-9a5a-2dfe8d6a2b1a"
/dev/sdj8: UUID="ba18b0d7-f81e-8575-e277-8d10390822fb" UUID_SUB="129dd514-b2d4-d465-b7eb-9976e025d213" LABEL="LaCie-2big-NAS:8" TYPE="linux_raid_member" PARTLABEL="slot1.8" PARTUUID="07f9b285-d222-49fc-8d0c-90188e3464bd"

/dev/sdj8 is where the data are stored. It’s LVM on Linux RAID. The Linux RAID devices were automatically recognized by Linux but not in functional state. I had to stop them first:

$ cat /proc/mdstat
Personalities : [linear] [raid1]
md123 : inactive sdj6[2](S)
 1048564 blocks super 1.0

md124 : inactive sdj5[2](S)
 1572852 blocks super 1.0

md125 : inactive sdj8[2](S)
 1948858300 blocks super 1.0

md126 : inactive sdj7[2](S)
 262132 blocks super 1.0

md127 : inactive sdj4[2](S)
 1572852 blocks super 1.0

unused devices: <none>

$ mdadm --stop md123
mdadm: stopped md123
$ mdadm --stop md124
mdadm: stopped md124
$ mdadm --stop md125
mdadm: stopped md125
$ mdadm --stop md126
mdadm: stopped md126
$ mdadm --stop md127
mdadm: stopped md127

Next load the RAID1 kernel module. This step is crucial, without this module, the volume could not be assembled. You’ll get an error saying the device is in use or something. Took me a few tries to realize this.

$ modprobe raid1

We are now ready to assemble the RAID device with just 1 of the drives. Use the assemble command, not create. Otherwise you may risk of wiping all the data. mdadm allows one to assemble the volume in readonly mode, but because my filesystem contains error, I need to assemble it in read-write mode so I can fsck it and then mount the ext4 filesystem. Once assembled, a LVM volume /dev/vg/lv shows up. I fsck it to fix the filesystem errors, and then mounted it under /mnt/lacie.

$ mdadm --assemble --force --run /dev/md127 /dev/sdj8
mdadm: /dev/md127 has been started with 1 drive (out of 2).

$ pvs
 PV VG Fmt Attr PSize PFree
 /dev/md127 vg lvm2 a-- 1.82t 0

$ lvs
 LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert
 lv vg -wi-a----- 1.82t

$ fsck -y /dev/vg/lv
$ mount -oro /dev/vg/lv /mnt/lacie

$ cd /mnt/lacie/shares
$ du -chs ./*
58G ./3
230G ./4
764G ./5
135G ./6
44K ./7
1.2T total

All the shares are available under /mnt/lacie/shares/#/data. Next is just about copying files away which I’ll not bore you with.

The Lacie has served me for about 4 years, fair amount of time. Now I need to find a new NAS box. I’m thinking about Qnap TS-251A or something in that price range. What do you reckon?


 361 total views,  2 views today

Leave a comment

Your email address will not be published. Required fields are marked *