Best way to recover earlier versions or lost files?

Scenario: a share that has scheduled snapshots, and is exposed over samba, with shadow copies turned on. Most clients are Windows.

What’s the best way for users to recover lost files, or earlier versions of a file?

Hi @bdarcus, if you don’t need to rollback the entire share, use win shadow copies from one client and rollback single files.
My suggestion: while doing this turn off scheduled snapshots on that share

If something goes wrong (because of WIN, not Rockstor!) don’t worry : you can rollback the entire share to latest valid :wink:

Flyer/Mirko

Thanks. But I’m not sure the latter is practical. I want to be able to give users instructions, and not have my support guy have to intervene.

Hi @bdarcus, windows shadow copies can be easily found in context menu with a right click -> “previous versions”, but pls believe me, don’t mess with shadow copies and btrfs snapshots (imagine Rockstor taking a snapshot while a big file is moving back to a previous version), or at least do it carefully (end user + some assistance by sysadmin)

Flyer

1 Like

@Flyer It’s not clear to me what the exact risk is here. The potential race condition scenario you are describing is same as if a scheduled snapshot happens while the user is editing a file. BTRFS is of course not application aware, so if you are in the middle of an edit when a snapshot is taken, the snapshot would refer to the state as of the last sync of the file to the filesystem. Your ongoing edits that are yet to be synced are part of the client state and would be synced eventually upon save. I don’t think it’s possible to corrupt the file. If I am missing something, could you please describe the scenario in detail?

Hi @suman you’re right, i didn’t explain it at all and thinking about a special case :
My user scenario was samba share with snapshots visible to end user and while moving to a previous version user deleted snapshots too, having strange behaviors over snapshots inside snapshots replicating data on a loop (can’t find my old forum post)

Flyer