Restoring to a different device timeshift - Linux Mint Forums

Restoring to a different device timeshift

Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.

Level 1

Posts:

Joined: Thu Dec 28, 2023 4:27 am

Restoring to a different device timeshift

I would like to restore my entire system from an old computer to my new one.

The system is in a 1TB hard drive, and I would like to put it in a 512GB SSD. The entire system is less than 300GB so it shouldn't be impossible.

I created a timeshift snapshot of the entire system(including the user files) on a different HDD and am currently trying to restore it from a live install pendrive. The timeshift restoration goes successfully, but when I try to boot, it goes to the grub terminal and says to load kernel when I run boot. I don't know how to do that, but I've never seen this happening, so I have a suspicion I'm doing something wrong during restoration.

I restored
/ to the 512GB partition
/boot to the 512GB partition
/boot/efi to the small 537MB partition
/home to the 512GB partition

Any and all help is appreciated greatly! Thanks in advance!

Last edited by LockBot on Wed Jul 03, 2024 10:00 pm, edited 1 time in total.
Reason:*Topic automatically closed 6 months after creation. New replies are no longer allowed.*

User avatar

Level 22

Posts:

Joined: Fri Mar 04, 2016 5:23 pm

Location: Wiltshire

Re: Restoring to a different device timeshift

Boot your install stick and post the output from sudo parted --list, it will tell us how your drive is set up. See this on how to post terminal output:
viewtopic.php?p=2119362&hilit=terminal#p2119362

The UUIDs for your / partition are wrong so grub is looking for a non-existent / partition, also fstab will be wrong.

Probably easiest to set the UUID of your root partition to what it was originally, boot your install stick open your file manager and navigate to /etc on your / partition on the system drive. Scroll down to the file fstab and double click to open it. Post the output.

For the future, it would have been easier to clone it using foxclone. You would need gparted to shrink the last partition on the 1TB drive so it ends at < 512GB. After that straightforward.
https://foxclone.org/
See the section in the user guide on cloning.

Thinkcentre M720Q - LM22.1 cinnamon, 4 x T430 - LM22.1 & LM21.3 cinnamon.

Level 1

Posts:

Joined: Thu Dec 28, 2023 4:27 am

Re: Restoring to a different device timeshift

AndyMH wrote: Wed Jan 03, 2024 8:32 am

  1. Output of sudo parted --list. The HDD is the one where I have the system snapshot.
    Code: Select all
    Model: ATA TOSHIBA DT02ABA2 (scsi)
    Disk /dev/sda: 2000GB
    Sector size (logical/physical): 512B/4096B
    Partition Table: gpt
    Disk Flags: 
    Number  Start   End     Size    File system  Name  Flags
     1      1049kB  1300GB  1300GB  ext4
    Model: USB SG Flash (scsi)
    Disk /dev/sdb: 63.3GB
    Sector size (logical/physical): 512B/512B
    Partition Table: gpt
    Disk Flags: 
    Number  Start   End     Size    File system  Name       Flags
     1      32.8kB  3022MB  3022MB               ISO9660    hidden, msftdata
     2      3022MB  3026MB  4350kB               Appended2  boot, esp
     3      3028MB  63.3GB  60.3GB  ext4
    Model: HP SSD EX900 Plus 512GB (nvme)
    Disk /dev/nvme0n1: 512GB
    Sector size (logical/physical): 512B/512B
    Partition Table: gpt
    Disk Flags: 
    Number  Start   End    Size   File system  Name                  Flags
     1      1049kB  538MB  537MB  fat32        EFI System Partition  boot, esp
     2      538MB   512GB  512GB  ext4
    
  2. Contents of fstab from the snapshot:
    Code: Select all
    # /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>
    # / was on /dev/sda2 during installation
    UUID=bfd12f67-3670-44b1-82a6-6b9b56e914dd /               ext4    errors=remount-ro 0       1
    # /boot/efi was on /dev/sda1 during installation
    UUID=4168-449A  /boot/efi       vfat    umask=0077      0       1
    /swapfile                                 none            swap    sw              0       0
    

User avatar

Level 22

Posts:

Joined: Fri Mar 04, 2016 5:23 pm

Location: Wiltshire

Re: Restoring to a different device timeshift

Boot your install stick, open a terminal and:

tune2FS -U bfd12f67-3670-44b1-82a6-6b9b56e914dd /dev/nvme0n1p2
tune2FS -U 4168-449A /dev/nvme0n1p1

The first command sets the UUID of your / partition, the second your EFI partition. If you get a permission denied preface the commands with sudo. This is setting the UUIDs back to what are shown in your fstab.

Then see if it boots.

Thinkcentre M720Q - LM22.1 cinnamon, 4 x T430 - LM22.1 & LM21.3 cinnamon.

Level 1

Posts:

Joined: Thu Dec 28, 2023 4:27 am

Re: Restoring to a different device timeshift

AndyMH wrote: Wed Jan 03, 2024 12:54 pm Boot your install stick, open a terminal and:

