How to Recover Data from RAID-z Array, ZFS File System, NAS with TrueNAS Core

today we going to discuss How to Recover Data from RAID-z Array, ZFS File System, NAS with TrueNAS Core. Hello everyone! See how to recover data from a RAID-z array. How to assemble RAID-z and RAID-z2 on the example of a device running the TrueNAS operating system and how to get data from a destroyed RAID array or return it in case of loss, accidental deletion or formatting of the device.

Recover Data from RAID-z Array, ZFS File System, NAS with TrueNAS Core
Recover Data from RAID-z Array, ZFS File System, NAS with TrueNAS Core

What Is ZFS Brief Description

The ZFS file system offers its own implementation of software RAID called RAID-Z. In addition to improving performance, such a system is able to deal with subtle data corruption. To do this, it monitors bad data blocks using checksums and instantly corrects logical errors. This feature helps maintain the integrity of the data stored in the array.

But even the most reliable file system and hardware cannot protect your data from software and hardware failures. Later in the video, I will show you how to recover lost data from the ZFS file system and RAID-z array. ZFS is an open source file system primarily used in FreeNAS and other FreeBSD-based storage systems.

The data distribution scheme in RAID-z is similar to traditional RAID5, but there are still some minor differences. This array building system uses dynamic stripes instead of fixed size stripes. Information about the size of each of these stripes is recorded in the metadata.

Due to the dynamic nature of this system, data recovery from it is only possible if the metadata is intact. When designing ZFS, the main goal was reliability, which is achieved through various features such as copy-on-write, redundant metadata, journaling, and others.

Due to the complex structure of this file system, conventional data recovery software is not suitable for data recovery from RAIDZ arrays. Hetman RAID Recovery analyzes the metadata to determine the correct RAID-z structure and automatically reassembles the degraded RAID on the fly.

How to create RAID-z2

First, let’s look at how to create a RAID-z array using TrueNAS storage as an example. In the previous video, I already talked about how to install and configure this operating system and how to create a RAID-z.

Let’s look at how to build a RAID-z2 (second level). To do this, in the TrueNAS management menu, expand the tab – Storage – Pools. Here click on the Add and Create Pool button. Specify the pool name, then mark the drives, RAID-z2 needs at least 4 drives, and click the arrow below to add the storage device to the list .

We mark the drives from this list and select the RAID level from the drop-down list, and then Create. In the pop-up warning window that all data will be overwritten, check the box and click – Create pool, after which the formatting of the drives and the process of building the RAID will begin.

How to set up an FTP connection

let’s set up an FTP connection, write data to a RAID array, and simulate the loss or breakdown of a device, in which the data is no longer available. So, first let’s add a new dataset for the FTP connection.

  • Open the tab Storage
  • Pools
  • click on the three dots
  • add dataset
  • We give it a name, the rest of the settings are unchanged –
  • Submit

How To Create a new user for ftp

  • Create a new user for ftp
  • Accounts
  • Users
  • Add
  • Specify the name, password, remove the checkmark opposite here –
  • New Primary Group and select from the list –
  • ftp.
  • Next, specify the directory that we created earlier, set the necessary rights, and save the setting.

Let’s go back to the dataset that we recently created and change the permissions. Click on the three dots – Edit Permission. Select Usera – ftp and group – Ftp, set the mark, confirm, then mark – Apply User and Apply Group, save the settings. Now it remains to activate the ftp server. Open – Services – Move the slider to the on position and set the automatic start mark. The FTP connection is configured, we check access in the explorer in the address bar, enter ftp://Ip-server, then the username and password of the user. Now here you can create a folder and write data.

RAID-z data recovery

Now let’s consider the recovery of accidentally deleted information from a RAID-z array. RAID-Z1 ensures that each unique block of data is written so that you can recover from the failure of any single drive. RAID-Z1 is almost analogous to RAID 5, as it uses a single parity. Assumes operation in case of failure of one disk from the array.

But as I mention earlier, recovery from such a system is within the power of a small number of recovery programs. Hetman RAID Recovery Hetman RAID Recovery supports the ZFS file system and RAID-z arrays of all levels.

The program is able to automatically assemble an array from RAID drives built using this file system. It is a comprehensive NAS data recovery solution that can help you recover files under various scenarios. The program supports most popular file systems and RAID types. For recovery, you need to remove the disks from the server and connect them to a PC with a Windows operating system.

If your motherboard does not have enough ports to connect, there are various expansion adapters. The program will automatically scan the disks for service information and assemble them into RAID on the fly. As you can see my RAID-z array is displayed in disk manager.

To start the recovery process, start the analysis, right-click on the array – open, select – Quick analysis. As you can see, as a result of a quick analysis, the program could not find deleted files, but those that remained on the disks are all available for recovery, a quick analysis will help recover data in the event of a hardware failure or device failure. The structure of building the metadata of the ZFS and RAIDz file systems is designed in such a way that the program’s quick analysis algorithm does not allow finding deleted data, since information about them is overwritten in the log files.

How To find deleted files RAID-z

In order to find deleted files, you need to scan the disk with a full analysis. So, right-click on the partition, select – Analyze again and run – Full analysis, specify the file system – Next and wait for the scan to complete. This process will take a long time depending on the size of the disk array.

After the scan is completed, we go to the location of the deleted files and look here for those that need to be returned, for convenience , the program implements a search by file name.

You can also view the contents of the files in the preview. As you can see, the program found all the files that were deleted from the disk in full. To restore, mark the ones you need and click – Restore, specify the directory to save. It is not recommended to restore to the same disk, so you need to take care of the drive to save the information.

How to recover data from RAIDz2 l2 array

Upon completion, these files will be in the specified folder. level two), you will also need to connect the drives to a Windows computer and run the Hetman RAID Recovery program. RAID-Z2 is more fault tolerant because it uses two parity blocks and two data blocks from one piece of information. This is an analogue of RAID 6 and also withstands the fall of as many as two drives.

In RAID-Z2, the maximum number of disks is at least four. Therefore, if your PC does not have enough connectors to connect all the drives, you can exclude 2 drives from the array. So, we have a case of a destroyed RAID array as a result of a failed server or controller.

As you can see, the program assembled a RAID even without two drives. Click on the array with the right mouse button and run a quick analysis. As a result, we see the files that remained on the disks. We mark those that need to be restored and restore them.

If the program did not find some files, they may have been overwritten, in this case, try to perform – Full analysis. As a result, the program will even find deleted data.

Hey, I Am Chahat Sharma Panday, A Full Time Blogger & Youtuber Founder of TechRemake


Leave a Comment