timeshift icon indicating copy to clipboard operation
timeshift copied to clipboard

Consider making snapshots read-only

Open BareRose opened this issue 5 years ago • 5 comments

Is your feature request related to a problem? Please describe. Currently btrfs snapshots created by Timeshift are read-write. This causes them to grow in size when browsing through them - e.g. to restore an individual file - due to atime updates. It also makes it impossible to use them with btrfs send as that command requires read-only snapshots.

Describe the solution you'd like Simply create read-only snapshots. If I understand the code correctly, all that would be needed is to change line 1501 in Main.vala from this: string cmd = "btrfs subvolume snapshot '%s' '%s' \n".printf(src_path, dst_path); to this: string cmd = "btrfs subvolume snapshot -r '%s' '%s' \n".printf(src_path, dst_path);

Describe alternatives you've considered An alternative to address the bloat issue would be to mount /mnt/timeshift/backup with the noatime option, thus preventing atime updates. However read-only snapshots make much more sense, and appear to be standard practice for btrfs backup/snapshot utilities anyway (btrbk uses read-only snapshots, for example).

BareRose avatar Dec 16 '19 11:12 BareRose

Turns out mounting /mnt/timeshift/backup with noatime is probably a good idea eitherway as it prevents undesired atime updates to the mounted subvolumes.

A temporary workaround is to add a line for /mnt/timeshift/backup in /etc/fstab with the noatime option (and whatever desired options). Kinda dirty but does prevent unintended atime updates to both the system and snapshots.

BareRose avatar Dec 19 '19 12:12 BareRose

@teejee2008 in which situation is it desirable to have a read-write snapshot?

bobberb avatar Dec 08 '20 13:12 bobberb

@teejee2008 in which situation is it desirable to have a read-write snapshot?

As BareRose mentioned, not having it readonly prevents brtfs send for backup or copying to another disk. Additionaly, a snapshot on a given date/time should not be modified, as in this case, it does not represent the state in a point of time.

gitbjo avatar Mar 13 '22 19:03 gitbjo

Will there be any progress with this now that Linux Mint took over the gig?

ghost avatar Aug 05 '22 09:08 ghost

zfs snapshots are RO snapper snapshots are RO

A snapshot is like a photo of the filesystem at a particular point in time.

Timeshift uses RW, but in general we should not be able to alter an earlier point in history. A snapshot is a 1:1 capture of the files of a filesystem and by default it is no joy to know that the all my snapshot can be gone if something bad happens in /run/timeshift/... They are all writeable and automounted by timeshift there .....

reduakt avatar Aug 15 '22 13:08 reduakt