NETGEAR is aware of a growing number of phone and online scams. To learn how to stay safe click here.

Forum Discussion

timous's avatar
timous
Aspirant
Oct 12, 2013

Recovering a deleted Share

Hi guys,

I deleted a Share in the ReadyNas admin panel of my Duo v2.
I intended to delete only the Share itself, not the physical folder it used to share.

This folder called /important ( -> /c/important) used to contained 1.8 To of data.

When I removed the Share, I also noticed through SSH that it removed the directory too. Not only the link to the directory !

Am I mistaken?
Is there any way to recover it?

Please help !!

4 Replies

Replies have been turned off for this discussion
  • StephenB's avatar
    StephenB
    Guru - Experienced User
    The share is the folder, so deleting the share deletes the folder.

    extundelete might work, though I am not certain how to install it on your NAS.
  • Thanks StephenB.

    The share is the folder

    And the cake is a lie.

    extundelete might work, though I am not certain how to install it on your NAS.

    Unfortunately I was not able to install it on the ReadyNas Duo v2. It requires dependencies that have no equivalent on the NAS' OS.
    I managed to install TestDisk smoothly, but I wasn't able to undelete any file. I started to scan partitions of the disk (even through USB under Windows) for isolated blocks, which takes too long (I quit at 1797853/3876585471 progress, i.e. 00%).

    So because of the slowness and limitations of the Duo OS, I moved to a real machine, running Ubuntu. I managed to access the disk's partitions in various ways and I learned lots of things. Here are my conlcusions:

    • 0- System
      Immediately extract disk from bay #2 when you did a foolish thing. The less time you let to the RAID 1 sync, the most chances you'll have to get your data back.
      Move to a more powerful and flexible system to make tests and recovery. You may need to install a large number of apps, libs etc. to make it work.

    • 1- TestDisk
      TestDisk can show what kind of partitions table your disk is using, and the nature of each partition, which may be useful. To do it, I just let it starting a Quick Scan. Then I stop it to change type. By default, the type of the scanned partition and its table of partitions are selected. Just note it. In my case, since I didn't change the defaults of the Duo it detected that the partition table is a GPT, and partitions are linux md 1.x RAID. Even if the file system itself is ext4, I understand that I do need to know that it is a linux RAID partition to be able to mount it and browse files.

    • 2- mdadm
      mdadm is a tool that enables you to create / mount RAID file systems. I used it to mount the /dev/sdb3 partition containing my almost 2 TB of data. It was a success, though I didn't know what to do with that. I finally umounted it and jumped to step #3.

    • 3- extundelete
      extundelete seems to be the ideal tool for the job. Unfortunately, I was not able to make it work since my partition is a linux RAID which seems to be prior to the ext4 file system behind. extundelete works with ext, ext2, ext3 and ext4 file systems exclusively at this time.

    • 4- PhotoRec
      PhotoRec is definitely the tool I should have used first. It seems to be based on TestDisk (same interface and vocabulary...) but it just worked for me. Select the type of files you want to recover and just push play. Hours later you'll get 1.5 TB of data recovered (if nothing happened to the data meanwhile, which depends on the time you take to extract the disk from the bay). In my case, I only selected JPG files I lost (whatever are you files' extention, jpeg, jpg of JPG, it looks for the file header itself). It took 4h but I think it may not take much longer for a full recovery, since it browses all disk's blocks anyway. Side effect: filenames are lost (and forget about any form of data structure: folders are gone too, music is over :x ).

    • 5- Backup
      Ok. I now understand that RAID 1 is not about backup. I'm ordering a CrashPlan solution right now...


    Hope this help and that the level of verbosity is more interesting than annoying.

    Tim

    PS: Here is a good way to start with mdadm, and here a good way to stop using it (not so easy)!
  • mdgm-ntgr's avatar
    mdgm-ntgr
    NETGEAR Employee Retired
    After umount do the following (run using sudo if on Ubuntu):

    # mdadm --stop --scan
    # cat /proc/mdstat


    The --scan option searches for all the md devices allowing you to stop them all at once. Then you want to confirm they are stopped.

    Note zero'ing the RAID superblock would cause you to lose all data.
  • StephenB's avatar
    StephenB
    Guru - Experienced User
    timous wrote:
    Thanks StephenB.

    The share is the folder

    And the cake is a lie...
    Honestly- I don't understand why you thought that deleting the share wouldn't delete the data in it. If they called it "unshare" then I'd get it. But the "delete" word seems extremely clear. Blaming Netgear because "delete" actually deletes is very strange to me.

    On the other stuff, if you are good with linux and have the time you can certainly build your own custom-built NAS. I don't personally have the time/interest, and the turnkey ReadyNAS have worked reasonably well for me. I agree there are some compromises when you go turnkey, but there are some advantages also.

    BTW, the file system itself is ext, so I don't understand your comments on that.

NETGEAR Academy

Boost your skills with the Netgear Academy - Get trained, certified and stay ahead with the latest Netgear technology! 

Join Us!

ProSupport for Business

Comprehensive support plans for maximum network uptime and business peace of mind.

 

Learn More