1 (edited by markfilipak.linux+Gparted 2022-08-16 06:37:31)

Topic: Failing to copy disk-to-disk, failing to boot manual part -- Help!

Hello,

Using 'gparted-live-1.4.0-5-amd64.iso'.

Years ago, when I created my Linux Mint virtual disk, the installer put Mint into an extended partition:

/dev/sda1 fat32      512MiB
/dev/sda2 extended 39.50GiB
/dev/sda5 ext4     39.50GiB
unallocated         1.00MiB

Why did it put Mint into an extended partition? I have no idea.

Today, I reduced the size of /dev/sda5:

/dev/sda1 fat32      512MiB
/dev/sda2 extended 39.50GiB
/dev/sda5 ext4     18.72GiB
unallocated        20.78GiB
unallocated         1.00MiB

I created a new virtual disk, half the size, to replace the current /dev/sda. As I write this, it's mounted as /dev/sdb.

/dev/sdb1 fat32      411MiB boot
/dev/sdb2 ext4     19.61GiB

I booted the gparted ISO and tried to bulk copy /dev/sda to /dev/sdb but failed. I tried to exactly recreate the structure of /dev/sda on /dev/sdb but failed.

I had to use 'clonezilla-live-20220620-jammy-amd64.iso' to make the new virtual disk. It doesn't boot.

I need help. What am I doing wrong?

Thanks,
Mark Filipak.

2

Re: Failing to copy disk-to-disk, failing to boot manual part -- Help!

I'm trying to follow the instructions here: https://www.mrb3n.com/?p=314.

I don't know what to make of the following:

mark@mark-VirtualBox:~$ sudo apt-get clean && apt-get autoremove
E: Could not open lock file /var/lib/dpkg/lock-frontend - open (13: Permission denied)
E: Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), are you root?
mark@mark-VirtualBox:~$ tune2fs -m 2 /dev/sda1
tune2fs 1.45.5 (07-Jan-2020)
tune2fs: Permission denied while trying to open /dev/sda1
Couldn't find valid filesystem superblock.
mark@mark-VirtualBox:~$ 

I'm in deep water way over my head.

3 (edited by markfilipak.linux+Gparted 2022-08-15 22:23:24)

Re: Failing to copy disk-to-disk, failing to boot manual part -- Help!

The target virtual disk is now:

/dev/sdb1 fat32      512MiB boot
/dev/sdb2 ext4     19.51GiB

It does not boot.

Because gparted 'copy' made the Mint disk sdb2 instead of sdb5, I suspect that the partition table doesn't match the partitions and that that's why it won't boot. But I don't know how to fix it.

4 (edited by markfilipak.linux+Gparted 2022-08-16 03:33:51)

Re: Failing to copy disk-to-disk, failing to boot manual part -- Help!

I really need help.

Continuing to try to follow the instructions here: https://www.mrb3n.com/?p=314.

I succeeded making a disk that matches the original.

/dev/sda1 fat32    512MiB boot
/dev/sda2 extended 19.51GiB
/dev/sda5 ext4     19.51GiB

And I used the gparted live cd to copy the old sda5 to the new disk above.
It would not boot, so I booted the Linux Mint live CD to reinstall GRUB.

Reinstalling GRUB fails. Whatever I do, I get this:

"The current session is in BIOS-compatibility mode. Please disable
BIOS-compatibility/CSM/Legacy mode in your UEFI firmware, and
use this software from a live-CD (or live-USB) that is compatible
with UEFI booting mode. For example, use a live-USB of Boot-
Repair-Disk-64bit (w w w . sourceforge.net/p/boot-repair-cd), after
making sure your BIOS is set up to boot USB in EFI mode. This will
enable this feature."

I don't know how to disable "BIOS-compatibility/CSM/Legacy mode in your UEFI firmware".
Further, I'm confused by the wording of the notice above.

5

Re: Failing to copy disk-to-disk, failing to boot manual part -- Help!

I tried the sourceforge Boot-Repair-Disk-64bit. It turned out to be boot-repair-disk-32bit.iso.

It acted very strangely. After much too and fro, I got this:

"Boot successfully repaired.
A new file (/var/log/boot-repair/20220816_022739/Boot-
info_20220826_0227.txt) will open in your text viewer.
In case you still experience boot problem, indicate its
content to:
boot.repair@gmail.com or to your favorite support forum.
You can now reboot you computer."

I don't think it worked. I saw the same "BIOS-compatibility" complaint as in my previous posting.
I tried to save '/var/log/boot-repair/20220816_022739/Boot-info_20220826_0227.txt' to a virtual USB that was mounted and that I could actually browse.
But later, when I got back to the Windows host and mounted the virtual USB, 'Boot-info_20220826_0227.txt' wasn't there.

I left the 19.51GiB disk attached and reattached my original Linux Mint disk, 39.50GiB, and launched the VM (in which I'm now writing this).
The 19.51GiB disk would not mount, so I was not able to get '/var/log/boot-repair/20220816_022739/Boot-info_20220826_0227.txt' at all.

Summary:
39.50GiB is my original Linux Mint disk.
I successfully resized its 1st extended partition to 18.72GiB, so I'll call it the 18.72GiB partition.
19.51GiB is the new disk to which I'm trying clone the 18.72GiB partition.
The cloning appeared to work, but I can't boot the 19.51GiB disk and I can't repair it or reinstall GRUB because of the "BIOS-compatibility" complaint.
I'm dead in the water, except that I can (and have) booted the 18.72GiB partition (in which I'm writing this).
I'll tell you one thing: If Linux Mint was a bare metal install instead of a virtual machine, I would have gotten nowhere.

6 (edited by mfleetwo 2022-08-16 10:15:10)

Re: Failing to copy disk-to-disk, failing to boot manual part -- Help!

The first hit when googling for that error "BIOS-compatibility/CSM/Legacy mode in your UEFI firmware" is
boot repair fails to help : The current session is in BIOS-compatibility mode.
Try following those instructions to fix booting of Linux Mint on that smaller drive.

7 (edited by markfilipak.linux+Gparted 2022-08-16 20:35:35)

Re: Failing to copy disk-to-disk, failing to boot manual part -- Help!

Thank you, mfleetwo. All is Joy, now.

mfleetwo wrote:

The first hit when googling ...

I didn't search with Google.

... for that error "BIOS-compatibility/CSM/Legacy mode in your UEFI firmware" is
boot repair fails to help : The current session is in BIOS-compatibility mode.
Try following those instructions to fix booting of Linux Mint on that smaller drive.

By the way, the commands should be

sudo mount /dev/sda5 /mnt
for i in /dev /dev/pts /proc /sys /run; do sudo mount -B $i /mnt$i; done
sudo chroot /mnt
sudo grub-install /dev/sda
sudo update-grub

Why doesn't gparted do all that automatically?

PS: Though I only vaguely know what the next line 'says', it seems to me that it's superfluous.

for i in /dev /dev/pts /proc /sys /run; do sudo mount -B $i /mnt$i; done

8

Re: Failing to copy disk-to-disk, failing to boot manual part -- Help!

I am glad you sorted your issue.

GParted doesn't restore boot loaders because it is a complicated problem space with multiple boot loaders with complicated configuration which distribution installers setup and users occasionally reconfigure.  The GParted Manual does have some generic instructions on Fixing GRUB boot broblems but you were still better off with specific instructions for Ubuntu / Mint.