Skip to content
This repository has been archived by the owner on Oct 16, 2022. It is now read-only.

Timeshift not unmounting destination after snapshot complete #809

Closed
Andy2051 opened this issue Oct 5, 2021 · 10 comments
Closed

Timeshift not unmounting destination after snapshot complete #809

Andy2051 opened this issue Oct 5, 2021 · 10 comments

Comments

@Andy2051
Copy link

Andy2051 commented Oct 5, 2021

Even if the destination partition is already mounted, timeshift insists on mounting it again at /run/timeshift/backup. The problem is that when the snapshot has completed timeshift does not unmount /run/timeshift/backup. This can cause problems elsewhere in the system.

More details here:
https://forums.linuxmint.com/viewtopic.php?p=2076784#p2076784
https://forums.linuxmint.com/viewtopic.php?f=47&t=346310&p=1995402&hilit=timeshift#p1995402
EDIT - clicking on the links doesn't work, but copy/paste into your browser does?

I have my snapshot partition mounted via fstab at /media/ultrabay. It shows up in the output from df. If I check the mountpoint with lsblk -nio mountpoint /dev/sdc2 it shows up as /run/timeshift/backup. If I then unmount /media/ultrabay via nemo (running LM20.2 cinnamon) it doesn't show up in df and rerunning lsblk shows that /run/timeshift/backup has also been unmounted.

At the time I did the above it was at least five hours since the snapshot was taken and completed, sdc2 was still mounted at /run/timeshift/backup.

@nandlab
Copy link

nandlab commented Oct 5, 2021

I have the same problem.

I use timeshift for system backups on Linux Mint and it generally works pretty well.

But the behavior, that timeshift does not unmount the target device at the end, is really annoying.

I use an external usb hard drive for backups. I plug it in, run timeshift and when it finishes, I would like to safely remove the drive. But when I click safely remove in the file manager, it errors because /dev/sdb1 is still mounted to /run/timeshift/backup.

So I have to open the terminal and manually type:
sudo umount /dev/sdb1 && sudo disksctl power-off -b /dev/sdb
Only then I can detach the usb cable.

This is definitely not the expected usage for the end user!!

I would really appreciate, if the target device is either

  • unmounted automatically if you close the timeshift window
  • or there is a button to unmount (and maybe also mount) it manually

Please add this essential functionality :)

@FlailAway
Copy link

* unmounted automatically if you close the timeshift window

Why not run Timeshift in a BASH script that unmounts on successful completion of the backup.?

@nandlab
Copy link

nandlab commented Oct 8, 2021

Of course you can write a bash script for anything. But isn't it the responsibility of the program to clean its own mess?

@Andy2051
Copy link
Author

Andy2051 commented Oct 8, 2021

Yes you could run a bash script, but I have timeshift setup to automatically take a snapshot every day. I'd have to develop the script to run either as a cron or anacron job and this is functionality that is built into timeshift, it should work properly. I develop linux backup software (foxclone) and my premise is that you must leave the system in the same state you found it. So if you need to mount partitions, whenever you have done what you want, you need to unmount them. This is what foxclone does, if a partition is already mounted, it uses the mountpoint; if not it mounts it. When it is finished, if it had to mount the partition, it unmounts it. If it was already mounted, it makes sure that it is still mounted at the original mountpoint.

While I can sort of see why timeshift insists on mounting the destination, it is not difficult to check to see if the destination is already mounted and if so, then use the existing mountpoint. If timeshift wants to mount the destination separately in a different location then it SHOULD unmount it when finished.

@nandlab
Copy link

nandlab commented Oct 8, 2021

On Linux Mint, if I plug in the external drive, it is mounted to /media/<user>/<device> automatically. So, as @Andy2051 said, timeshift could also use this standard mountpoint.

@CoRoe
Copy link

CoRoe commented Oct 19, 2021

I also think that this should be fixed.

@cebas
Copy link

cebas commented Mar 27, 2022

I'm also annoyed by this behaviour. Please, fix it.

@gimplyworxs
Copy link

gimplyworxs commented Mar 27, 2022

Same here.
It's not only that Timeshift mounts for writing the backups. And doen't unmount.
It also mounts for its hourly check if a backup is to be written.And leaves it mounted!
Really annoying. Please fix.
(Linux Mint 20, MATE)

teejee2008 added a commit that referenced this issue May 28, 2022
… Timeshift before exit

Any devices that Timeshift needs to mount will be mounted under /run/timeshift/<pid> and unmounted on application exit
@Andy2051
Copy link
Author

Thank you.

@cebas
Copy link

cebas commented May 31, 2022

Tested with a manual run and working fine. Thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants