Backup / Restore / Migration to different Partition Layout

I have the following matter: I'm not new to Linux, but I have used different distributions than the Ubuntu-familie. Think of OpenSUSE, think of Fedora, think of FreeBSD. And as with all within one family, things are similar, but not the same.

Both using Fedora and OpenSUSE I had this super flexible way of working where I could recreate a machine or migrate a machine (example for test purposes, or just simply porting my desktop to notebook if needed), by means of a backup/restore script.

What it basically does is creating either a full-fledged compressed tar with all the userid/groupids as well as with the permissions, acls and all that stuff, OR, depending on the option you pick a squash-filesystem that holds same data but in a disk-image format.

So I could migrate from an ext4 simple layout to BTRFS with subvolumes, to LVM, from BTRFS to LVM or the other way around, encrypted FS, partly encrypted, whatever I want(ed).

However, as with most Linuxes: create partition layout, restore the system, edit fstab, edit crypttab, enter the new IDs, depending on the system either play with update-initrd, dracut or any other, edit the grub file, rewrite the config, install onto the efi-partition, reboot, et voila...

Not so much with ZorinOS 18 (Pro and Core). All goes well restoring to the filesystem, but when - for example - formatting an XFS boot partition, and having a lukscrypted XFS root partition or BTRFS things go bananas.

I simply can't seem to find how to create a proper grub bootloader.

What happens: grub-mkconfig works, without errors; grub-install works, no errors, however during boottime I get:

Enter Passphrase for hd0,gpt3 (b8f5dd ... etc)
error: Invalid Passphrase
error: nu such cryptodisk found, perhaps a needed disk or cryptodisk module is not loaded
error: no such device: 5xxxx etc
error: no server is specified

This, while password is 100% correct.

Then Grub2 screen appears, but boot fails.

How to retain portability and flexibility of filesystems. The more that other Linuxes don't seem to have this problem. Pretty sure that I'm missing out on something zorinos (or ubuntu) specific, but then ... I just simply don't see it.

Have tried AI tools like Gemini and ChatGPT, but they come with similar steps and those lead to the same outcome.

Hardware:

  • HP Notebook with UEFI
  • NVMe SSD
  • No Windows and internal SSD wiped (blkdiscarded)
  • GPT Partition Created
  • EFI Partition, Seperate Boot Partition (XFS/EXT4), System Partition (LUKS/CRYPT-DM/VERACRYPT) with (EXT4/XFS/ZFS/BTRFS)
  • HOME Partition, at times - but during the Proof Of Concept: not present
  • Swap FILE not Swap Partition

One of the setup-files:

cat crypttab 
# /etc/crypttab example for your setup:
# <target name>                <source device>               <key file>   <options>
encrypted_fs                    UUID=b8f5dd15-cbcf-4700-92f4-4ed326e76aeb   none         luks,discard
cat fstab 
# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
UUID=5010058a-937d-4474-8859-46b11b9af90b /               xfs    errors=remount-ro 0       1
UUID=1edf62ec-4723-4060-928f-d82e1111f83a /boot           xfs    defaults          0       2
UUID=86ED-AAD9  			  /boot/efi       vfat    umask=0077       0       1
/system_swap 				  none            swap    sw	           0       0
cat default/grub
# If you change this file, run 'update-grub' afterwards to update
# /boot/grub/grub.cfg.
# For full documentation of the options in this file, see:
#   info -f grub -n 'Simple configuration'

GRUB_DEFAULT=0
GRUB_TIMEOUT=5
GRUB_DISTRIBUTOR=`( . /etc/os-release; echo ${NAME:-Ubuntu} ) 2>/dev/null || echo Ubuntu`
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash mitigations=auto cryptdevice=/dev/nvme0n1p3:encrypted_fs root=UUID=5010058a-937d-4474-8859-46b11b9af90b"
GRUB_CMDLINE_LINUX=""

# If your computer has multiple operating systems installed, then you
# probably want to run os-prober. However, if your computer is a host
# for guest OSes installed via LVM or raw disk devices, running
# os-prober can cause damage to those guest OSes as it mounts
# filesystems to look for things.
GRUB_DISABLE_OS_PROBER=true

# Uncomment to enable BadRAM filtering, modify to suit your needs
# This works with Linux (no patch required) and with any kernel that obtains
# the memory map information from GRUB (GNU Mach, kernel of FreeBSD ...)
#GRUB_BADRAM="0x01234567,0xfefefefe,0x89abcdef,0xefefefef"

# Uncomment to disable graphical terminal
#GRUB_TERMINAL=console

# The resolution used on graphical terminal
# note that you can use only modes which your graphic card supports via VBE
# you can see them in real GRUB with the command `vbeinfo'
#GRUB_GFXMODE=640x480

# Uncomment if you don't want GRUB to pass "root=UUID=xxx" parameter to Linux
#GRUB_DISABLE_LINUX_UUID=true

# Uncomment to disable generation of recovery mode menu entries
#GRUB_DISABLE_RECOVERY="true"

# Uncomment to get a beep at grub start
#GRUB_INIT_TUNE="480 440 1"

GRUB_THEME=/usr/share/grub/themes/zorin/theme.txt
GRUB_DISABLE_MEMTEST="true"
GRUB_USE_LINUXEFI="true"
GRUB_ENABLE_CRYPTODISK="y"

I have also tried adding xfs to the kernel, and xfsprogs are present, but I can't seem to restore my backup image.

Any ideas? Suggestions or ... the golden ticket to a solution?

I really need the filesystem backup because of the various Filesystems the system needs to run on. And as mentioned before, it works on OpenSUSE and Fedora ...

One more thing: when using the boot repair application from the boot (live) system, I always seem to get:

Encrypted partition detected. Please retry after mounting your encrypted partitions so that the tool can verify their contents. (cryptsetup open)

Even though the system's partition is unlocked using the cryptsetup luksOpen command

This is way above my IQ. However there is a bit of a clue in your post. You stated no such issue with SuSE or Fedora - they both use Red Hat Package Manager, Gnome/Zorin uses Debian - I suspect that is the crux of the matter, but then again, I am no Dev either, but the way Gnome is going, they won't have a user base if they carry on as they are doing. Just my 50 cents.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.