then wiped my disks completely, partition tables included
then restored partition tables back with sfdisk /dev/sdX < sdX-pt.sf using Clonezilla's data
and then restored the partitions back on the disks via Clonezilla
The restored data seems to be correct and intact - partitions are manually mountable inside Clonezilla live CD, disk IDs, UUIDs, lvmids, etc. seem to match, but when I try to boot the system, I get "GRUB _" message with _ blinking cursor and no input allowed. I don't even get to the grub console. The grub config in /boot/grub.cfg of sdb3/lvm/ext4 seems to be correct, it mentions the sdb3 disk UUID and the correct lvmid. How do I fix this issue?
In more detail:
I have an HDD (sda) and an SSD (sdb). sda is a disk with NTFS sda1 partition on it I use for data storage. sdb is an OS disk with Windows 7 and Debian Linux on it in dualboot, with Debian Linux's GRUB being used to select which one to boot. sdb has sdb1 (100M NTFS Windows partition), sdb2 (NTFS Windows 7) and sdb3 (LVM ext4 Debian Linux).
I have made 3 saveparts backups:
HDD: sda1
SSD Windows: sdb1 sdb2
SSD Debian Linux: sdb1 sdb3
I then wiped the drives: filled HDD with random data and used ATA secure erase command on the SSD.
I then tried restoring the disks, but Clonezilla couldn't restore sda1 as sda1 partition didn't exist anymore after sda got wiped, so sda1 didn't appear in restoreparts as a target. I tried selecting the "device and partition" option, which made sda appear, but restoring sda1 to sda didn't create sda1 on the target disk. So I did sfdisk /dev/sda < sda-pt.sf and sfdisk /dev/sdb < sdb-pt.sf to re-create partitions on the disks, so that Clonezilla would list them when restoring parts.
With the partition table re-created, I restored sda1, sdb1, sdb2 and sdb3 parts. It all went well, I managed to mount sda1, sdb1, sdb2 and sdb3/lvm inside Clonezilla live CD. However, when I rebooted the system, I was greeted not with the usual GRUB menu asking me to select between Debian Linux and Windows 7, but with a black screen saying "GRUB _" with "_" blinking cursor, not being able to type anything. The CPU fan seems to ramp up after a minute, so it would seem like the system is doing something? But after waiting for 60 minutes with nothing new appearing on the screen I powered the system off as it's clearly not going to fix itself. I have tried playing with many different Expert options of restoreparts, including the grub restore option, all of the MBR options, etc. and I don't seem to get the system to boot past "GRUB _". How can I get get GRUB to work again?
Here is the layout of my disks, I have edited Model and label-id fields:
When restoring sdb1 sdb3 and selecting -g auto option, Clonezilla says:
Running: ocs-install-grub -p "sdb1 sdb3 " auto
The grub directory is NOT found. Maybe it does not exist (so other boot manager exists) or the file system is not supported in the kernel. Skip running grub-install.
But the grub directory exists, sdb3 has a LVM on it containing ext4 with /boot/grub directory. No idea why Clonezilla doesn't find it.
# activate LVM
vgchange-aymy-vg
# mount it
mkdir/mnt/lvm
mount/dev/mapper/my*/mnt/lvm
# prepare to chroot into itforiin/dev/dev/pts/proc/sys/run;domount--bind"$i""/mnt/lvm$i";done
chroot/mnt/lvm
# be careful, your disk might have different name, adjust as needed!
grub-install/dev/sdb
update-grub
# exit chrootexit# unmountforiin/run/sys/proc/dev/pts/dev;doumount"/mnt/lvm$i";done
umount/mnt/lvm
vgchange-anmy-vg
reboot
Now I'm able to boot into GRUB and from there into Windows 7 and Debian Linux.
Note that this is for MBR/BIOS. If your system is UEFI then I'm not sure if this will work for you so do your own research! The linked bleepingcomputer forum thread explicitly says not to do this on UEFI and provides a different UEFI method.
Last edit: MMT 2023-08-01
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
In short:
sfdisk /dev/sdX < sdX-pt.sf
using Clonezilla's dataThe restored data seems to be correct and intact - partitions are manually mountable inside Clonezilla live CD, disk IDs, UUIDs, lvmids, etc. seem to match, but when I try to boot the system, I get "GRUB _" message with _ blinking cursor and no input allowed. I don't even get to the grub console. The grub config in /boot/grub.cfg of sdb3/lvm/ext4 seems to be correct, it mentions the sdb3 disk UUID and the correct lvmid. How do I fix this issue?
In more detail:
I have an HDD (sda) and an SSD (sdb). sda is a disk with NTFS sda1 partition on it I use for data storage. sdb is an OS disk with Windows 7 and Debian Linux on it in dualboot, with Debian Linux's GRUB being used to select which one to boot. sdb has sdb1 (100M NTFS Windows partition), sdb2 (NTFS Windows 7) and sdb3 (LVM ext4 Debian Linux).
I have made 3 saveparts backups:
I then wiped the drives: filled HDD with random data and used ATA secure erase command on the SSD.
I then tried restoring the disks, but Clonezilla couldn't restore sda1 as sda1 partition didn't exist anymore after sda got wiped, so sda1 didn't appear in restoreparts as a target. I tried selecting the "device and partition" option, which made sda appear, but restoring sda1 to sda didn't create sda1 on the target disk. So I did
sfdisk /dev/sda < sda-pt.sf
andsfdisk /dev/sdb < sdb-pt.sf
to re-create partitions on the disks, so that Clonezilla would list them when restoring parts.With the partition table re-created, I restored sda1, sdb1, sdb2 and sdb3 parts. It all went well, I managed to mount sda1, sdb1, sdb2 and sdb3/lvm inside Clonezilla live CD. However, when I rebooted the system, I was greeted not with the usual GRUB menu asking me to select between Debian Linux and Windows 7, but with a black screen saying "GRUB _" with "_" blinking cursor, not being able to type anything. The CPU fan seems to ramp up after a minute, so it would seem like the system is doing something? But after waiting for 60 minutes with nothing new appearing on the screen I powered the system off as it's clearly not going to fix itself. I have tried playing with many different Expert options of restoreparts, including the grub restore option, all of the MBR options, etc. and I don't seem to get the system to boot past "GRUB _". How can I get get GRUB to work again?
Here is the layout of my disks, I have edited
Model
andlabel-id
fields:When restoring sdb1 sdb3 and selecting
-g auto
option, Clonezilla says:But the grub directory exists, sdb3 has a LVM on it containing ext4 with /boot/grub directory. No idea why Clonezilla doesn't find it.
Last edit: MMT 2023-08-01
After some research, I learned that GRUB can't be on LVM, it must be written to /dev/sdb. You should not delete
/media/root/<id>/boot/grub/
though!So what I did is follow https://www.bleepingcomputer.com/forums/t/740193/how-to-repair-or-re-install-grub-using-the-chroot-command/
Now I'm able to boot into GRUB and from there into Windows 7 and Debian Linux.
Note that this is for MBR/BIOS. If your system is UEFI then I'm not sure if this will work for you so do your own research! The linked bleepingcomputer forum thread explicitly says not to do this on UEFI and provides a different UEFI method.
Last edit: MMT 2023-08-01
Just to repeat the last message, I have solved the issue and no longer need the help. The solution I used is provided above.