Computers & Electronics

I accidentally wiped my NAS

  • Last Updated:
  • Jan 3rd, 2021 6:37 pm
[OP]
Banned
User avatar
May 15, 2016
7020 posts
2479 upvotes

I accidentally wiped my NAS

Crying FaceI tried using usb copy for first time and thought I was just copying files over by accidentally wiped the directory. Is there a way I can get the things back?
28 replies
Deal Addict
User avatar
Aug 15, 2006
3677 posts
747 upvotes
Kingston
Depends, do you have RAID set up on your drives? If so, you might still have your data on your RAID sections.
[OP]
Banned
User avatar
May 15, 2016
7020 posts
2479 upvotes
Yes. How would I find out if they are on my raid sections?

I went data import using mirroring mode.

I see files with 0 KB and some wiht data. When I ran the copy, I see files from today with ._ in front of it with file size of 1 KB. There are some with the same file name an older time stamp and they appear to be full file size.
Deal Addict
User avatar
Apr 29, 2018
1399 posts
969 upvotes
Vancouver
Depends on how complex your setup was. If it was no RAID or just RAID1 (mirror), then it'll be easy and should just be the standard process for recovering deleted files. Though I am not sure if that is possible for more complex RAID setups (probably SOL for RAID 0/5/6).

One of the reasons, I always dissuade people from doing complex setups such as RAID 5/6. Also why IT people keep their tech stacks simple & place only the bare minimum amount of trust in them. When things go wrong, you want the simplest possible way to back out.
Can't Stop. Won't Stop. Game Stop
[OP]
Banned
User avatar
May 15, 2016
7020 posts
2479 upvotes
I only have two drives so I'm assuming raid 1? Can you tell me what I should look for or a guide to follow?
Deal Expert
Feb 29, 2008
27833 posts
4137 upvotes
Montreal
I've been trying to teach my kids to properly wipe their NAS for years.
Deal Addict
Jun 8, 2005
3093 posts
555 upvotes
Toronto
Restore from most recent backup, problem solved.
Deal Addict
User avatar
Apr 29, 2018
1399 posts
969 upvotes
Vancouver
vivibaby wrote: I only have two drives so I'm assuming raid 1? Can you tell me what I should look for or a guide to follow?
So if you mirrored your drives, just plug into a PC or use an external SATA-to-USB thing. Then just run normal data recovery software. There are quite a few available. The final thing to consider would be the file system you were using. Was it EXT4 or BTRFS or something else?
Can't Stop. Won't Stop. Game Stop
Deal Addict
User avatar
Aug 15, 2006
3677 posts
747 upvotes
Kingston
vivibaby wrote: I only have two drives so I'm assuming raid 1? Can you tell me what I should look for or a guide to follow?
When you setup your NAS, did you set it up RAID 1 on initial setup?

If you didn't, you're SOL. You have to have set up RAID 1 prior to you wiping the primary drive.

It shouldn't be hard to find your data if you setup RAID 1. Go into your NAS via a computer, go to storage settings probably in control panel and it should be somewhere in there. If you had RAID 1 setup, you should see backup copies made of most if not every file you put on your NAS. From there you can either copy it back to the primary or copy it to an external and then reup it to the primary.
Deal Expert
Mar 23, 2009
19872 posts
6048 upvotes
Toronto
kcorscadden wrote: When you setup your NAS, did you set it up RAID 1 on initial setup?

If you didn't, you're SOL. You have to have set up RAID 1 prior to you wiping the primary drive.

It shouldn't be hard to find your data if you setup RAID 1. Go into your NAS via a computer, go to storage settings probably in control panel and it should be somewhere in there. If you had RAID 1 setup, you should see backup copies made of most if not every file you put on your NAS. From there you can either copy it back to the primary or copy it to an external and then reup it to the primary.
RAID1 is not a backup. If he wiped the directory, normally the directory on both drives would be wiped.
Deal Addict
User avatar
Nov 15, 2020
1732 posts
1218 upvotes
mr_raider wrote: I've been trying to teach my kids to properly wipe their NAS for years.
now you get to teach a bunch of thrifty RFD adults too
Deal Addict
May 12, 2014
3030 posts
2844 upvotes
Montreal
vivibaby wrote: Crying FaceI tried using usb copy for first time and thought I was just copying files over by accidentally wiped the directory. Is there a way I can get the things back?


I'm not clear on what you did?

You have a NAS. Set up how? RAID 1? BTRFS? Snapshots enabled?


And you copied files from some exterior source (HDD, usb stick) via USB copy and overwrote your NAS files?


If you have snapshots you can revert the changes.
If you have hyperbackup to Backblaze you can restore the backup.

