• We did not send an email asking for donations - please read this post.

Timeshift & Similar Solutions - Safeguard & Recover Your Linux



Iacceptthelinuxchallenge

Gold Member
Gold Supporter
Joined
May 18, 2021
Messages
43
Reaction score
12
Credits
446
So, I have one more question (AND YOU'RE THE MAN on this subject!!!).
So by choosing both of the "including all" options in the user home directories screen of TS , not only will I be saving everything I myself have added to the OS, but also the apps I've added?
 
OP
wizardfromoz

wizardfromoz

Administrator
Staff member
Gold Supporter
Joined
Apr 30, 2017
Messages
7,790
Reaction score
6,615
Credits
28,677
Yes.

If you are running a manual (On Demand) snapshot, be sure to make use of the Comments field to describe what is being added or removed, for easy identification, should you need to reverse the changes.

Since v19.1 of Timeshift (now on 21.9), if you enter a comment, it will exclude that snapshot from any pre-determined culling period set.

Wizard
 

Iacceptthelinuxchallenge

Gold Member
Gold Supporter
Joined
May 18, 2021
Messages
43
Reaction score
12
Credits
446
Yes.

If you are running a manual (On Demand) snapshot, be sure to make use of the Comments field to describe what is being added or removed, for easy identification, should you need to reverse the changes.

Since v19.1 of Timeshift (now on 21.9), if you enter a comment, it will exclude that snapshot from any pre-determined culling period set.

Wizard
THANKS DUDE!!! So, the comment is only necessary if say I am testing out an app, but not sure I want to keep it? Hope you have a GREAT day...I going to ;)
 

zfigz

New Member
Joined
Aug 4, 2022
Messages
18
Reaction score
5
Credits
190
oh my, am i glad i found this thread. i have been looking for an answer to this, https://www.linux.org/threads/can-timeshift-be-used-on-fresh-install-to-avoid-cloning.39254/, for over a year.

currently my strategy is to make a clone using clonezilla and then restore from that and then again from a recent timeshift snapshot, but i really wanna simplify this whereby i store my timeshift snapshots remotely using borgbackup (i currently have a couple of cronjobs for backing up some external drives and a silly one that does a system backup, but i tried restoring from that and i think it would make a lot more sense to simply store timeshift backups) and then let's say my house burns down or my computer is stolen i can easily and quickly restore straight from the timeshift snapshot.

i've come across a lot of info, such as this https://unix.stackexchange.com/questions/580379/timeshift-trouble/, but the steps are never outlined that well.

i'm running pop!_os which uses systemd to boot and not grub, but i don't think that really matters. anyhoo, afaik you would do something like the following:

