snapraid:recover_a_lost_file
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
snapraid:recover_a_lost_file [2025/04/29 17:15] – [Restore Files] peter | snapraid:recover_a_lost_file [2025/09/11 10:09] (current) – [Restore the contents of a directory] peter | ||
---|---|---|---|
Line 15: | Line 15: | ||
</ | </ | ||
- | + | ||
---- | ---- | ||
Line 46: | Line 46: | ||
---- | ---- | ||
+ | ===== Restore All Deleted Files on Data Disk d1 ===== | ||
+ | |||
+ | To recover all the deleted files in a specific data disk: | ||
+ | |||
+ | <code bash> | ||
+ | snapraid fix -m -d d1 | ||
+ | </ | ||
+ | |||
+ | ---- | ||
+ | |||
+ | ===== Restore the contents of any specifically named directory in all drives ===== | ||
+ | |||
+ | <code bash> | ||
+ | snapraid fix -m -f Test/ | ||
+ | </ | ||
+ | |||
+ | <WRAP info> | ||
+ | **NOTE: | ||
+ | </ | ||
+ | |||
+ | ---- | ||
+ | |||
+ | ===== Get the absolute path from the file system perspective of any changes since the last sync ===== | ||
+ | |||
+ | Find the absolute path of the file to be recovered. | ||
+ | |||
+ | <code bash> | ||
+ | snapraid diff --test-fmt path | ||
+ | </ | ||
+ | |||
+ | returns: | ||
+ | |||
+ | < | ||
+ | Loading state from / | ||
+ | Comparing... | ||
+ | add / | ||
+ | add / | ||
+ | ... | ||
+ | update / | ||
+ | update / | ||
+ | ... | ||
+ | copy / | ||
+ | copy / | ||
+ | ... | ||
+ | move / | ||
+ | move / | ||
+ | ... | ||
+ | remove / | ||
+ | remove / | ||
+ | ... | ||
+ | 550112 equal | ||
+ | 294 added | ||
+ | 1571 removed | ||
+ | 5 updated | ||
+ | 7 moved | ||
+ | 1432 copied | ||
+ | 0 restored | ||
+ | There are differences! | ||
+ | |||
+ | </ | ||
+ | |||
+ | <WRAP info> | ||
+ | **NOTE: | ||
+ | |||
+ | Various changes are shown in the example above, including: | ||
+ | |||
+ | * **Add** - Some files have been added since the last sync. | ||
+ | * **Update** - Some files have been updated since the last sync. | ||
+ | * **Copy** - Some files have been copied since the last sync. | ||
+ | * **Move** - Some files have been moved since the last sync. | ||
+ | * **Remove** - Some files have been removed since the last sync. | ||
+ | |||
+ | </ | ||
+ | |||
+ | ---- | ||
+ | |||
+ | ===== Get the data disk from snapraids array perspective of any changes since the last sync ===== | ||
+ | |||
+ | <code bash> | ||
+ | snapraid diff --test-fmt disk | ||
+ | </ | ||
+ | |||
+ | returns: | ||
+ | |||
+ | < | ||
+ | Loading state from / | ||
+ | Comparing... | ||
+ | add d3: | ||
+ | add d2: | ||
+ | ... | ||
+ | update d3: | ||
+ | update d3: | ||
+ | ... | ||
+ | copy d2: | ||
+ | copy d2: | ||
+ | ... | ||
+ | move d4: | ||
+ | move d4: | ||
+ | ... | ||
+ | remove d1: | ||
+ | remove d1: | ||
+ | ... | ||
+ | 550112 equal | ||
+ | 294 added | ||
+ | 1571 removed | ||
+ | 5 updated | ||
+ | 7 moved | ||
+ | 1432 copied | ||
+ | 0 restored | ||
+ | There are differences! | ||
+ | </ | ||
+ | |||
+ | <WRAP info> | ||
+ | **NOTE: | ||
+ | |||
+ | Various changes are shown in the example above, including: | ||
+ | |||
+ | * **Add** - Some files have been added since the last sync. | ||
+ | * **Update** - Some files have been updated since the last sync. | ||
+ | * **Copy** - Some files have been copied since the last sync. | ||
+ | * **Move** - Some files have been moved since the last sync. | ||
+ | * **Remove** - Some files have been removed since the last sync. | ||
+ | |||
+ | </ | ||
+ | |||
+ | ---- | ||
+ | |||
+ | ===== Check if a fix will work ===== | ||
+ | |||
+ | <code bash> | ||
+ | snapraid check -v -m -f "/ | ||
+ | </ | ||
+ | |||
+ | returns: | ||
+ | |||
+ | < | ||
+ | Self test... | ||
+ | Loading state from / | ||
+ | 551695 files | ||
+ | 0 hardlinks | ||
+ | 0 symlinks | ||
+ | 970 empty dirs | ||
+ | Searching disk d1... | ||
+ | Excluding content '/ | ||
+ | Excluding directory '/ | ||
+ | Searching disk d2... | ||
+ | Excluding directory '/ | ||
+ | Excluding content '/ | ||
+ | ... | ||
+ | Selecting... | ||
+ | / | ||
+ | < | ||
+ | Scanning disk d1... | ||
+ | Scanning disk d2... | ||
+ | ... | ||
+ | Using 8981 MiB of memory for the file-system. | ||
+ | Initializing... | ||
+ | Selecting... | ||
+ | Checking... | ||
+ | recoverable Dir1/ | ||
+ | recoverable Dir1/ | ||
+ | recoverable Dir1/ | ||
+ | ... | ||
+ | 100% completed, 86580 MB accessed in 0:06 | ||
+ | |||
+ | 37633 errors | ||
+ | 0 unrecoverable errors | ||
+ | WARNING! There are errors! | ||
+ | </ | ||
+ | |||
+ | <WRAP info> | ||
+ | **NOTE: | ||
+ | |||
+ | * Notice that the command used does not use the absolute path, something like **/ | ||
+ | * Snapraid does not expect you to provide the absolute file system path when fixing files. | ||
+ | |||
+ | </ | ||
+ | |||
+ | ---- | ||
+ | |||
+ | ===== Restore the contents of a directory ===== | ||
+ | |||
+ | <code bash> | ||
+ | snapraid fix -m -f "/ | ||
+ | </ | ||
+ | |||
+ | returns: | ||
+ | |||
+ | < | ||
+ | Self test... | ||
+ | Loading state from / | ||
+ | Searching disk d1... | ||
+ | Searching disk d2... | ||
+ | ... | ||
+ | Selecting... | ||
+ | Scanning disk d1... | ||
+ | Scanning disk d2... | ||
+ | ... | ||
+ | Using 8981 MiB of memory for the file-system. | ||
+ | Initializing... | ||
+ | Selecting... | ||
+ | Fixing... | ||
+ | recovered Dir1/ | ||
+ | recovered Dir1/ | ||
+ | recovered Dir1/ | ||
+ | 100% completed, 86580 MB accessed in 0:06 | ||
+ | |||
+ | 37633 errors | ||
+ | 37633 recovered errors | ||
+ | 0 unrecoverable errors | ||
+ | Everything OK | ||
+ | </ | ||
+ | |||
+ | <WRAP info> | ||
+ | **NOTE: | ||
+ | |||
+ | * Notice that the command used does not use the absolute path, something like **/ | ||
+ | * Snapraid does not expect you to provide the absolute file system path when fixing files. | ||
+ | |||
+ | </ | ||
+ | |||
+ | ---- | ||
snapraid/recover_a_lost_file.1745946916.txt.gz · Last modified: 2025/04/29 17:15 by peter