These would be the two easiest ways.
[OP]
Banned
User avatar
May 15, 2016
7020 posts
2479 upvotes
trane0 wrote: Restore from most recent backup, problem solved.
I don’t think I have one?
kramer1 wrote: So if you mirrored your drives, just plug into a PC or use an external SATA-to-USB thing. Then just run normal data recovery software. There are quite a few available. The final thing to consider would be the file system you were using. Was it EXT4 or BTRFS or something else?
I have a synology so whatever is default.
FrancisBacon wrote: I'm not clear on what you did?

You have a NAS. Set up how? RAID 1? BTRFS? Snapshots enabled?


And you copied files from some exterior source (HDD, usb stick) via USB copy and overwrote your NAS files?


If you have snapshots you can revert the changes.
If you have hyperbackup to Backblaze you can restore the backup.

These would be the two easiest ways.
I didn’t set anything up. Just default folders raid parity as a file server.

I tried to USB copy from a USB drive to the NA’s using mirror mode but it deleted all my files.

What is snapshots?
Deal Addict
User avatar
Apr 29, 2018
1399 posts
969 upvotes
Vancouver
vivibaby wrote:
I have a synology so whatever is default.

Contact their support, they should be able to help
Can't Stop. Won't Stop. Game Stop
[OP]
Banned
User avatar
May 15, 2016
7020 posts
2479 upvotes
kramer1 wrote: Contact their support, they should be able to help
I did. But it seems like they don’t know much as he told me it’s not recoverable when common sense says that it is.
Deal Addict
Jun 8, 2005
3093 posts
555 upvotes
Toronto
vivibaby wrote: I did. But it seems like they don’t know much as he told me it’s not recoverable when common sense says that it is.
No offense, but the ability undelete files is a product of luck with FAT32/NTFS file systems and in no way a feature that was built in to these technologies, so not at all "common sense". You have to get lucky that the blocks that made up your deleted files weren't corrupted or overwritten in any way, which on an active server is only a matter of time before those blocks are gone and the underlying files are not recoverable.

  • You don't know if you have backups? That kind of sums up this thread in a nutshell.
  • Did you enable the recycling bin feature on the share you deleted the files from? This is a Synology DSM feature and is not turned on by default.

Here's the process for undeleting files from an RAID1 / ext4 volume. Since you haven't advised what kind of RAID and what kind of file system your NAS is using, or even what model/version of Synology DSM, I'm assuming it's the default. If it's anything else, the process is probably different.

1) Backup your important data on your NAS
2) Remove 1 of the disks from the NAS and attach it to a computer
3) Boot the computer with an Ubuntu live cd (or alternatively something like sysrescuecd which has extundelete installed already)
4) Mount the drive with mdadm
5) Install the extundelete package
6) Run extundelete to recover your deleted files. Maybe even recover these files to a different drive as a precaution. Up to you.
Deal Addict
May 12, 2014
3030 posts
2844 upvotes
Montreal
If you don't know what snapshots are you don't have them (needs to be set up).

Backups are a copy of your data. Do you have a copy?


If your data is of little value, just consider it lost. Start over from scratch setting up your NAS.

If it's high value, and you have copies, start over from scratch setting up your NAS.


If it's high value and you have no copies, stop touching your NAS. You will need professional (paid) help to recover the data if it's even possible. It unfortunately doesn't appear that you'll be able to do it yourself, if it's even possible.

And if you try yourself it's very possible that you'll make things worse.



This will not help right now, but to avoid data loss in the future: set up SHR1, use BTRFS with error correction, set up scrubbing every 3 months, set up snapshots, set up hyperbackup to Backblaze every night.
Deal Addict
Jan 10, 2009
1350 posts
794 upvotes
Toronto
Remember RAID isn't a backup solution, it's a fault tolerance solution. It's there to make sure you can recover your data in the event of data corruption or hard drive failure, not to help when you delete files. There are exceptions to this obviously, and in your case having Recycle Bins turned on would probably have helped. One use case is your NAS should be a backup of files from everywhere else on your network, not a sole source of data. It's fine to use it for processing and for media dispensing, but all your data should be located somewhere else as well.
Deal Fanatic
User avatar
Oct 8, 2006
5600 posts
595 upvotes
Toronto
Hopefully you haven't been using the drive afterwards. Undelete recovery programs might do some work.
Deal Addict
User avatar
Apr 29, 2018
1399 posts
969 upvotes
Vancouver
vivibaby wrote: I did. But it seems like they don’t know much as he told me it’s not recoverable when common sense says that it is.
I would suggest calling a local IT pro.

They would first need to ascertain your old config.

Now by default Synology pushes RAID5/6. If that is what you setup, then recovery is going to be near impossible (depending ofcourse on how the disks were wiped). If however you setup RAID1, then it is just a matter of popping the disks into a PC and running an undelete program
Can't Stop. Won't Stop. Game Stop

Top