Code: Select all

tune2FS -U bfd12f67-3670-44b1-82a6-6b9b56e914dd /dev/nvme0n1p2
tune2FS -U 4168-449A /dev/nvme0n1p1

The first command sets the UUID of your / partition, the second your EFI partition. If you get a permission denied preface the commands with sudo. This is setting the UUIDs back to what are shown in your fstab.

Then see if it boots.

It outputs:
tune2FS: command not found

User avatar

Level 22

Posts:

Joined: Fri Mar 04, 2016 5:23 pm

Location: Wiltshire

Re: Restoring to a different device timeshift

sudo apt install e2fsprogs

I'm surprised it is not in the install iso, but there you go.

Having googled, do not use tune2fs on the EFI partition, just run

tune2fs -U bfd12f67-3670-44b1-82a6-6b9b56e914dd /dev/nvme0n1p2

tune2fs does not work on fat32 filesystems.

If it boots after the change then you can change the UUID in fstab to match what is on the drive.

EDIT - type on my part, tune2FS and should be tune2fs

Thinkcentre M720Q - LM22.1 cinnamon, 4 x T430 - LM22.1 & LM21.3 cinnamon.

Level 1

Posts:

Joined: Thu Dec 28, 2023 4:27 am

Re: Restoring to a different device timeshift

AndyMH wrote: Wed Jan 03, 2024 1:16 pm

tune2fs -U bfd12f67-3670-44b1-82a6-6b9b56e914dd /dev/nvme0n1p2 outputs:

tune2fs 1.46.5 (30-Dec-2021)

This operation requires a freshly checked filesystem.

Please run e2fsck -f on the filesystem.

So I ran sudo e2fsck /dev/nvme0n1, but that outputs:

e2fsck 1.46.5 (30-Dec-2021)
ext2fs_open2: Bad magic number in super-block
e2fsck: Superblock invalid, trying backup blocks...
e2fsck: Bad magic number in super-block while trying to open /dev/nvme0n1

The superblock could not be read or does not describe a valid ext2/ext3/ext4
filesystem.  If the device is valid and it really contains an ext2/ext3/ext4
filesystem (and not swap or ufs or something else), then the superblock
is corrupt, and you might try running e2fsck with an alternate superblock:
    e2fsck -b 8193 <device>
 or
    e2fsck -b 32768 <device>

Found a gpt partition table in /dev/nvme0n1

User avatar

Level 22

Posts:

Joined: Fri Mar 04, 2016 5:23 pm

Location: Wiltshire

Re: Restoring to a different device timeshift

You run fsck on the filesystem not the drive so

sudo e2fsck /dev/nvme0n1p2

not

sudo e2fsck /dev/nvme0n1

Thinkcentre M720Q - LM22.1 cinnamon, 4 x T430 - LM22.1 & LM21.3 cinnamon.

Level 1

Posts:

Joined: Thu Dec 28, 2023 4:27 am

Re: Restoring to a different device timeshift

AndyMH wrote: Wed Jan 03, 2024 1:47 pm

That seems to have done something, so I'll try to boot from it now. Fingers crossed.

Level 1

Posts:

Joined: Thu Dec 28, 2023 4:27 am

Re: Restoring to a different device timeshift

AndyMH wrote: Wed Jan 03, 2024 1:47 pm

Booting seems to have opened BusyBox

Level 1

Posts:

Joined: Thu Dec 28, 2023 4:27 am

Re: Restoring to a different device timeshift

AndyMH wrote: Wed Jan 03, 2024 1:47 pm

I do have the original system on another hard drive, I can, of it looks like too much a hassle to you, use another method.

User avatar

Level 22

Posts:

Joined: Fri Mar 04, 2016 5:23 pm

Location: Wiltshire

Re: Restoring to a different device timeshift

sp-craftsman wrote: Wed Jan 03, 2024 2:03 pm I do have the original system on another hard drive, I can, of it looks like too much a hassle to you, use another method.

And probably less hassle to you. The simplest solution is to just clone the drive.

I gave you the link for foxclone in an earlier post. Download the foxclone iso, my 'goto' utility for bootable usb sticks is ventoy*:
https://www.ventoy.net/en/download.html
and wibol wrote an excellent 'howto' here:
viewtopic.php?p=2389786&hilit=ventoy#p2389786

When you have foxclone on a stick boot it. The first thing you will need to do is shrink the last partition on the original drive so that it will fit on the new drive, this is explained in the user guide. Do this with gparted (how to use also covered in the guide).

You can then clone it either direct drive-to-drive or take a full backup of the old drive and clone the backup to the new drive. Whichever is easiest.

Timeshift isn't designed for what you are trying to do, foxclone is. Note I'm the dev for foxclone.

* or you can use mint's usb imagewriter.

Thinkcentre M720Q - LM22.1 cinnamon, 4 x T430 - LM22.1 & LM21.3 cinnamon.

Jump to