Quantcast
Channel: Active questions tagged clonezilla - Super User
Viewing all articles
Browse latest Browse all 67

Bootable but kinda broken SSD -> Cloned SSD is not bootable

$
0
0

I have a 120GB SSD with Ubuntu installed that seems to be slowly failing. Every once in a while the root filesystem is mounted read-only and I need to run fsck in some sort of recovery console,so I used CloneZilla 2.7.2-39 to clone the entire SSD to a bigger one (500GB). I used the default "Expert" options except that I unchecked -r ("Resize the filesystem to fit partition size of the target system") and I checked -rescue ("Continue reading next one when disk blocks read errors") because there are blocks that cannot be read.

The cloning always works without errors at first, and at some point no further blocks can be read until the end of the cloning process. The point where it stops working seems to be different from reboot to reboot but it's always somewhere in the middle of the second partition.

After cloning I inspected the cloned SSD on Windows:

  • Disk management:

Detects the drive and reports the expected partitions (a 512MB EFI-partition, a ~120GB partition, and the rest is unpartitioned space). It can't do anything with the partitions, of course, because it doesn't understand ext4, but that's to be expected.

  • wmic: wmic:root\cli>partition
BlockSizeBootableDescriptionDeviceIDDiskIndexIndexNumberOfBlocksPrimaryPartitionSizeStartingOffsetType
512TRUEGPT: SystemDisk #2, Partition #0201048576TRUE5368709121048576GPT: System
512FALSEGPT: UnbekanntDisk #2, Partition #121233402368FALSE119502012416537919488GPT: Unknown

Basically confirms what the disk management shows, but it also lists the exact sizes and they seem to make sense.

... and with the CloneZilla shell:

  • lsblk

NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTsda 8:0 0 465.8G 0 disk├─sda1 8:1 0 512M 0 part└─sda2 8:2 0 111.3G 0 part

It seems legitimate so far.

But the cloned SSD is not bootable. It's not recognized as a bootable medium. (See update 1)

  • fsck /dev/sda1 shows no errors.
  • fsck /dev/sda2 shows a ton of errors (as expected, since a lot of the blocks could not be read). I tried both leaving the errors and fixing them (which seems to work, as a second run shows no errors, then).
  • fsck /dev/sda shows "ext2fs_open2: Bad magic number in super-block [etc...]" with no option to fix it, and the suggested e2fsck commands also can't fix it.

My questions:

  • How is it possible that the original SSD boots fine but the clone doesn't? If the data can be read when booting, why can it not be read when cloning?
  • And how can I clone the SSD in such a way that the clone is also bootable? (If corrupted files end up staying corrupted or being removed by e.g. fsck that's fine.)

Before you ask "Why?":

It's Ubuntu 20.04 18.04.1 LTS with a bunch of configuration already done. At the time I did not write down the exact steps of what was configured, because it was a very messy process to get everything to work. Rather than setting up a completely new OS (I tried that, short story is "nothing works") I would rather keep a backup of this slightly corrupted but otherwise working one.

Update 1:

The EFI partition on the cloned SSD has the same UUID as on the original SSD.

Here's some data of the cloned SSD:

ocslivemode is Enter_shellEntering command line prompt.The next step: cmdNow enter command line prompt...user@debian:~$ sudo suroot@debian:/home/user# efibootmgr -vBootCurrent: 0003Timeout: 2 secondsBootOrder: 0003,0001,0002Boot0001* ubuntu       HD(1,GPT,7ff9e193-24ad-4319-87ff-654e5468c824,0x800,0x100000)/File(\EFI\UBUNTU\SHIMX64.EFI)..BOBoot0002* UEFI: Built-in EFI Shell      VenMedia(5023b95c-db26-429b-a648-bd47664c8012)..BOBoot0003* UEFI: Intenso Slim Line 1100, Partition 1      PciRoot(0x0)/Pci(0x14,0x0)/USB(14,0)/HD(1,MBR,0x5a1c6e66,0x40,0x77fffbf)..BOroot@debian:/home/user# lsblkNAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINTloop0    7:0    0   252M  1 loop /usr/lib/live/mount/rootfs/filesystem.squashfssda      8:0    0 465.8G  0 disk|-sda1   8:1    0   512M  0 part`-sda2   8:2    0 111.3G  0 part  sdb      8:16   1    60G  0 disk  `-sdb1   8:17   1    60G  0 part /usr/lib/live/mount/mediumroot@debian:/home/user# lsblk -no PARTUUID /dev/sda17ff9e193-24ad-4319-87ff-654e5468c824root@debian:/home/user# _

The cloned SSD actually is recognized as a boot option, but when I boot from it I end up in a grub shell.

Update 2:

In the grub shell of the original SSD:

ls: (hd0) (hd0,gpt2) (hd0,gpt1)
echo $prefix: (hd0,gpt2)/boot/grub
ls $prefix: gfxblacklist.txt unicode.pf2 x86_64-efi/ locale/ fonts/ grubenv grub.cfg
configfile $prefix/grub.cfg: The screen turns black and as far as I can tell, nothing else happens for at least 2 minutes. Pressing Ctrl+C or Esc does not have any effect. I cut power before waiting longer.
set:

grub>grub>grub>grub> ls(hd0) (hd0,gpt2) (hd0,gpt1)grub> echo $prefix(hd0,gpt2)/boot/grubgrub> set?=0cmdpath=(hd0,gpt1)/EFI/UBUNTUcolor_highlight=black/light-graycolor_normal=light-gray/blackfeature_200_final=yfeature_all_video_module=yfeature_chainloader_bpb=yfeature_default_font_path=yfeature_menuentry_id=yfeature_menuentry_options=yfeature_nativedisk_cmd=yfeature_ntldr=yfeature_platform_search_hint=yfeature_timeout_style=ygrub_cpu=x86_64grub_platform=efilang=locale_dir=net_default_ip=(null)net_default_mac=(null)net_default_server=package_version=2.02-2ubuntu8.17pager=prefix=(hd0,gpt2)/boot/grubpxe_default_server=root=hd0,gpt2secondary_locale_dir=grub> _

From CloneZilla I can mount the first partition (to "/foo") and access the files. I found a grub.cfg, but the path seems different: "/foo/EFI/ubuntu/grub.cfg"

Contents:

search.fs_uuid 64702138-591a-4535-8e60-2e2348477870 root hd2,gpt2set prefix=($root)'/boot/grub'configfile $prefix/grub.cfg
I'm not sure if that helps. The referred UUID is not the UUID of the second partition, btw! That would be bf07a56c-4d8d-9952-2bd16756d2b7.

In the grub shell of the clone:

ls: (hd0) (hd0,gpt2) (hd0,gpt1)
echo $prefix: (hd0,gpt2)/boot/grub
ls $prefix: error: directory is encrypted.
set:

color_normal=light-gray/blackfeature_200_final=yfeature_all_video_module=yfeature_chainloader_bpb=yfeature_default_font_path=yfeature_menuentry_id=yfeature_menuentry_options=yfeature_nativedisk_cmd=yfeature_ntldr=yfeature_platform_search_hint=yfeature_timeout_style=ygrub_cpu=x86_64grub_platform=efilang=locale_dir=net_default_ip=(null)net_default_mac=(null)net_default_server=package_version=2.02-2ubuntu8.17pager=prefix=(hd0,gpt2)/boot/grubpxe_default_server=root=hd0,gpt2secondary_locale_dir=grub> _

There are also a few lines at the top that don't fit on the screen. I can't find a way to scroll up, though. "Page Up" and "Page Down" don't work.


Viewing all articles
Browse latest Browse all 67

Trending Articles