Recovering a disk from QNAP failure

Posted . ~3min read.

TL;DR: This is what I did to recover a drive (raid array mirrored) from QNAP hardware failure:

apt install mdadm lvm2
lvscan
vgscan
vgchange -ay vg288
lvs
mkdir /mnt/recover
mount /dev/vg288/lv1 /mnt/recover -o ro,user
cp -R /mnt/recover/share_folder /backup

(where vg288 is the volume listed in vgscan that your raid is on)

At that point, my data was locally located on a local disk mounted to /backup.

Backstory on the QNAP Hardware Failure

Back in 2016, after getting sick of the amount of system admin work I needed to do on my local network, I decided to buy a NAS and hopefully offset some chores to a GUI based system.

The QNAP was great for the day to day simple NAS features I needed. I don’t have a ton of data for it to worry about, but what I do have is important to me. I had a simple 2 bay system (TS-251+) with 2 x 4TB drives set up as a RAID mirror.

A couple of years ago, one of the drives failed and repairing the array was simple enough. Plugged in an identical drive, press some GUI clicks, and done.

I really don’t do anything other than simple network storage. The QNAP was basically a replacement for me running samba on a local system… plus, you know, RAID.

The other day, just after 8 years, the fan died. Although the 251+ has multiple NICs and other niceties, there are several single points of failure (single power supply, single fan, etc). So this one fan dying was a critical problem. The QNAP shut down and would not start unless I could fix the fan (which I couldn’t).

The 251+ has a price point that expects these single points of failures.

Of course, the replacement part and fix would (1) take a decent amount of time to get to Gainesville, (2) would not be a fun project over the holidays, and (3) was priced to the point of asking why not just get a new system?

Well… this was money I didn’t want to spend (biggest issue) as well as would take at least 2-3 days to get the replacement.

Now, in theory, if you buy a similar device, you could just put the drives in the new case and boom. Done.

But, what if I needed the data sooner?

Well… that’s what I needed. So, I took one of the drives and attached it to a Debian 12 system here. And, after hours of fighting, can sum up what is needed above.

Basically, you need to have an array recovered from the drive (need mdadm) and then mount the LVM to your system.

Yay.

Now along the way I had tried to restore the single disk from the array via mdadm, with such wonderful commands such as mdadm --assemble /dev/md0 /dev/sdc3 (where md0 would be a temp disk and sdc was my single disk from the array). These all failed dramatically.

What I did see, after installing the mdadm tool was that when running mdadm --detail --scan, the array was automatically being assembed… in my case to /dev/md/1. After then installing lvm2, I could access the volume assembled from the array and mount it.

All deals with the method in which QNAP is using RAID on their systems.

Anyway… hope this saves you a lot of time and reduces stress.

Next...
...and even more...