Site Tools


start:timeshift

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
start:timeshift [2023/08/29 19:05] peterstart:timeshift [2024/01/24 19:48] (current) peter
Line 1: Line 1:
 +DATE CHECKED THIS PAGE WAS VALID: 29/08/2023
 +
 Addendum to the guide: Addendum to the guide:
  
Line 42: Line 44:
 I wont write out the code typed in the terminal here because its more important to understand why we are doing this and what it achieves than memorizing these commands if its your first time.  I wont write out the code typed in the terminal here because its more important to understand why we are doing this and what it achieves than memorizing these commands if its your first time. 
  
-So the point is we can see that the @ subvolume does actually work as expected. If you would like to verify yourself you can check using the commands in the screenshot and hopefully understand that we can now mount subvolumes as normal disk mounts. The great thing is when we snapshot, as we will see, they become additional dated mountpoints that you can just browse and copy out files if you want. So if you have a file, edit it and then make a snapshot, then edit it again, then you can browse that subvolume for the file prior to your edits and get it back. This is very useful as you can take snapshots of your system prior to ding something, like upgrading it, and if it totally breaks just roll back. However for greatest flexibility we want the @ and @home to be separate. This way we can roll back files in our /home without changing our installed system, say if we lose a critical document by mistake, or alternatively we can roll back a bad update to our system that stops us booting without losing the contents of our /home directory. +So the point is we can see that the @ subvolume does actually work as expected. If you would like to verify yourself you can check using the commands in the screenshot and hopefully understand that we can now mount subvolumes as normal disk mounts. The great thing is when we snapshot, as we will see, they become additional dated mountpoints that you can just browse and copy out files if you want. So if you have a file, edit it and then make a snapshot, then edit it again, then you can browse that subvolume for the file prior to your edits and get it back. This is very useful as you can take snapshots of your system prior to ding something, like upgrading it, and if it totally breaks just roll back. **However for greatest flexibility we want the @ and @home to be separate.** This way we can roll back files in our /home without changing our installed system, say if we lose a critical document by mistake, or alternatively we can roll back a bad update to our system that stops us booting without losing the contents of our /home directory. 
  
 So how do we achieve this. So how do we achieve this.
Line 55: Line 57:
 Ok so follow the prompts and get a password set. Once we have one we will edit our fstab prior to actually creating our new /home. This is fine so long as we dont reboot the computer until we are ready to do so. The correct order would be to first create our subvolume then edit fstab but we are sneakily going to do it out of order and be very careful. So lets edit the fstab in nano so we can easily copy and paste and change just a couple values for our /home. Ok so follow the prompts and get a password set. Once we have one we will edit our fstab prior to actually creating our new /home. This is fine so long as we dont reboot the computer until we are ready to do so. The correct order would be to first create our subvolume then edit fstab but we are sneakily going to do it out of order and be very careful. So lets edit the fstab in nano so we can easily copy and paste and change just a couple values for our /home.
  
-You can use nano or gedit but I will use gedit for this example:+You can use nano or gedit but I will use gedit for this example (either apt-get install gedit or use nano /etc/fstab instead):
  
 <code> <code>
Line 65: Line 67:
 Well first lets make a new subvolume for @ home: Well first lets make a new subvolume for @ home:
 Now copy and paste the line that looks like this: Now copy and paste the line that looks like this:
-UUID=f0c8474c-e0dd-489a-af83-79b61e879de5 /               btrfs   defaults,compress=lzo,autodefrag,space_cache,subvol=@ 0       0+UUID=f0c8474c-e0dd-489a-af83-79b61e879de5 /               btrfs   defaults,noatime,compress=lzo,discard=async,space_cache,subvol=@ 0       0
  
-Note: ssd option for btrfs is depreciated and not used anymore. Dont forget at the beginning of the guide it mentioned using space_cache=v2 now.+Note: ssd option for btrfs is depreciated and not used anymore. Dont forget at the beginning of the guide it mentioned using space_cache now.
  
 Obviously your UUID will be different. We are looking for the line with / and subvol=@ in it. Obviously your UUID will be different. We are looking for the line with / and subvol=@ in it.
  
-Now make a copy of this line underneath it and change the / to /home and the @ to @home and click save.+Now make a copy of this line underneath it and change the / to /home and the @ to @home and click save. (You are copying a line and making 2 edits to it essentially).
  
 Example: Example:
Line 77: Line 79:
 {{:images:editfstabdeb.png|}} {{:images:editfstabdeb.png|}}
  
