I recently ran into an odd GRUB-related issue after using Macrium Reflect to clone a 120GB SSD containing a Linux Mint install to a larger 250GB drive.
Any attempt to update or install packages returned the following error from the package manager –
Setting up grub-efi-amd64-signed (1.187.6+2.06-2ubuntu14.4) ...
mount: /var/lib/grub/esp: special device /dev/disk/by-id/ata-Samsung_SSD_850_EVO_120GB_S21TNSAG124403L-part2 does not exist.
dpkg: error processing package grub-efi-amd64-signed (--configure):
installed grub-efi-amd64-signed package post-installation script subprocess returned error exit status 32
In addition to the obvious hassle of pop-up errors from the graphical update manager, this also affected my ability to install some additional software that relied on the package version in question. It needed to be fixed, and a wipe-and-load didn’t sound like a pleasant option.
A bit of research into the specific error code being thrown revealed that the issue likely related to the ESP (EFI System Partition) flag not being set on the new, cloned boot drive for the Linux installation.
Off to parted we go –
(parted) p all
Model: ATA Samsung SSD 850 (scsi)
Disk /dev/sde: 250GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags:
Number Start End Size File system Name Flags
1 1049kB 250GB 250GB ext4
Yeah, there it is. Let’s select the drive and set the ESP flag –
(parted) select /dev/sde
Using /dev/sde
(parted) set 1 esp on
(parted) p
Model: ATA Samsung SSD 850 (scsi)
Disk /dev/sde: 250GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags:
Number Start End Size File system Name Flags
1 1049kB 250GB 250GB ext4 boot, esp
(parted) quit
Information: You may need to update /etc/fstab.
This was followed by a sudo apt –fix-broken install to get the troublesome package installed and configured. This returned two ncurses-style screens, one of which essentially confirmed the cause of my issue –
The second was a warning message that didn’t seem to make a difference in the end –
I’m uncertain why I saw the second error, as GRUB seemingly worked fine from the specified device after a quick reboot to ensure I hadn’t unintentionally wrecked my boot drive.
I’m curious whether this whole mess could’ve been avoided by doing a dd of the two drives instead of relying on Macrium Reflect (a convenient, yet hefty, pricey and proprietary piece of work in itself). There’s something to be said about using the right tool for the job..