0
  1. Using Clonezilla on a thumb drive to create a system image, in order to clone disks from it;
  2. Clonezilla threw an error: "mismatched GPT and MBR partition" and refused to proceed;
  3. Searched SuperUser for an answer on how to proceed, found Clonezilla fails at cloning with mismatched GPT and MBR partition ;
  4. Trusted the reply there, that I should remove the GPT partition to end the conflict;
  5. Did it, only to find that the disk is now unbootable. Can't enter Windows 10 nor Ubuntu 22.04. There is only a blinking cursor on the screen, no error message, and the disk read LED blinks once very quickly and turns off.

How to fix this disk in order to be able to retry cloning it? Cloning an unbootable disk is useless.

Byt using Clonezilla shell (Linux) I could gather this information:

cat /proc/partitions:

major minor #blocks     name
8        0  468851544   sda
8        1      51200   sda1
8        2  156231680   sda2
8        3  156282880   sda3
8        4  156283203   sda4
8       16    7818152   sdb
8       17    7817128   sdb1
7        0     273516   loop0

sudo fdisk -l /dev/sda:

Disk /dev/sda                   : 447.13GiB, 480103981056 bytes, 937703088 sectors
Disk model                      : ADATA SU630
Units                           : sectors of 1 * 512 = 512 bytes
Sector size (logical/physical)  : 512 bytes / 512 bytes
I/O size (minimum/optimal)      : 512 bytes/ 512 bytes
Disklabel type                  : dos
Disk identifier                 : 0xa890d888

sudo parted -l:

Model                           : ATA ADATA SU630 (scsi)
Disk /dev/sda                   : 480GB
Sector size (logical/physical)  : 512B/512B
Partition table                 : msdos
Disk Flags                      :

Number  Start   End Size    Type    File system     Flags
1       1049kB  53.5MB      52.4MB  primary ntfs    boot
2       53.5MB  160GB       160GB   primary ntfs
3       160GB   320GB       160GB   primary ntfs
4       320GB   480GB       160GB   primary ext4

sudo gdisk -l /dev/sda:

GPT fdisk (gdisk) version 1.0.8

Partition table scan:
    MBR: MBR only
    BSD: not present
    APM: not present
    GPT: not present

***************************************************************
Found invalid GPT and valid MBR; converting MBR to GPT format
in memory. 
***************************************************************

Disk                            : /dev/sda: 937703088 sectors, 447.1 GiB
Model                           : ADATA SU630
Sector size (logical/physical)  : 512 bytes / 512 bytes
Disk identifier (GUID)          : BC24557A-DABA-41A5-BAF3-318AA6D37C5C
Partition table holds up to     : 128 entries
Main partition table begins at  : sector 2 
Main partition table begins at  : ends at sector 33
First usable sector is          : 34
Last usable sector is           : 937703054
Partitions will be aligned on   : 2048-sector boundaries
Total free space is             : 5094 sectors (2.5MiB)

Number  Start (sector)  End (sector)    Size    Code    Name
1            2048          104447   50.0MiB     0700    Microsoft basic data
2          104448       312567807   149.0GiB    0700    Microsoft basic data
3       312567808       625133567   149.0GiB    0700    Microsoft basic data
4       625133568       937699974   149.0GiB    8300    Linux file system
  • 1
    We're probably going to need to see the state of your partition tables in order to help you. Please edit your question to include the output of "gpt show…" and "fdisk -d …" (or whatever the appropriate tools are in your OS for dumping both the GPT view and the MBR view of your partition tables; also you'll need to fill in the device file for the disk in question of course). If you happen to have saved that kind of information from before you made the change, that would be good to include as well so we can see the "before and after". – Spiff May 24 '22 at 17:40
  • Hi @Spiff . Thank you for the tip. I edited my question adding the information you asked. It seems my partitions are all MBR... Is anything more needed? – BsAxUbx5KoQDEpCAqSffwGy554PSah May 24 '22 at 18:15
  • Had you been using grub to (multi)boot? Or was it another bootloader (e.g. syslinux)? Also does `lsblk -f` / `blkid` shows that the partitions have filesystems on them? – Tom Yan May 24 '22 at 23:51
  • @TomYan GRUB, yes. The question text already mentioned that `sudo parted -l` shows `primary ntfs` and `primary ext4` and that `sudo gdisk -l /dev/sda` shows `Microsoft basic data` and `Linux file system`, but I will try the new commands you suggested too. – BsAxUbx5KoQDEpCAqSffwGy554PSah May 25 '22 at 10:00
  • Oh sorry I was reading on my cell phone so I missed that part. If you had been using grub (on a "MBR disk" / without having a "BIOS boot partition" that is for grub on a "GPT disk"), a part of grub (known as `core.img`) would be *embedded* on the "post-MBR gap", which would be the same location (albeit perhaps different size) where the main GPT would resides. So if you used `gdisk` to zap those blocks it's only natural that your (i386-pc) grub will be left broken. The solution would be to re-install grub. (I have no idea regarding the Clonezilla error btw.) – Tom Yan May 25 '22 at 10:08
  • @TomYan When trying to boot from the SSD, no error shows up on the screen, just a blinking cursor. I would be sure if it was written there "GRUB Error", "Restart and Select Proper Boot Device" or anything else. But the blinking cursor, plus the disk reading LED off, does not allows me to be sure about what is happening and what to do next. I'm afraid of reinstalling GRUB and making things worse (problem over problem over problem). – BsAxUbx5KoQDEpCAqSffwGy554PSah May 25 '22 at 10:17
  • Would it be possible for you to dump the first block/sector (or even better, the first MiB / 2048 blocks/sectors) of the drive with `dd` or `head` and add a link of somewhere that the dump can be downloaded from to the question? – Tom Yan May 25 '22 at 10:29
  • @TomYan I could not dump using `dd` nor `head` due to (destination) `not a directory` error. But reinstalling GRUB did fix the boot problem. Since you originally suggested it, I will let you provide this as ANSWER, so I can mark it as the correct answer. I used https://askubuntu.com/questions/83037/how-do-i-reinstall-grub2 , so you may just copy and paste here as ANSWER. – BsAxUbx5KoQDEpCAqSffwGy554PSah May 25 '22 at 13:29

2 Answers2

0

Reinstalling GRUB did fix the boot problem:

  1. Open the live version of Ubuntu (either burn the LiveCD or install the image to a bootable USB device using Startup Disk Creator);
  2. Open terminal and run sudo fdisk -l to see where Linux is installed on;
  3. Run sudo mount /dev/sdxY /mnt where x is altter and Y a number you have found in the previous step;
  4. Run sudo grub-install --root-directory=/mnt /dev/sdx to install grub;
  5. Run sudo update-grub to update grub;
  6. Run sudo shutdown -r now to reboot.

Source: How do I reinstall grub2? [duplicate]. Black Block @ Ask Ubuntu. November 26, 2011.

-1

update-grub will not work on modern UEFI systems w/ TPM 2.0. It will return a "Unable to set EFI" error. Furthermore, even attempting to re-install Ubuntu from a live USB seems to still be unable to fix the boot sector, and the drive is pretty much bricked. At least in my experience on a MSI B660a & i9 12900K