-Wonderful, now thats saved we will do the second step which is really the first step but we did it out of order so now its the second step.+Wonderful, now thats saved we will do the second step which is really the first step but we did it out of order so now its the second step (Can do the steps the other way around it does not matter).
  
 So log out of debian in the top right and side. Do not restart or any funny business like that, we are logging out. Once back on the login screen we will now access a terminal by pressing ctrl-alt-f4. We are now at a terminal like this: So log out of debian in the top right and side. Do not restart or any funny business like that, we are logging out. Once back on the login screen we will now access a terminal by pressing ctrl-alt-f4. We are now at a terminal like this:
Line 101: Line 103:
  
 <code> <code>
-mv /mnt/Temp/\@/home/peter /mnt/Temp/\@home/+mv /mnt/Temp/\@/home/peter /mnt/Temp/\@home/   (note debian 12 you can use format like mv /mnt/Temp/@/home/username and so on) 
 chown -R peter /mnt/Temp/\@home/peter chown -R peter /mnt/Temp/\@home/peter
 </code> </code>
Line 137: Line 140:
 That is around 20 which is fine and give you plenty to look back on. Anything else you should refer to your backup set. Another thing to note is the automatic backups per schedule wont happen if you have Timeshift open for some reason. You must leave Timeshift closed. Also, the hourly always happen on the hour, so you will need to wait for an hour to pass + whatever was remaining for the current hour. So if the time was 9:23, your first hourly backup would be at 11:00. The reboot schedule also seems to have a delay on it so if you reboot and immediately open Timeshift you wont see any snapshot. Just go get a coffee or something and leave it like 15 minutes after a reboot or check after 2 hours have passed to see auto snapshots getting made. It doesn't like being watched.  That is around 20 which is fine and give you plenty to look back on. Anything else you should refer to your backup set. Another thing to note is the automatic backups per schedule wont happen if you have Timeshift open for some reason. You must leave Timeshift closed. Also, the hourly always happen on the hour, so you will need to wait for an hour to pass + whatever was remaining for the current hour. So if the time was 9:23, your first hourly backup would be at 11:00. The reboot schedule also seems to have a delay on it so if you reboot and immediately open Timeshift you wont see any snapshot. Just go get a coffee or something and leave it like 15 minutes after a reboot or check after 2 hours have passed to see auto snapshots getting made. It doesn't like being watched. 
  
-So hit next and on the next screen you can go ahead and tick the "include @home in backups" if you want. I do, and I leave the qgroups option ticked although some people don't+So hit next and on the next screen you can go ahead and tick the "include @home in backups" if you want. I do because this will allow you to restore deleted files from your @home which is useful
  
 Once you are done selecting all your options just click finish. You can create a manual snapshot by clicking the create button as a test. Once you are done selecting all your options just click finish. You can create a manual snapshot by clicking the create button as a test.
Line 217: Line 220:
 {{:images:hoorayfixeddeb.png|}} {{:images:hoorayfixeddeb.png|}}
  
-There you go! Now you know how to run around and completely break your Linux install and never not be able to revert. You will always have a working Debian to boot into by reverting back to the time before you broke it. Now lets get on with setting up more fun an experimental stuff happy in the knowledge we cannot fail, by design.+There you go! Now you know how to run around and completely break your Linux install and never not be able to revert. **You will always have a working Debian to boot into by reverting back to the time before you broke it. Now lets get on with setting up more fun an experimental stuff happy in the knowledge we cannot fail, by design.**
  
 In the guide if things break I dont use Timeshift, instead I try to show you how to fix them so that you can learn what has happened, but we always have Timeshift to fall back on if need be. In the guide if things break I dont use Timeshift, instead I try to show you how to fix them so that you can learn what has happened, but we always have Timeshift to fall back on if need be.
Line 230: Line 233:
  
 Once you have no snapshots and no qgroups at all then snapshotting seems repaired and wont hang the system although you can get hangs if you have too many snapshots or some issue occurs with them again (typically caused by unclean shutdown etc). They are troublesome but I find they dont cause me an issue if everything is clean and nothing is orphaned etc.  Once you have no snapshots and no qgroups at all then snapshotting seems repaired and wont hang the system although you can get hangs if you have too many snapshots or some issue occurs with them again (typically caused by unclean shutdown etc). They are troublesome but I find they dont cause me an issue if everything is clean and nothing is orphaned etc. 
 +
 +Also note qgroups is an older issue that is no longer a problem (as they are disabled by Debian 12 onwards anyway). 
  
start/timeshift.1693335937.txt.gz · Last modified: 2023/08/29 19:05 by peter