linuxmint / timeshift

System restore tool for Linux. Creates filesystem snapshots using rsync+hardlinks, or BTRFS snapshots. Supports scheduled snapshots, multiple backup levels, and exclude filters. Snapshots can be restored while system is running or from Live CD/USB.
2.52k stars 91 forks source link

Changing partition for /home and /boot deletes the entire installation #362

Open ShadowOfTheDark669 opened 3 weeks ago

ShadowOfTheDark669 commented 3 weeks ago

Bug In the process of restoring a snapshot, if the root partition(empty) is MANUALLY selected for the /home and /boot directories instead of the Keep on root device option, then timeshift indeed restores the snapshot but deletes all the restored files followed by a Snapshot restored with errors popup. It attempts to mount /home and /boot both at / and deletes everything to do so, causing errors and an unrecoverable system. Checking with a file manager upon restore also ensures that the entire installation is deleted barring a few EMPTY folders.

To Reproduce Steps to reproduce the behavior:

  1. Select a snapshot and click restore
  2. Select the root partition, then for the /home and /boot directories, which have Keep on root device by default, select the desired partition for root manually. Continue with the rest of the menus normally.
  3. Timeshift restores as expected but at the end of restoring, no of restored files is matched/exceeded to the no of deleted files.
  4. Snapshot restored with errors popup appears.

Expected behavior Timeshift restores the snapshots normally. Screenshots

Screenshot_20241101_171157 Screenshot_20241101_171414 Screenshot_20241101_171812

System:

Comments Timeshift should atleast warn at the selection screen of this behaviour, or change the default behaviour to mount /boot and /home at / for the afore mentioned configuration instead of deleting everything. The only extremely subtle hint is at the second last conformation screen before restore.

zahlman commented 1 week ago

When you select a partition for the /home and /boot folders, you are asking for them to be restored at the root of the selected partition. "Keep on root partition" is a special case - the data goes to a subfolder on the partition where / is restored, i.e. is not configured for separate mounting.

Generally the UI should warn about, or prevent, restoring more than one of {/, /boot, /home} to the same partition, yes. I don't think it makes sense to do special cases instead - a user who wants /home data on the / partition can just re-select "Keep on root device".

ShadowOfTheDark669 commented 1 week ago

When you select a partition for the /home and /boot folders, you are asking for them to be restored at the root of the selected partition. "Keep on root partition" is a special case - the data goes to a subfolder on the partition where / is restored, i.e. is not configured for separate mounting.

Generally the UI should warn about, or prevent, restoring more than one of {/, /boot, /home} to the same partition, yes. I don't think it makes sense to do special cases instead - a user who wants /home data on the / partition can just re-select "Keep on root device".

Yep, I think warning or preventing such restore is better than the special case which I expressed in my post.