× NETGEAR will be terminating ReadyCLOUD service by July 1st, 2023. For more details click here.
Orbi WiFi 7 RBE973
Reply

Recover Destroyed Volume

tmr0
Aspirant

Recover Destroyed Volume

Hello

 

I had a single 8TB disk in channel 1 which provided a single volume. Yesterday I added three new disks each 3TB in size. I disabled X-RAID and created a new volume with the three new disks as RAID0. I performed a system configuration backup and then I changed my mind and wanted to destroy the RAID0 volume to instead create a RAID5 volume with the three new disks but in error I destroyed the 8TB volume instead. I immidiately recongnised my error after proceeding past the warning dialogue box, so after it had completed that action I shutdown the NAS and removed the 8TB disk and put into a USB3 caddy and attached it to a Windows computer to perform analysis and data recovery.

 

I know RN314 has not overwritten the data, only reformated drive partition information and deleted vit-mdadm RAID information.

 

Is there any way that the volume can be restored on the 8TB drive to recover the volume contents?

 

I purchased a 1Yr NETGEAR support contract today only to be told by NETGEAR technical support there is nothing they can do to help.

 

Searching the internet I found this article: https://notebookbft.wordpress.com/2017/04/27/recovering-accidentally-formatted-ext4-partition-fixing...

 

I also found this data recovery software https://www.r-studio.com/

 

Does anyone have any advice or can point me in the right direction on the best way to recover data in this scenario?

 

Thanks,

 

Troy

Model: RN31400|ReadyNAS 300 Series 4- Bay (Diskless)
Message 1 of 8

Accepted Solutions
tmr0
Aspirant

Re: Recover Destroyed Volume

If you are reading this post because the same situation has happened to you, fear not; the RAID1 data (BTRFS) is still on the disk intact even after you DESTROY the volume. Here is the solution that enabled me to recover all data from the deleted volume which was surprisingly simple:

 

Note that I used an external SATA dock to connect the disk containing the deleted volume as I wanted to use the four disk trays for a new RAID5 volume. If you only have two disks, the original disk with the deleted volume and a replacement disk for data recovery, then you do not need to use an external SATA dock and can skip steps 4-7.

 

  1. Don't panic.

  2. Don't expect NETGEAR technical support to provide any data recovery services or provide any information that would enable you to recover the data yourself.

  3. Insert replacement disk(s) and create new volume with sufficient capacity for the recovered data and make sure you name the new volume differently to the name of the deleted volume. Important: when creating a new volume with replacement disk(s) do not include the disk containing the deleted volume. This process will also create a copy of the NAS boot partition (including NAS system configuration) on replacement disk(s). 

  4. Remove the disk containing the deleted volume from the NAS.

  5. Shut down the NAS.

  6. Insert the disk containing the deleted volume into a SATA dock (I used something like this) and connect the dock to the NAS using an eSATA cable (much quicker than a USB2 connection).

  7. Boot up the NAS.

  8. Enable SSH service.

  9. Connect to NAS via SSH (I used PuTTY) and login with NAS admin account.

  10. Elevate to root privilages using the "su" command and the admin password. 

  11. List the contents of the root with the command "ls -al /" you should see both the new volume and the deleted volume which for this example I will call "NewVolume" and "DeletedVolume" respectively.

  12. Simply copy the contents of "DeletedVolume" to "NewVolume" with a command like "cp -v -p -R /DeletedVolume/* /NewVolume"
    Note that file and directory names are case-sensitive.

  13. The copy time will vary according to how much data you have. For example 7.5TB of files took approximately 9 hours.
    You can estimate the transfer time using this calculator and a transfer rate of 220MBps for SATA connection.

  14. After the data copy is complete, shut down the NAS.

  15. Remove the external disk connected via eSATA cable.

  16. Boot up the NAS.

  17. All of your files and directories are restored on the new volume.

  18. Recreate any non-default shares using NAS managment GUI.

 

That's it... happy days 🙂

View solution in original post

Message 4 of 8

All Replies
Sandshark
Sensei

Re: Recover Destroyed Volume

Your volume was not EXT, so the information you found on that is not applicable.  The NAS single drive is actually a 1-drive RAID1 that the OS ignores is degraded.  Unfortunately, I believe that a DESTROY also removes the partition.  So, step one is you need to find out the exact parttion layout the OS uses for your drive size and re-create it.  Next, you'd have to re-create the MDADM RAID using the --assume-clean flag.  Now, if the OS doesn't also do something to the BTRFS file system other than unmount it, it should "re-appear" and be mountable.

 

That's a lot to figure out, especially if you are new to Linux.

 

But before you even try, you said you bought a "support contract".  "Support" doesn't include "data recovery", that's an entirely separate contract (with no guarantees).  But I'm surprized standard support didn't tell you that.  I think you need to talk to support again and tell them you are interested in a data recovey, and tell them again the circumstances of the loss.

 

And, whether you get this all straightened out or not, take this as a lesson that unless your NAS is already just a backup (all the data exists elsewhere), you need a backup for it.

Message 2 of 8
tmr0
Aspirant

Re: Recover Destroyed Volume

Hi Sandshark,

 

Thank you for that information - much appreciated.

 

Your pointer to BTRFS led me to this recovery software https://www.reclaime.com/library/btrfs-recovery.aspx which has scanned the disk and enumerated the deleted volume's directories and files. Feeling more hopeful now.

 

I'll keep searching for an easier and quicker way of restoring the BTFRS from within a linux VM but at least I know I can export the content off the disk as a last resort.

 

