NETGEAR is aware of a growing number of phone and online scams. To learn how to stay safe click here.
Forum Discussion
whc
Nov 02, 2019Aspirant
Rebuilding shares using SSH possible?
Just mistakenly deleted shares when I deleted stuck snapshots using SSH, is it possible to rebould those shares with SSH, have taken screenshot, so have the ID and gen numbers, maybe a SSH command ca...
Sandshark
Nov 02, 2019Sensei
From the boot menu: How-do-I-access-the-boot-menu-on-my-ReadyNAS-316-516-716
Of course, once you are ready to start, it'll have to be out of read-only mode to do the actual recovery.
whc
Nov 02, 2019Aspirant
Cant really find anything that works just yet, have about 4 TB files in those deleted shares, is it not possible to just backup every deleted files to another readynas and then sort them form there?
SSH is not my strong souit, only messed with it to get the "stuck" 2tb snapshots removed from my 316.
Spend the whole day reading how to backup without getting any smarter, btrfs restore, sounds good, but what command to restore entire shares/folders and not just single files?
- whcNov 02, 2019Aspirant
btrfs restore, don't understand how to put togheter a command line for restore a share, cannot fint any examples online, below is the options:
btrfs restore [options] <device> <path> | -l <device>
Try to restore files from a damaged filesystem (unmounted)
-s|--snapshots get snapshots
-x|--xattr restore extended attributes
-m|--metadata restore owner, mode and times
-S|--symlink restore symbolic links
-v|--verbose verbose
-i|--ignore-errors ignore errors
-o|--overwrite overwrite
-t <bytenr> tree location
-f <bytenr> filesystem location
-u|--super <mirror> super mirror
-r|--root <rootid> root objectid
-d find dir
-l|--list-roots list tree roots
-D|--dry-run dry run (only list files that would be recovered)
-F force (do not prompt on large files looping frequently)
-X eXtreme search (use both BTRFS_DIR_ITEM_KEY and BTRFS_DIR_INDEX_KEY)
--path-regex <regex>
restore only filenames matching regex,
you have to use following syntax (possibly quoted):
^/(|home(|/username(|/Desktop(|/.*))))$
-c ignore case (--path-regex only)
- whcNov 02, 2019Aspirant
Or maybe there is a command for using rsync, and backing up all data on the nas drives, no matter if deleted or not?
- SandsharkNov 02, 2019Sensei
Rsync cannot see the deleted subdirectory or the files in it, so it cannot do anything. Most of the tools that are around for restoring "lost" files in linux don't work when you lose an entire btrfs subvolume (which a share is), not just a directory.
Did you go to the script that was referenced in the other article? http://www.infotinks.com/btrfs-undelete-undeleting-recovering-accidentally-deleted-a-subvolume-or-file-in-btrfs-and-dont-have-a-snapshot/
I believe btrfs rescue can copy everything, including deleted subvolumes, from one volume to another, but it will truely copy everything. So you need enough space to also hold a copy of whatever you have not accidently deleted as well as what you have. https://btrfs.wiki.kernel.org/index.php/Manpage/btrfs-rescue .
This is where the best answer is "restore from your backup". I assumed you would not have asked if you had a backup.
Related Content
NETGEAR Academy
Boost your skills with the Netgear Academy - Get trained, certified and stay ahead with the latest Netgear technology!
Join Us!