Timeshift restore to empty drive fails to boot (cryptouuid error)

I have attempted to restore my external timeshift snapshot of my system to a new and empty drive using the following steps:

  1. Install Manjaro KDE on btrfs, with luks encrytion (same as snapshot)
  2. Start system and restore snapshot (from external drive)

This was a bit of a naive approach and would never have worked in the first place. Now I was getting the following error while booting the system:

error: no such cryptodisk found, perhaps a needed disk or cryptodisk module is not loaded.
error: disk ‘cryptouuid/844[
]’ not found.
Entering rescue mode


Noting that the cyptouuid was the one from the snapshot and not the freshly installed system, that I restored it to.
My problem is similar to this this and this forum post, but only at first glance.

My idea was, that I try to save all the files, that were important to the new system before the restore, than restore the snapshot and afterwards overwrite the saved files. (because the snapshot also restores the old crypto_keyfile.bin for example, which can only open its associated drive)
Files that I saved:

  • /crypto_keyfile.bin
  • /etc/crypttab
  • /etc/fstab
  • /etc/default/grub

So I did install Manjaro again and copied all the files to an external drive, restored the snapshot and overwrote these files.
After that, I went with a live USB to chroot this system to update-grub and run the following command: mkinitcpio -P
Now I checked, that the old cryptouuid (844[
]) was nowhere to be found (at least where I searched) and had been replaced by the cryptouuid of the installed system.
But the error still remains the same.

I know that timeshift snapshots are technically not designed to work in this way, but they contain all the files that are needed to setup a new system.
If you have any idea how to fix my situation, or how to restore a timeshift snapshot (with luks encryption) on a new system/drive, please share your thoughts under this topic.
Thank you very much

I think your problem is the keyslots holding the keys to the container - those keys are not part of a timeshift’ed backup - they only exist as part of the container.

The most trivial solution would be to use clonezilla to create a copy of your old disk - then write that to the new disk. There methods to expand a LUKS container - the Arch Wiki will be most helpful in that regard.

A timeshift’ed backup is usually not encrypted - that is unless you backup into another LUKS volume.

A timeshift’ed backup does not backup a user’s home - so unless you have a complicated system configuration - or want to re-create a Plasma 5.27 - there is simpler methods move to a new system.

  • Presuming that all your important files, documents etc. is located elsewhere.
  • Presuming the only goal is to restore the system’s applications with your personalized configs.

Your customizations is all stored in your home

  • ~/.local
  • ~/.config

And depending on your specific usecase other hidden folders and files may be applicable.

Then generate a list of packages - one for native packages (the official repo) and one for any custom packages.

Your copy of the configs and the package lists is all that is needed.

I once created a script for it - see → [root tip] [Utililty Script] Backup configuration and package list

1 Like

Well, I should have added that the drive on which my original system was installed failed beyond repair and all the data was lost. That snapshot is all I have from it.

It is just a setting in timeshift to include to the whole home and root partition in the snapshots. So I did when I was creating the snapshot and now can see all my files in it.
image

My question now is why is grub still looking for the old cryptouuid and where can I change this?

I hope you know that BTRFS is a really advanced filesystem, where you have to know everything about it, when you want to rely on it, when important files are included in the situation.

That’s why i still prefer Ext4, because im not hardcore enough for BTRFS :crazy_face:

From my understanding only Timeshift Rsync (not BTRFS), fully duplicate your files. I also include my Home partition on the snapshot that saved on a external HDD
 and i also see it as backup, but do you use Timeshift Rsync or Timeshift BTRFS?

I think I basically did the same as you, an Rsync backup with home included on a external drive with Ext4. Only the system itself was Btrfs.
Therefor the snapshot should be an exact duplicate of my old system.

This sounds great, at least your files are not in trouble.
I would probably mirror that stuff now, when you have no other backup. (just in case)

Since i have absolute no idea about BTRFS and how to restore a BTRFS and specially not a encrypted root.

But you additional want to restore the snapshot to a new other drive?

For sure you need probably edit Grub and Fstab and Edit your UUID after you did the restore, at least this is required from my understanding
 but the snapshot also should restore/overwrite the other partitions (like swap or boot partition as far as i know).

Atleast all this additional partitions shows up in the Timeshift GUI, when you choose the Snapshot while on a live boot, where you can select all the wanted partitions.