This post seems applicable: https://community.netgear.com/t5/Using-your-ReadyNAS-in-Business/OS6-Data-Recovery-How-to-Mount-BTRF...

 

Cheers,

 

Troy

Message 3 of 8
tmr0
Aspirant

Re: Recover Destroyed Volume

If you are reading this post because the same situation has happened to you, fear not; the RAID1 data (BTRFS) is still on the disk intact even after you DESTROY the volume. Here is the solution that enabled me to recover all data from the deleted volume which was surprisingly simple:

 

Note that I used an external SATA dock to connect the disk containing the deleted volume as I wanted to use the four disk trays for a new RAID5 volume. If you only have two disks, the original disk with the deleted volume and a replacement disk for data recovery, then you do not need to use an external SATA dock and can skip steps 4-7.

 

  1. Don't panic.

  2. Don't expect NETGEAR technical support to provide any data recovery services or provide any information that would enable you to recover the data yourself.

  3. Insert replacement disk(s) and create new volume with sufficient capacity for the recovered data and make sure you name the new volume differently to the name of the deleted volume. Important: when creating a new volume with replacement disk(s) do not include the disk containing the deleted volume. This process will also create a copy of the NAS boot partition (including NAS system configuration) on replacement disk(s). 

  4. Remove the disk containing the deleted volume from the NAS.

  5. Shut down the NAS.

  6. Insert the disk containing the deleted volume into a SATA dock (I used something like this) and connect the dock to the NAS using an eSATA cable (much quicker than a USB2 connection).

  7. Boot up the NAS.

  8. Enable SSH service.

  9. Connect to NAS via SSH (I used PuTTY) and login with NAS admin account.

  10. Elevate to root privilages using the "su" command and the admin password. 

  11. List the contents of the root with the command "ls -al /" you should see both the new volume and the deleted volume which for this example I will call "NewVolume" and "DeletedVolume" respectively.

  12. Simply copy the contents of "DeletedVolume" to "NewVolume" with a command like "cp -v -p -R /DeletedVolume/* /NewVolume"
    Note that file and directory names are case-sensitive.

  13. The copy time will vary according to how much data you have. For example 7.5TB of files took approximately 9 hours.
    You can estimate the transfer time using this calculator and a transfer rate of 220MBps for SATA connection.

  14. After the data copy is complete, shut down the NAS.

  15. Remove the external disk connected via eSATA cable.

  16. Boot up the NAS.

  17. All of your files and directories are restored on the new volume.

  18. Recreate any non-default shares using NAS managment GUI.

 

That's it... happy days 🙂

Message 4 of 8
StephenB
Guru

Re: Recover Destroyed Volume


@tmr0 wrote:

 

  1. Simply copy the contents of "DeletedVolume" to "NewVolume" with a command like "cp -v -p -R /DeletedVolume/* /NewVolume"


This step isn't correct.  With OS-6 NAS, each share is a BTRFS subvolume.  If you simply copy the deleted volume, you are creating ordinary folders on NewVolume, not subvolumes.  That could get you into trouble sometime down the road.  Snapshots certainly won't work properly (and neither would ReadyDR).

 

FWIW, normally we recommend that people log into the NAS as root (which avoids the need for SU).

Message 5 of 8
tmr0
Aspirant

Re: Recover Destroyed Volume

Good point.. Thank you for that correction.

What I actually did was copy the content of each default share separately. For example:

 

cp -v -p -R /DeletedVolume/Documents/* /NewVolume/Documents
cp -v -p -R /DeletedVolume/home/* /NewVolume/home
cp -v -p -R /DeletedVolume/Music/* /NewVolume/Music
cp -v -p -R /DeletedVolume/Pictures/* /NewVolume/Pictures
cp -v -p -R /DeletedVolume/Videos/* /NewVolume/Videos

 

RN314 now seems to be working well 🙂

Message 6 of 8
StephenB
Guru

Re: Recover Destroyed Volume


@tmr0 wrote:

 

What I actually did was copy the content of each default share separately. 

 

That still might not have done it.  Did you create the shares using the web ui on the new volume before you did the copy?

 

Did you try listing the subvolumes on the new volume, (reconciling that list against DeletedVolume).  If the original volume has a lot of snapshots, you can exclude them from the btrfs listing with 

# btrfs subvolume list /DeletedVolume | grep -v snapshot

 

Also, note that the specific private shares under /home are also subvolumes in their own right.  There are also some hidden subvolumes - .apps for example.  However these likely were moved to your second volume when you destroyed the first one.  So check for that before recreating them.

 

 

Message 7 of 8
Sandshark
Sensei

Re: Recover Destroyed Volume

I'm extremely surprised this worked for you.  I ran an experiment destroying a volume and, as I said in my original response, the partition containing the data volume was removed (OS and swap were not).  Since I knew the boundries of the orignal partition, I was able to re-create it.  I then re-created the MDADM RAID using the --assume-clean option and finally resurrected the BTRFS volume using btrfs recover and mounted it.  There were a couple files reported as unsalvageable, but it mostly went well (I had filled it with about 100GB of photos and videos).

 

I was also able to create an /etc/fstab entry so it survived re-boot, but the OS does not recognize it, so the data would have to be recovered via SSH if this were not just an experiment.

Message 8 of 8
Top Contributors
Discussion stats
  • 7 replies
  • 3445 views
  • 1 kudo
  • 3 in conversation
Announcements