1) do a fresh install
2) replace the snapshot's /etc/fstab and /etc/crypttab with the new ones created with the fresh boot (new uuids etc) or edit them
3) replace /boot and /boot/efi with the new ones as well
4) then restore via timeshift (disabling grub options via the advanced settings since pop!_os doesn't use grub)

but i seem to always trip up somewhere. if i can't get this to work, then i may just do a clonezilla image clone, store that via borgbackup, and then if that terrible day comes when i lose my computer i would pull down the clonezilla image, restore, pull down the timeshift snapshops, and again restore. i'm certain this would work, but i would much rather only have to pull the timeshift snapshots and be able to restore straight from those. i actually bought my son a laptop just so that i could test my backups out first and i've been struggling to make any progress as he awaits me to put his new computer in his room.

could someone outline what they do so i can give it a go here?

thank you
 
Last edited:
OP
wizardfromoz

wizardfromoz

Administrator
Staff member
Gold Supporter
Joined
Apr 30, 2017
Messages
7,790
Reaction score
6,615
Credits
28,677
Don't thank me yet, lol. What a curly one. And welcome to linux.org :)

Just a tip, until you have 5 - 6 posts under your belt, posting a link (even quoting someone else) will bring you across Staff's desks for approval. I just approved your Post.

I note you also have this at Stack Exchange, and they did not answer after 9 months, rather sad performance.

https://unix.stackexchange.com/ques...-encrypted-disk-from-a-fresh-live-usb-install

and also the one at Reddit

https://www.reddit.com/r/pop_os/comments/qbox05
I may not be much help to you, as I have just recently
  1. Removed my Pop!_OS from my stable of 75 Linux (it was 20.04), and
  2. I have never used encryption
...but i seem to always trip up somewhere.

Maybe you can clarify that a little so we can see what may have gone wrong.

Cheers

Chris Turner
wizardfromoz
 

gvisoc

Well-Known Member
Joined
May 29, 2020
Messages
446
Reaction score
535
Credits
4,570
...

1) do a fresh install
2) replace the snapshot's /etc/fstab and /etc/crypttab with the new ones created with the fresh boot (new uuids etc) or edit them
3) replace /boot and /boot/efi with the new ones as well
4) then restore via timeshift (disabling grub options via the advanced settings since pop!_os doesn't use grub)

but i seem to always trip up somewhere.

I am so divided with this strategy!

The good side --> your noble goal it's almost like the "corporate process of creating a standard image" and then burn it into the laptops in a more or less semi-automated way. I wish I could do that, too. I want to do that, too.
The bad side --> I don't think the tools you're trying to use (backup tools) are the right hammer for that nail due to things you're pointing out yourself: disk encryption, filesystem UUIDs, and all those things that are effectively coupling a backup to its machine, very tightly.

So here's the thing I would like to have time to try that may give you some alternative ideas:
  1. I came across this guy on GitHub who has a set of ansible playbooks and scripts that can provision his tools and applications of choice over a fresh installation: https://github.com/brpaz/my-linux-setup.
  2. Combining the above with a userhome backup like deja-dup we may achieve that semi-automated laptop set up over a fresh installation.
If you want, and to not derail this thread, we can take this reply back to your original thread and continue from there.
 

Condobloke

Well-Known Member
Joined
Apr 30, 2017
Messages
5,135
Reaction score
4,314
Credits
30,232
Just to show how little I know......does pop os have Gnome Discs ?.....(Linux Mint has it......which is why I ask)

If indeed pop os has gnome discs a clone can be taken using that.

Would that get rid of some of the complications you are facing ?
 
OP
wizardfromoz

wizardfromoz

Administrator
Staff member
Gold Supporter
Joined
Apr 30, 2017
Messages
7,790
Reaction score
6,615
Credits
28,677

Condobloke

Well-Known Member
Joined
Apr 30, 2017
Messages
5,135
Reaction score
4,314
Credits
30,232
There are more ways of killing a cat than choking it with butter...!
 
OP
wizardfromoz

wizardfromoz

Administrator
Staff member
Gold Supporter
Joined
Apr 30, 2017
Messages
7,790
Reaction score
6,615
Credits
28,677
If you want, and to not derail this thread,....

Gabe, do you mean his Stack Exchange or Reddit Thread? He has no original Thread here, but the questions asked are OK here, even if focused on Clonezilla, as my Subject Title includes "& Similar Solutions".

Cheers

Wiz
 

zfigz

New Member
Joined
Aug 4, 2022
Messages
18
Reaction score
5
Credits
190
I am so divided with this strategy!

The good side --> your noble goal it's almost like the "corporate process of creating a standard image" and then burn it into the laptops in a more or less semi-automated way. I wish I could do that, too. I want to do that, too.
The bad side --> I don't think the tools you're trying to use (backup tools) are the right hammer for that nail due to things you're pointing out yourself: disk encryption, filesystem UUIDs, and all those things that are effectively coupling a backup to its machine, very tightly.

So here's the thing I would like to have time to try that may give you some alternative ideas:
  1. I came across this guy on GitHub who has a set of ansible playbooks and scripts that can provision his tools and applications of choice over a fresh installation: https://github.com/brpaz/my-linux-setup.
  2. Combining the above with a userhome backup like deja-dup we may achieve that semi-automated laptop set up over a fresh installation.
If you want, and to not derail this thread, we can take this reply back to your original thread and continue from there.
this isn't a terrible idea, but i really wanna just have a one and done approach whereby this requires a lot of extra lift with having to document all my apps etc. i've used ansible before for work, but yeah, i again, i want this to be a quick one off without having to do too much config. thanks for the idea tho.

Just to show how little I know......does pop os have Gnome Discs ?.....(Linux Mint has it......which is why I ask)

If indeed pop os has gnome discs a clone can be taken using that.

Would that get rid of some of the complications you are facing ?
ou, thanks for the heads up. i'll give this a go to see if it works or not.

Maybe you can clarify that a little so we can see what may have gone wrong.
well, i got back into this a few days ago and have made progress whereby i was able to actually boot, but after running update-initramfs (once i was booted into the old snapshot) it borked it again. sadly, i have not been taking notes through my experiments, but i started from scratch last night and this is where i'm at.

with this attempt i:
  1. fresh install
  2. installed timeshift / created snapshot of new system
  3. moved /etc/fstab, /etc/crypttab and /boot/ out of the old snapshot (the one i want to restore from) into the localhost directory as well as updated the UUID for the info.json file
  4. moved /etc/fstab, /etc/crypttab and /boot/ from the new snapshot to the old snapshot
  5. restored with grub options off and update-initramfs off
  6. and this is what happened / a number of errors were reported and then while booting it tried to get into maintenance mode but just continued in a forever loop.
my next attempt will be the same above, but instead of moving stuff around, i'm going to just edit the following to match the new snapshot:
- /etc/fstab
- /etc/crypttab
- info.json (tho pretty sure this is just for documentation purposes).

then i'll again disable grub options, but this time enable the update-initramfs option. we'll see
 

Attachments

  • PXL_20220804_114902424.jpg
    PXL_20220804_114902424.jpg
    3.7 MB · Views: 57
Last edited:

zfigz

New Member
Joined
Aug 4, 2022
Messages
18
Reaction score
5
Credits
190
well hot damn!
it booted (didn't see boot errors either), but it looks like there's some /boot/EFI inception going on as well as some sudo voodoo.

but i think i'm oh so very close to getting this working

ps i did choose the /boot partition (tho i think it really is the /boot/efi partition, but for whatever reason timeshift shows just /boot/) and not "Keep on Root Device"

pss i'll wait for y'all's insight before proceeding any further.

psss and to clarify, i did not copy over my home dir because i don't have all day to wait (my initial mistake when testing). so i'm gonna go ahead and restore my home directory which should provide me sudo perms again. then i was going to try to:
  1. sudo apt install --reinstall linux-generic linux-headers-generic
  2. sudo update-initramfs -c -k all
^ and hopefully that'll resolve the boot inception issues...or not

¯\_(ツ)_/¯​

 

Attachments

  • PXL_20220804_152613492.jpg
    PXL_20220804_152613492.jpg
    4.7 MB · Views: 59
Last edited:

zfigz

New Member
Joined
Aug 4, 2022
Messages
18
Reaction score
5
Credits
190
all things went down hill when i tried to restore my home user, it wouldn't do it. timeshift just failed, but did create the user home directory. so i went to pop!_os fix boot loader steps, https://support.system76.com/articles/bootloader/, and followed all the steps etc, but i was the prevented from even booting with issues finding the iuud for the encrypted disk. so i chrooted again and made sure the uuids were right and ran update-initramfs again, but no luck.

my next test will be to do a fresh install, create snapshot and then restore, but not copy /boot at all, and try just moving it manually over after the restore.
 
Last edited:

bob466

Well-Known Member
Joined
Oct 22, 2020
Messages
651
Reaction score
461
Credits
4,777
all things went down hill when i tried to restore my home user, it wouldn't do it. timeshift just failed, but did create the user home directory. so i went to pop!_os fix boot loader steps, https://support.system76.com/articles/bootloader/, and followed all the steps etc, but i was the prevented from even booting with issues finding the iuud for the encrypted disk. so i chrooted again and made sure the uuids were right and ran update-initramfs again, but no luck.

my next test will be to do a fresh install, create snapshot and then restore, but not copy /boot at all, and try just moving it manually over after the restore.

I use Timeshift for minor problems only...you should never rely on only one backup solution...that's asking for trouble.
scared0005.gif


After a clean install with all my software...browsers...VMs and printer installed...I'll create a snapshot with timeshift...then I'll create an image with Foxclone...https://www.foxclone.com/ If anything happens...Drive failure being the worst...I just restore the image with nothing lost and it works every time. You can create an image anytime and so very fast unlike Clonezilla which takes forever and may not work.
happy0034.gif
 

zfigz

New Member
Joined
Aug 4, 2022
Messages
18
Reaction score
5
Credits
190
I use Timeshift for minor problems only...you should never rely on only one backup solution...that's asking for trouble.
scared0005.gif


After a clean install with all my software...browsers...VMs and printer installed...I'll create a snapshot with timeshift...then I'll create an image with Foxclone...https://www.foxclone.com/ If anything happens...Drive failure being the worst...I just restore the image with nothing lost and it works every time. You can create an image anytime and so very fast unlike Clonezilla which takes forever and may not work.
happy0034.gif
yah, that's what i've actually been doing. a full disk clone via clonezilla and timeshift.

i just wanna be able to fully restore via timeshift, and while i've seen success stories, i'm about to putter out as this is taking too much of my time.

maybe someone can chime in with a success story "and" a how to.
 

gvisoc

Well-Known Member
Joined
May 29, 2020
Messages
446
Reaction score
535
Credits
4,570
zfigz said:
i'm about to putter out as this is taking too much of my time.

I've just came across a bespoke script that someone uses to do something similar. The main difference is that they're not creating an image using a backup tools like timeshift, but syncing the files to an image themselves using their own rsync recipe, and filtering the filesystem themselves to pick what to leave out.

I also got an answer that points out what to care about regarding uid and guid and file ownership when using rsync.

Just in case you give up, I wanted to point this out as a potential middleground solution. They claim for the script to be useful to prepare server images from a fresh install.
This would give you a starting point in order to build the other leg of the trip (rsyncing from the image to the fresh install).

As I am interested in solving this, too, I may give it a try myself using virtual machines or my laptop as a base and the desktop computer as the destination (both use Fedora), but I could not do it yet. If I come across a complete script set someday, I will post it.
 

Condobloke

Well-Known Member
Joined
Apr 30, 2017
Messages
5,135
Reaction score
4,314
Credits
30,232
Success story.

I am running Linux Mint 20.3

I installed 20.3 from a 'live' usb many months ago

Once the clean install was done, I opened Timeshift......went to settings.....located the external hard drive which contained my snapshots.....and restored the snapshot of my choice.

My User home directories looks like this:

1659663899896.png


my Include/Exclude Patterns looks likes this:

1659663964850.png


The Restore was without dramas.

The PC runs perfectly in every way



Nothing 'Minor' about that.
 

bob466

Well-Known Member
Joined
Oct 22, 2020
Messages
651
Reaction score
461
Credits
4,777
yah, that's what i've actually been doing. a full disk clone via clonezilla and timeshift.

i just wanna be able to fully restore via timeshift, and while i've seen success stories, i'm about to putter out as this is taking too much of my time.

maybe someone can chime in with a success story "and" a how to.

Forget clonezilla it's just too slow and there's no grantee it will work. I recently created an image of my 500GB SSD...used space on Drive was about 160GB...Foxclone took 37 minutes and compressed the image to 120GB. Foxclone has an image verify feature...so you know the image created is good which is very important.
To restore it would be a little less under 37 minutes and has a very nice GUI too...it's free try it you've nothing to loose.
happy0035.gif
 
$100 Digital Ocean Credit
Get a free VM to test out Linux!

Linux.org Hosting Donations
Consider making a donation

Members online


Latest posts

Top