Undelete on OMV7

  • I've accidentally deleted (through SMB) new video file which I didn't backup yet.
    I didn't save anything on that drive since then, but all tries to un-delete it failed.

    I tried testdisk - it didn't display any deleted file in the folder where file was located.
    I tried ext4magic - said it can't find any inode.
    I tried extundelete - displayed nothing that could be undeleted.
    I tried photorec - it started restoring hundred thousands of files, and predicted 32hours of work - I stopped it because I can't block my NAS for that long.

    Regardless the situation with my file, I've found that maybe OMV is not really prepared for undeleting data?

    In the past I was using Synology (or rather XPnology) and there was an option that everything deleted by any SMB user, was actually going to Trash folder.

    My question is - how OMV is prepared for situation when something was accidentally deleted? is there any recovery function? Option? Plugin?
    Or just tools mentioned above must be used?
    And why my deleted files were not listed by above tools ?
    Today I've deleted probably ten big files (one incorrectly) - and none of deleted files was found.

    Thanks

  • amikot

    Changed the title of the thread from “Undelete on OMV6” to “Undelete on OMV7”.
  • SnapRAID can recover deleted files so long as the files were present on the last sync.

    --
    Google is your friend and Bob's your uncle!


    OMV AMD64 7.x on headless Chenbro NR12000 1U 1x 8m Quad Core E3-1220 3.1GHz 32GB ECC RAM.

  • I have snapraid installed, but I don't know how it works. and if it works at all.
    I've configured it somehow as found some tutorial, and I know sync is happening during night time.
    However I don't know how it works - how it determine what is difference between corrupted file and when it was changed for purpose.
    I see it as something that exists, but I don't feel it is really reliable - mainly because I don't see it working.
    There is no proper monitoring software - no gui, no webui, no even tool that would display something human readable information.

    Problem with programs that have no interface is that you have to type everything manually.
    I guessing that snapraid undelete feature will expect me to specify exact name of the file to undelete. I guess it won't display any selector where I could be able to choose which file to undelete?

    BTW. I've found that photorec has options where I can set what file types I want to scan for and now scanning the drive - it shows only 8 hours remaining - not too bad.

    • Official Post

    However I don't know how it works - how it determine what is difference between corrupted file and when it was changed for purpose.
    I see it as something that exists, but I don't feel it is really reliable - mainly because I don't see it working.
    There is no proper monitoring software - no gui, no webui, no even tool that would display something human readable information.

    Problem with programs that have no interface is that you have to type everything manually.
    I guessing that snapraid undelete feature will expect me to specify exact name of the file to undelete. I guess it won't display any selector where I could be able to choose which file to undelete?

    Isn't the snapraid plugin a web interface? What would "display" is the plugin missing? The plugin has a status button to show you info just like regular raid.


    Have you read the snapraid manual to understand how it works? Calling it unreliable because you don't know how snapraid works seems a bit strange.


    If you read the manual, you will find the "Undeleting" section that uses the "fix" command. The plugin has a Undelete menu option that will restore all deleted files. If you only want to undelete select files, you will have to do that from the command line but the manual makes it pretty easy.

    omv 7.5.0-1 sandworm | 64 bit | 6.11 proxmox kernel

    plugins :: omvextrasorg 7.0 | kvm 7.0.15 | compose 7.3.2 | cputemp 7.0.2 | mergerfs 7.0.5 | scripts 7.0.9


    omv-extras.org plugins source code and issue tracker - github - changelogs


    Please try ctrl-shift-R and read this before posting a question.

    Please put your OMV system details in your signature.
    Please don't PM for support... Too many PMs!

  • I will check "recycle bin" in the SMB settings.

    In terms of the Snap Raid - I understand how it works - in terms of structure and how it syncs.
    I don't understand how it works when something happen. How and when it detects corruption?

    I understand it is not automatic - so the actions need to be triggered. So it differs from normal raid - in normal raid you don't need to do anything - you can even set some spare disks that will be used for replication in case of failure of one of drives.
    In snapraid you go to plugins settings and you don't know what is what - options like: Spin for example?

    What means the Info/Status:


    This plugin looks like someone made it just for himsef - to automate some actions that are obvious for him - no desctiptoons no help texts etc.

    I understand - it is right for programmer to make software as he want's but why I should pretend it is great and intuitive and simple.
    It's not. 8o

    For example - I've found option to undelete - okay - maybe I Will be able to see the files and undelete what I Want. :?:

    Instead of that - some scanning started. Great ! no even asking if I want to proceed. No option to abort - who knows what will happen now ? I don't know :D

  • Okay - I know what snapraid undelete has done - big mess, and overwritten blocks that I could restore from.

    Why there is no any confirmation needed before it starts messing the drive?

    • Official Post

    I understand it is not automatic - so the actions need to be triggered. So it differs from normal raid - in normal raid you don't need to do anything -

    Actually, that is wrong. If you delete a file on regular raid, it is gone. That is why snapraid is a hybrid of raid and backup.

    In snapraid you go to plugins settings and you don't know what is what - options like: Spin for example?

    I named them after what is described in the manual. Spin just spins the drives up or down. Look at 5.3 and 5.4 in the manual.

    This plugin looks like someone made it just for himsef - to automate some actions that are obvious for him - no desctiptoons no help texts etc.

    Odd since I wrote it and don't use snapraid. I did my best to help people but obviously I did a shitty job. Feel free to contribute to make it better.

    The plugin should not be the source of documentation. Do you see tons of documentation in any other plugin? People who are good at writing docs for noobs (I am not)( should write a plugin specific guide (there is one in the works - https://wiki.omv-extras.org/do…id=docs_in_draft:snapraid) but the snapraid manual does a pretty good job..


    I understand - it is right for programmer to make software as he want's but why I should pretend it is great and intuitive and simple.
    It's not.

    That was my goal. To make the plugin as hard to use as possible.... I recommend not using any of the omv-extras plugins then

    For example - I've found option to undelete - okay - maybe I Will be able to see the files and undelete what I Want.

    I don't have a good way to do that in a plugin. There is no gui component to enumerate files.

    Instead of that - some scanning started. Great ! no even asking if I want to proceed. No option to abort - who knows what will happen now ? I don't know

    People complain when there are too many confirmations and not enough. Can't win.


    Okay - I know what snapraid undelete has done - big mess, and overwritten blocks that I could restore from.

    Why there is no any confirmation needed before it starts messing the drive?

    Would you have not click the confirmation too? I don't see how that would've helped. How did it make a mess? It is literally running snapraid fix -m.

    omv 7.5.0-1 sandworm | 64 bit | 6.11 proxmox kernel

    plugins :: omvextrasorg 7.0 | kvm 7.0.15 | compose 7.3.2 | cputemp 7.0.2 | mergerfs 7.0.5 | scripts 7.0.9


    omv-extras.org plugins source code and issue tracker - github - changelogs


    Please try ctrl-shift-R and read this before posting a question.

    Please put your OMV system details in your signature.
    Please don't PM for support... Too many PMs!

  • I don't say you have done shitty job - you have done job from perspective of your knowledge not thinking to make it obvious for someone who is just simple user.
    This is how people make software in most cases - they think about functions, but not about making software intuitive.
    ---
    Nice you telling me do do plugins myself, but as I remember OMV uses some asp or some framework I don't know. I program in pure php or sometimes java - which is not very useful for OMV.
    However, I make software for people who sometimes don't know too much about computers, and I have to think the way they think. That's why when I see programs that expect everyone read manuals - I don't really like them - I'm trying to make my programs simple and would like others to do the same.
    If I would have to read and remember manual of every software I use, I would have no time to read anything else - especially that I have rather weak memory, and probably after few next manuals I would forget the previous.

    I don't say you're making your plugin difficult for purpose - maybe you just can't imagine how it is to not know things that are obvious for you.
    ----
    No I was not asked to confirm if I want to restore found files - Just clicked undelete in your plugin, and it started restoring. It restored everything I deleted ages ago - how it's possible is sync was done last night? Should be because I've set it to be done every night when I was setting up snapraid.

    I'm not sure if it didn't also overwrite those files that were modified since last sync. If yes, it made even more problems than just mess :(

    • Official Post

    I don't say you have done shitty job - you have done job from perspective of your knowledge not thinking to make it obvious for someone who is just simple user.
    This is how people make software in most cases - they think about functions, but not about making software intuitive.

    You basically did. You may think I didn't try to make it usable to a simple user but I am limited by how snapraid works and how the OMV framework is. snapraid is not simple. I cannot make it simple. Could the plugin be a little simpler? Maybe but you forget that not every OMV plugin has to be simple. Advanced users want flexiblity and with flexibility comes an increase in complexity.


    Nice you telling me do do plugins myself, but as I remember OMV uses some asp or some framework I don't know. I program in pure php or sometimes java - which is not very useful for OMV

    I didn't tell you to do plugins yourself. I said contribute. Big difference. 40% of the snapraid plugin is php. If you are php programmer, you should at least tell me how to make the plugin better rather than just saying it is unintuitive and works badly.

    However, I make software for people who sometimes don't know too much about computers, and I have to think the way they think. That's why when I see programs that expect everyone read manuals - I don't really like them - I'm trying to make my programs simple and would like others to do the same.

    Many OMV users know nothing about the Linux command line. With plugins, they can just click buttons. That is pretty good from my point of view. Some of the plugins have a ton of automation behind the button. You may not think I am making things simple but that is wrong. Maybe it isn't simple enough but some things will always be complicated.


    The UX of the snapraid plugin would be HORRIBLE if it had enough information that you didn't need to read the manual. Snapraid is complicated and requires reading the manual. I would not use snapraid if you don't like manuals.

    If I would have to read and remember manual of every software I use, I would have no time to read anything else - especially that I have rather weak memory, and probably after few next manuals I would forget the previous.

    I write automation for a living and have to figure out how things work. I read lots of manuals. If I had to rely on other people to help me with everything, I would be out of a job.


    I don't say you're making your plugin difficult for purpose - maybe you just can't imagine how it is to not know things that are obvious for you.

    Since I don't use snapraid, I wrote the plugin by reading the manual. Because of that, I don't have extensive experience on how to make day to day functions easier. I rely on people to help with that. Since no one does, you get what you get.


    No I was not asked to confirm if I want to restore found files - Just clicked undelete in your plugin, and it started restoring.

    I can't make the plugin commands interactive. It is not possible with the OMV framework (or many web interfaces). You will have to use the command line if you want that. Nothing I can do about that.

    omv 7.5.0-1 sandworm | 64 bit | 6.11 proxmox kernel

    plugins :: omvextrasorg 7.0 | kvm 7.0.15 | compose 7.3.2 | cputemp 7.0.2 | mergerfs 7.0.5 | scripts 7.0.9


    omv-extras.org plugins source code and issue tracker - github - changelogs


    Please try ctrl-shift-R and read this before posting a question.

    Please put your OMV system details in your signature.
    Please don't PM for support... Too many PMs!

  • Okay, understand.

    I can advice you to do two small modifications - if you have time and will of course.

    1. I would change "Undelete" to "undelete all" - that will be clearer.

    2. I don't know if OMV web framework let you to open prompt window before you open command window, but if it's possible, you could ask user to pass filter, than you could run snapraid fix -m -f PATTERN which would undelete only those files that are matching the pattern (pattern can contain wildcards * and ?) - I would make it as separate option in the menu " undelete files".


    Going back to the problem with snapraid itself (not the plugin) - I've just looked into the manual and it is very unclear in terms of maintenance.
    There is diff command which makes the list of files with modified timestamps, and there is sync which makes actual snapshot/backup to parity disc.
    There is also scrub command which fixes hidden corruption.

    I couldn't find any information what should be procedure. You have made "scheduled diff" menu - which runs diff command, but diff is only to create list of modified files - that states manual - it's not syncing anything yet, so it looks sync should be executed afterwards. So I guess this is another modification I could suggest - to run "scheduled sync" just after "scheduled diff" (if it doesn't work that way already).

    There is also question of scrubbing. Manual says it should be proceeded on synced drives only.
    But won't syncing inject hidden corruption into parity data making whole scrub pointless? Or maybe sync is only syncing those files that were found with diff ? However - if manual says to scrub only if drives are synced, shouldn't "scheduled scrub" sync drives before scrubbing?

    And once again - I really don't say your plugin is shitty - it is rather snapraid which runs commands weird way. For example if you use fsck - you have to use -y parameter otherwise you will be prompted for confirmation on every occasion, but in snapraid everything is assumed user really perfectly know what he is doing - this is really danger because I don't think there is anyone who is that confident with handling RAID arrays - maybe people in data centers only. Everyone else is looking into forums, manuals for advice and trying - and making mistakes unfortunately.

    • Official Post

    2. I don't know if OMV web framework let you to open prompt window before you open command window, but if it's possible, you could ask user to pass filter, than you could run snapraid fix -m -f PATTERN which would undelete only those files that are matching the pattern (pattern can contain wildcards * and ?) - I would make it as separate option in the menu " undelete files".

    Yep, I would've added that if I could. I even added the code a long time ago hoping I could figure out a way to do it - https://github.com/OpenMediaVa…ned/rpc/snapraid.inc#L471. I mean technically it can be done but I couldn't show any output.

    Going back to the problem with snapraid itself (not the plugin) - I've just looked into the manual and it is very unclear in terms of maintenance.
    There is diff command which makes the list of files with modified timestamps, and there is sync which makes actual snapshot/backup to parity disc.
    There is also scrub command which fixes hidden corruption.

    I couldn't find any information what should be procedure. You have made "scheduled diff" menu - which runs diff command, but diff is only to create list of modified files - that states manual - it's not syncing anything yet, so it looks sync should be executed afterwards. So I guess this is another modification I could suggest - to run "scheduled sync" just after "scheduled diff" (if it doesn't work that way already).

    There is also question of scrubbing. Manual says it should be proceeded on synced drives only.
    But won't syncing inject hidden corruption into parity data making whole scrub pointless? Or maybe sync is only syncing those files that were found with diff ? However - if manual says to scrub only if drives are synced, shouldn't "scheduled scrub" sync drives before scrubbing?

    The scheduled diff command is actually running a script (not written by me) that does more than just diff. https://github.com/OpenMediaVa…sr/sbin/omv-snapraid-diff


    And once again - I really don't say your plugin is shitty - it is rather snapraid which runs commands weird way. For example if you use fsck - you have to use -y parameter otherwise you will be prompted for confirmation on every occasion, but in snapraid everything is assumed user really perfectly know what he is doing

    To do that, I would have to double the number of commands in the plugin. But that would also assume that snapraid has a test/pretend/no action flag for the commands. snapraid fix for example has no flag to that would cause it to show you want it would do. In fact, I don't think any of them do. You continue to blame the plugin and want it to work like other things in Linux do. But I can't do that if snapraid doesn't allow me to. In the 11+ years the plugin has existed, you have had far more issues with it than anyone else.

    this is really danger because I don't think there is anyone who is that confident with handling RAID arrays - maybe people in data centers only. Everyone else is looking into forums, manuals for advice and trying - and making mistakes unfortunately.

    The real danger is people using raid for backup. raid is meant for availability/redundancy. If a user has backup, running snapraid commands would be far less dangerous.

    omv 7.5.0-1 sandworm | 64 bit | 6.11 proxmox kernel

    plugins :: omvextrasorg 7.0 | kvm 7.0.15 | compose 7.3.2 | cputemp 7.0.2 | mergerfs 7.0.5 | scripts 7.0.9


    omv-extras.org plugins source code and issue tracker - github - changelogs


    Please try ctrl-shift-R and read this before posting a question.

    Please put your OMV system details in your signature.
    Please don't PM for support... Too many PMs!

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!