LGM-OS
documentation

Going back when something goes wrong, without taking data off the machine.

Snapshots

A snapshot is a picture of how a folder looked at a given moment. It takes a second, costs almost nothing at first, and lets you go back when something goes wrong: a file deleted by mistake, a folder someone overwrote from their phone, files encrypted by ransomware.

They are managed entirely from the panel, under Storage → Snapshots. Nothing here needs the terminal.

They are not a backup. They live on the same disks as your data: if the machine burns or the disks fail, they go with them. That is what backups are for — getting the data out of the machine. The two complement each other and neither replaces the other.

First things first: what restoring does

It is the question everyone asks, and it is worth being clear on it before pressing the button.

Restoring leaves the folder exactly as it was in the snapshot. Exactly means exactly:

  • A file you deleted comes back.
  • A file you changed goes back to how it was then.
  • A file you created after the snapshot disappears.

That last one is the surprise. If you snapshot on Monday, copy holiday.jpg into that folder on Tuesday, and restore Monday's snapshot on Wednesday, holiday.jpg is gone — on Monday it did not exist. That is not a bug; it is what "go back to Monday" means.

Nothing is lost even if you get it wrong. Right before restoring, the panel takes a snapshot of how the folder is at that moment and names it antes-de-restaurar-… with the date. If the holiday.jpg thing happens to you, restore that one and you have it back. You will see it in the list alongside the others.


Restoring, step by step

  1. Storage → Snapshots.
  2. Pick the snapshot by its date.
  3. Restore.
  4. Tick which folders you want back. Nothing is ticked by default, on purpose: restoring is an operation that deletes things, and it should not happen by clicking through without looking. There is a Select all at the top if you really do want the whole volume.
  5. Confirm.

While it works you get a progress bar naming the folder being restored. A large folder on spinning disks can take hours; you can keep using the NAS meanwhile, but do not touch that folder until it finishes.

If something cannot be restored, it says so

It neither stays quiet nor pretends it worked:

  • A folder that is now a volume of its own (a ZFS dataset or a Btrfs subvolume) is not restored, and you are told which. Snapshots do not reach inside those: the folder would look empty inside the snapshot, and restoring "what is inside" would have wiped its real contents. If you need to roll one of those back, restore its own snapshot.
  • If it does not fit, it stops before starting and explains, instead of filling your disk halfway through.
  • If one folder fails, the rest carry on and you are told at the end which failed and why.

When they are created

Two ways:

  • Automatically, from Scheduled tasks: pick the volume, how often, and how many to keep. They are named auto- plus the date.
  • By hand, with the button, before doing something that makes you nervous — updating an app, reorganising folders, letting someone else near the NAS.

How many to keep

The retention on scheduled tasks deletes the oldest and keeps the newest N. A reasonable starting point for home use: one a day, keeping seven. That gives you a week of going back.

Bear in mind that a snapshot starts costing nothing but grows as you change your data: it holds what is no longer in today's version. Many snapshots of data that changes a lot do add up. The panel warns you as the volume fills.

Three details you may not expect:

  • Retention only touches the `auto-` ones. The ones you took by hand, and the antes-de-restaurar-… ones, stay until you delete them.
  • You can lock a snapshot so retention never takes it: handy before a migration or a big change.
  • A snapshot currently being restored from cannot be deleted by anyone, retention included: it finishes first.

Recovering a single file

Restoring a whole folder to get one file back is overkill — you would take out everything else that changed since. For a single file:

  1. Check the recycle bin first (Files → Recycle bin). Anything deleted from the panel, over SMB or from Windows goes through it, and putting it back is instant and touches nothing else.
  2. If it is not there, restore the snapshot into an empty shared folder created for the occasion, take the file you want, and delete that folder.

When someone encrypts your files

This is what they are best at. Ransomware encrypts what it can write to, and a snapshot already taken cannot be modified: the encryption does not touch it.

If it happens: disconnect the machine from the network, look at the snapshot list, and restore the last one from before the encryption. The ransomware guide has the full procedure, including what to check before reconnecting anything.


Questions that always come up

Do they take much space? Nothing when created. They grow with whatever you change: they hold what is no longer in today's version. If your data barely changes, seven snapshots can be a few megabytes.

Can I look inside one without restoring it? Yes — restore it into an empty shared folder, as in "recovering a single file". That way you can compare without touching what you have now.

What if I restore the wrong snapshot? Restore the antes-de-restaurar-… one that was created automatically just before. You are back where you started.

Do they slow the NAS down? Creating them, no: it is a second. Restoring does real work, because it copies files.

Do they help if a disk fails? No. They are on the same disks. That is what RAID is for (surviving one disk failing) and backups (getting the data out of the machine). Snapshots, RAID and backups are three different things and you want all three.