So, i wondering why reinstall Manjaro is needed, when you have all the files/partitions ready to restore. :thinking:

Anyways, i guess im not big help here
 im better shut up now :zipper_mouth_face:

Despite what many say, Timeshift is not a backup utility, it’s a system restore utility. There’s a reason why /home is excluded by default, if you restore your system then your data also gets restored which causes data loss. Don’t include /home in Timeshift, use an actual backup utility for data.

The way I see it, the option to include /home is there so you can start with a pristine environment for testing.

If so, you can just copy the files over.

I’d reinstall, then copy the data over (including user config), you should also be able to copy system wide config files, and install what you need. If you can boot or manjaro-chroot into the snapshot then you could get a list of installed packages, and use that to install your software.

In future use timeshift for your system only and a backup utility for your data.

This is not true, there is a Pro & Con if /home is included.
I would 100% keep my /home included
 because im aware about it.

The Pro is
 no Data loss at all, when the snapshot is freshly created.

The Con is
 all modified files in home will replaced and with a older snapshot you have problems. But call this data loss? Doesn’t sound right too me, since you only (at worstcase) replace newer changed files with older one’s.

In addition, i also think (not sure at the moment) that you can unselect the /home when the Partition overview in timeshift GUI shows up after you selected the snapshot to restore it.

But i have to admit i never played with that unselect option and i was always fine with a full restore till now.

Yes, but you can manually restore those again from an earlier backup. timeshift’s rsync’d backups can be browsed just like any other directory. You only have to pick the right directory and then use “cp -RPp” as root to restore the pertinent directories and files with full preservation of permissions and ownership information. :wink:

3 Likes

How is that not data loss?

I don’t actually use timeshift, so perhaps that’s true. Also:

Still best to use an actual backup utility to prevent accidents.

@Aragorn

I think you mean a later backup.

1 Like

Yeah of course, i just wanted to make this Con point as a example when the Timeshift user don’t have additional backup.

1 Like

Or that, yes.

The point I was trying to make is that you can decide which parts you restore if you do it manually instead of relying on a full restoration from within the timeshift user interface.:wink:

Note: We are of course talking about a backup made with rsync here, not of a btrfs snapshot — which is not a backup.

2 Likes

Yes, but not everyone knows that. People have lost data because of it.

2 Likes

I personally also do manual copy+paste backups from my Home from time to time. But i do regulary Timeshift Rsync (Backups) 2-4 times between each Stable Release Update Cycle. So im not left without trousers when my Root/Home SSD is dead in the next hour.

Because my copy+paste backups are much older and only refreshed every 2-3 month. With Timeshift its going hand in hand anyways.

Even if the developer don’t recommend Timeshift Backup, for me it works fine. :man_shrugging:

I mean this files aren’t corrupt or anything
 its just a “maybe” little older version. (depends on the snapshot date)

Data loss is more painfull, when you lose everything
 i call it next level :stuck_out_tongue_winking_eye:

And new created files also fine
 only the identical named files are going replaced.

Why not just use a backup utility?

I used to do manual backups, but they were always out of date. Which makes then pretty much useless, though still better than nothing. Then I wrote my own backup utility, which backs up my data in as little as 14secs (if almost nothing changed).

I didn’t say corrupted files, I said data loss. Data loss is when you lose any amount of data.

Whilst losing everything is data loss, losing even a single change is also data loss.

1 Like

Don’t use copy/paste — as in “from a GUI” — because it won’t preserve permissions and ownership. You need to do it with root privileges and from the command line, using “cp -RPp” in order to preserve the POSIX attributes.

Barring a hardware failure, this is where btrfs outshines ext4, because of its checksums and its self-repairing abilities.

2 Likes

Yeah some kind of true
 i just wanted to clarify what this data loss actually means.

I think it scares people of to not use (include home) in Timeshift, when the situation aren’t really explained in detail.

Data loss is from my viewpoint just a little unprecise/generic.

Well im just talking about my Media files, Documents like PDF/Pictures/txt files, Games and Savegame files.

I don’t think it matters with this type of files there
 and since im saving all this files on a exfat partitions anyways
 where all this permissions vanished, right?

Atleast Simlink can’t stored there
 another handicap for me :sweat_smile: but hey nothing is perfect in this world :smiley:

You can also turn this around and people could also have data loss when /home not included and they don’t have additional backup and the Root/Home Drives crashed
 everything depends on the viewpoint.

You just answered my question :stuck_out_tongue_winking_eye:

The more detailed answer is, my backup can contains to much data and my backup drives are really slow.

While only 5% of files needs to be replaced.
And i just trust my brain more, than a random tool, where the developer maybe did a mistake and then my files are history.

I really wished that Btrfs gets patched and doesn’t required additional steps when i run into OS problems.

At the moment, i just fear it
 for me it looks like a side grade to ext4.

What i also don’t like at BTRFS is the write protection
 specially on a SSD (i think) its confusing
 where i don’t know to see the difference between a dead SSD that have write protection or if its BTRFS feature that waiting for a repaired partition.

And probably gave me a stroke when it appeared. :woozy_face:

But for sure, it also has it strength and this automatic checksum feature sounds awesome
 i wish we could see a improved ext4 (or ext5) filesystem with that feature.

What question?

That’s not a reason to do manual backups.

If you use an actual backup utility, then you can pick what you want backed up or restored, and where it’s backed up and restored. You can pull individual files out too.

I trust my backup utility (it’s called timewarp, but it’s not public) more than I trust myself to remember to backup manually. I’d probably trust a well established backup utility, such as rsnapshot (which is quite similar to mine) or borg, even more.

I know I am not answering your initial question - instead I will provide another method to restore your system.

I don’t think you should spend to much time on cryptouuid issue - unless is is a personal challenge that must be completed - then barge on - feel free to completely ignore the rest of my comment


I don’t have an answer - though I think the files you mention below should cover it

I don’t know how timeshift works - I only think I know - :thinking: - I don’t really use backup solutions as I am doing things differently - and I know - that info doesn’t really help you in your current challenge.

Years ago I devised a plan including the needed scripting and mount units. I have used that plan many times, last time just a few days ago, I am back in business within ±30 minutes.

  • I keep my stuff on seperated disks
  • I keep copies in ovf or ova format for my virtual machines
  • I run a local instance of forgejo (gitea clone) on a raspberry pi
  • I have my source code on various git providers (Github, Gitlab, Codeberg)
  • At the company I work for I setup a private Gitea instance for their source code
  • I commit my work several times a day
  • I have my serious stuff stored on Proton Drive
  • I have my mail at Proton Mail

If it work the way I think it works - then it would create snapshots where you can see which one is the latest.

All your files will be present in that latest timeshift - either the physical file if it changed or a hardlink to the previous file.

So it should be fairly easy to generate a package list and to copy the content of the /home/$USER from the backup disk into your encrypted home.

Generating a package list could likely be done by using some advanced pacman-fu targeting the last timeshift’ed location.

I will make a test backup using timeshift to see if I can deduce a smarter method to apply your backed up data.

Proof of concept

I created a test and this is how you manually get your data back.

I am assuming your data is backed up unencrypted - which would be the default - even if you are backing up an encrypted system.

Mount your backup device - it is OK if you open it in your file manager - doesn’t really matter.

Navigate the device - the places where my timeshift differs from yours I replaced with a variable

  • $USER
  • $NAME
  • $DATE_TIME
/run/media/$USER/$NAME/timeshift/snapshots/$DATE_TIME/localhost

To generate package lists - you need a terminal in that folder F4 or AltShiftF4

Verify the path

pwd

Generate package lists - see → pacman/Tips and tricks - ArchWiki
Export native (repo) package list

pacman -Qqn --root $PWD --config $PWD/etc/pacman.conf --cachedir $PWD/var/cache/pacman/pkg --dbpath $PWD/var/lib/pacman > ~/pkgs-native.txt

Export custom package list

pacman -Qqm --root $PWD --config $PWD/etc/pacman.conf --cachedir $PWD/var/cache/pacman/pkg --dbpath $PWD/var/lib/pacman > ~/pkgs-custom.txt

From there it is straight forward to copy the content of your users home - assuming your $UID and $USER is identical

cp -R $PWD/home/$USER/.*

Install the native packages

sudo pacman -Syu - < ~/pkgs-native.txt

Build custom packages

pamac build $(cat ~/pkgs-custom.txt)
1 Like