Mount QNAP Drives to Linux

Questions about SNMP, Power, System, Logs, disk, & RAID.
Undesirable
Starting out
Posts: 14
Joined: Sat Jan 14, 2017 12:37 pm

Re: Mount QNAP Drives to Linux

Post by Undesirable » Mon May 11, 2020 9:49 am

tgsbn wrote:
Sun May 10, 2020 7:13 pm
fredrogers wrote:
Tue Dec 10, 2019 2:51 pm
philippelt wrote:
Tue Jan 22, 2019 3:14 am

Raid5 for home users in my opinion is just the shortest path to data disaster.
Great insight! I wish these NAS vendors would warn people that data recovery is probably going to be impossible, before they configure their units using advanced RAID setups.
I don't agree.
You should never count on data recovery from the salvaged disks of a defect NAS, no matter which RAID level.
The only reliable way of recovering from a NAS defect is to restore your last backup.
Data recovery from a failed RAID or from failed disks in general is always only a risky attempt to reduce the size of desaster should your backups turn out to be unusable or (shame on you) non-existent.

So the warning NAS vendors should really give is:
  • Do regular backups!
  • RAID is not a backup.
  • RAID only protects against disk failures.
  • RAID does not protect against other hardware failures.
  • RAID does not protect against operating errors.
  • RAID does not protect against malicious acts.
  • Do regular backups!
That's not to say we shouldn't try to help fellow QNAP users who for whatever reason face the need to attempt a data recovery.
But when it comes to general warnings and recommendations, a good backup strategy that avoids the need for data recovery in the first place is much more important than adapting your RAID configuration to make data recovery easier.
I agree with your summarisation of RAID, but I also think QNAP should offer a way to restore / reintegrate the RAID data automatically if the NAS itself fails and you need to reinitialise the disks.

I found myself in a position where the disks in my RAID-1 simple static volume had not failed, but I had to take the extensive steps listed in this thread (and more besides) to get my data back even though the data was not corrupt. All that needed to be done, in theory, was to wipe the OS partition and reinstall QTS leaving my data intact, but no such option was offered when I attempted to migrate to a new NAS.

Even if I had a backup, I would still have to go through the lengthy process of synchronizing the RAID-1 volume which writes to the entirety of the disks, as far as I can tell, causing stress on them. Then I'd also have to copy the data back to it, causing more wear on the drives.

tgsbn
Getting the hang of things
Posts: 75
Joined: Sun Nov 10, 2019 9:40 pm

Re: Mount QNAP Drives to Linux

Post by tgsbn » Tue May 12, 2020 6:43 am

Undesirable wrote:
Mon May 11, 2020 9:49 am
I agree with your summarisation of RAID, but I also think QNAP should offer a way to restore / reintegrate the RAID data automatically if the NAS itself fails and you need to reinitialise the disks.
Most definitely. I don't disagree with that at all. That's an entirely different story from salvaging data off the disks of a failed RAID using a non-QTS system.
Undesirable wrote:
Mon May 11, 2020 9:49 am
I found myself in a position where the disks in my RAID-1 simple static volume had not failed, but I had to take the extensive steps listed in this thread (and more besides) to get my data back even though the data was not corrupt. All that needed to be done, in theory, was to wipe the OS partition and reinstall QTS leaving my data intact, but no such option was offered when I attempted to migrate to a new NAS.
There's an off-chance that whatever forced you to reinstall QTS might also have damaged the RAID beyond repair.
Otherwise I'd qualify that as a bug.

vreemdeling
First post
Posts: 1
Joined: Sun May 24, 2020 1:01 am

Re: Mount QNAP Drives to Linux

Post by vreemdeling » Sun May 24, 2020 1:26 am

Niemand_01 wrote:
Wed Jun 19, 2019 3:12 am
I also had the problem that my NAS died with a hardware failure.

What worked for me was using the program r-explorer: https://www.r-explorer.com/#ourproducts

This program manages to read through the full QNAP software stack mdadm -> drbd -> lvm -> ext4 in my case

Since I did not want to pay the licence fee, I used the following workaround. The Program displays the sector offset of the device and the sector size use this to do a mount command:

Code: Select all

sudo mount -o offset=109710872576 /dev/sda /mnt/
Where you need to change the offset to the value you computed and the device to the device of your hdd.

A different option to get the correct offset is the program 'testdisk'. But this would take quite long so I could not test this, yet.
Thank you, Niemand_01, your tip enabled me to recover my data after TS-231P went weird. RAID1, thick segment type.

EricBuist
Starting out
Posts: 13
Joined: Tue Jul 03, 2018 10:04 pm

Re: Mount QNAP Drives to Linux

Post by EricBuist » Sun Jul 19, 2020 4:40 am

It's been hours, hours and hours I'm searching for a solution. My QNAP NAS completely died, nothing can make it boot again and it worked only for two years. I cannot afford paying 600$ every two years while I could buy a PC for that price and that would last 5-10 years. I chose a NAS because there is no convenient PC solution to build a RAID, at least not without copy/pasting cryptic commands from web pages which I'm terrible at doing. I end up completely stuck. Just a Linux box with separate drives would have done the trick, and one drive dies you don't loose all data just some, the machine dies you don't loose the drives and can even sometimes recovery the machine (PSU replacement, e.g.).
The only box I have at home that can host my 4 RAID drives is an old Linux-based HTPC, and all I can find as alternative to mounting the RAID on Linux, are Windows-based solutions such as ReclaiMe and R-Studio. I cannot install Windows on that 10-year old HTPC, this is worthless. My other machine doesn't have enough free SATA ports. I tried exploring the possibility of a USB-based docking station. I can find just one bay but need four, claims to work just on Mac but need Windows, etc. I'm also worried some docking station will try to be smart and act like a RAID controller of their own, preventing ReclaiMe or R-Studio to scan for QNAP RAID and just blindly reformatting the drives.

I don't know anybody with a 4-bay QNAP NAS I could borrow. If I did, at least I could try recovering my data. Obviously, I don't have a large enough disk to store it, I have between 6Tb-8Tb of stuff on this, but at least that problem can be solved.
At this point, the only solution seems to buy a new QNAP NAS or try with a data recovery company. But it would cost me hundreds of dollars.
Main data present on this RAID5 was ripped DVDs and blu-rays, but it takes two hours to rip a disk. My home videos, photos and other personal data is backed up at least. My assumption was that at most one drive would die at a time, which allows a RAID5 to be rebuilt and that my QNAP NAS would last several years. After it dies after 5+ years, it would have been a possibility to buy a new QNAP, and I was assuming worst case it would be possible to mount the array in a Linux box. I would never think EVERYTHING would get lost like this. With 4 separate drives, at worst, you loose one drive with SOME data but not ALL. Disks to re-rip, a shame, but at least not the whole collection! What I wanted from a RAID5 is a consolidated view of the collection, removing the need to search in drive1, drive2, drive3, and drive4. Seems this is not doable, not at the filesystem level at least, not with Linux (maybe Windows has simple to configure NTFS-based filesystem merging/virtual volumes, but I don't want a Windows-based media server).

All QNAP is caring about is synchronization between multiple NASes of their brand. Backup on Dropbox? Not supported. Backup on S3? Was working with some app, that app got removed, so no go, just buy a second QNAP NAS and use HBS or what not to synch the two boxes. That is a real non-sense. All I could do with that box is to use it as a SMB/NFS server, which a vanilla Ubuntu box can perform, without the RAID (unless you hack). But I'm ready to give up on RAID, especially after this super frustrating experience. What would guarantee me that if my Linux-baed RAID server fails and requires reinstall, I would be able to rebuild the array? After I saw this incompatibility, I'm really unsure.

Here are some things that could help:
- A Linux-based RAID recovery that would detect QNAP specific structure.
- A 4-bay USB docking station that would support at least Windows, ideally Linux as well (would be a handy purchase for other tests in the future), and that would just expose the drives, no RAID. That would allow me to try my luck with ReclaiMe or R-Studio at least.
- A faster blu-ray/DVD ripping solution, ideally Linux-based, but something Windows-based could help as well. Or a device that would allow to load multiple disks, rip, and eject.
- For the future, after this crisis is over, a Linux distribution with native RAID support at installation time or through a GUI, or at least some kind of script that would be able to scrape web pages for command lines and isolate them more easily than using the mouse for copy/pasting. I know this sounds silly, but this is a real problem for me. If I can't find that, I will simpel give up on RAID and just use large drives or mount multiple separate drives in separate folders.

MikeLagit
Easy as a breeze
Posts: 332
Joined: Fri Mar 22, 2013 11:40 pm

Re: Mount QNAP Drives to Linux

Post by MikeLagit » Sun Jul 19, 2020 5:31 am

Anyone have a recommendation for a good/economical, and QNAP compatible USB-to-SATA external drive adapter I could use on my TS-877? I am assuming external could write the data in a way it could be more easily mounted by any ubuntu machine? If not, that's out.
Model: TVS-872XT 16GB
Model: TS-877-1700 16GB

EricBuist
Starting out
Posts: 13
Joined: Tue Jul 03, 2018 10:04 pm

Re: Mount QNAP Drives to Linux

Post by EricBuist » Mon Jul 20, 2020 2:39 am

These recovery problems make all these bells and wissles such as LUNs, snapshots, etc., quite useless. A simple Linux box, with one large drive, no RAID, no LVM, then works better. I was hoping to get a solution showing multiple drives into a consolidated folder, but would be more reliable to use a media center tool to do this, or a script creating simliks to the different drives. No matter you use a NAS or a Linux box, you still have to spend time plugging an external drive and synching files, figuring out what changed, or just wipe the external drive and backup everything. Linux box allows you to use Dropbox to backup some data, or S3 to do so. Nothing of that on a QNAP, you have to synch with another QNAP, or NFS-mount your NAS and use a PC to do the backup, as if it was a simple drive. So I won't repeat the mistake of buying a NAS.

PickleRick63
New here
Posts: 2
Joined: Wed Aug 12, 2020 4:37 am

Re: Mount QNAP Drives to Linux

Post by PickleRick63 » Wed Aug 12, 2020 4:46 am

SimmoF wrote:
Sun Apr 19, 2020 12:40 pm
Niemand_01 wrote:
Wed Jun 19, 2019 3:12 am
I also had the problem that my NAS died with a hardware failure.

What worked for me was using the program r-explorer: https://www.r-explorer.com/#ourproducts

This program manages to read through the full QNAP software stack mdadm -> drbd -> lvm -> ext4 in my case

Since I did not want to pay the licence fee, I used the following workaround. The Program displays the sector offset of the device and the sector size use this to do a mount command:

Code: Select all

sudo mount -o offset=109710872576 /dev/sda /mnt/
Where you need to change the offset to the value you computed and the device to the device of your hdd.

A different option to get the correct offset is the program 'testdisk'. But this would take quite long so I could not test this, yet.
This worked for me. Don't forget to multiply the offset by the sector size to get the correct value.
109710872576 also happened to be the correct offset for me.
Just wanted to thank @Niemand_01 for this... this trick worked perfectly for me.

For the purpose of anyone else who might find it useful, you need to find the start sector (as reported by R-Explorer RAID version) for the partition you're trying to access:

1. Install R-Explorer RAID version trial
2. Identify your lost partition. I did this by looking for one that was about the right size
3. Look for the Start sector value & also note the Sector size (Bytes)
4. Multiply these numbers together

Run the command as above, using this number instead and adjusted to suit your system. In my case this looked like

Code: Select all

sudo mount -o offset=98621718528 /dev/sda3 /mnt/QNAP

aikane
First post
Posts: 1
Joined: Wed Dec 09, 2020 6:11 am

Re: Mount QNAP Drives to Linux

Post by aikane » Wed Dec 09, 2020 6:13 am

@PickleRick63, @SimmoF, @Niemand_01
What kind of set up of RAID and volumes did you fix by r-exploer?

Post Reply

Return to “System & Disk Volume Management”