I couldn't boot from the disk after restore.
The system has 3 disks, 240GB SSD (sda), 320GB HDD (sdb), 320GB HDD (sdc).
I want to be able to boot debian buster from any 1 of the 3 disks by selecting the boot disk from the Bios.
The system used to have win7 installed with similar operation to below (without grub) and it worked from each disk.
I am trying to migrate from windows to Debian Buster.
I have installed buster on each of the disks from a live installation dvd (10.2) with 4 primary msdos partitions.
- /boot ........... ext2 512MB
/ .................. ext4 16GB
swap .......... 8GB
/home ......... ext4 rest of disk
To test backup and recovery, I backup from sdb and recover to sdc.
The backup process is as follows:
- Boot from sda
save the partition information with sfdisk --dump /dev/sdb > sdb.dump
save the MBR information (and partition info) with dd if=/dev/sdb of=backup-sdb.mbr bs=512 count=1
mount the partitions to /disks/Bkp-Boot /disks/Bkp-Root /disks/Bkp-Home
backup sdb (using tar for /boot, /, /home to separate files)- tar -C /disks/Bkp-Boot -cvzf sdb-Boot_20200122.tar.gz --one-file-system ./ > sdb-Boot_20200122.txt 2>&1
tar -C /disks/Bkp-Root -cvzf sdb-Root_20200122.tar.gz --one-file-system ./ > sdb-Root_20200122.txt 2>&1
tar -C /disks/Bkp-Home -cvzf sdb-Home_20200122.tar.gz --one-file-system ./ > sdb-Home_20200122.txt 2>&1
- tar -C /disks/Bkp-Boot -cvzf sdb-Boot_20200122.tar.gz --one-file-system ./ > sdb-Boot_20200122.txt 2>&1
The restore process (from backup of sdb to "new" disk sdc) is as follows:
- boot from sda
restore the MBR and partition info with "dd if=backup-sdb.mbr of=/dev/sdc bs=512 count=1".- with or without the previous step, yields the same result.
verify that the partitions are created correctly with sfdisk -l /dev/sdc
initialize the file systems and swap- mkfs.ext2 -L Bkp-Boot /dev/sdc1
mkfs.ext4 -L Bkp-Root /dev/sdc2
mkswap -L Bkp-Swap /dev/sdc3
mkfs.ext4 -L Bkp-Home /dev/sdc4
verify that the partitions are mounted correctly with mount -l | grep sdc
restore /boot, /, /home to sdc- tar -xvf sdb-Boot_20200122.tar.gz -C /disks/Bkp-Boot --numeric-owner > sdc-Boot_Restore_20200122.txt 2>&1
tar -xvf sdb-Root_20200122.tar.gz -C /disks/Bkp-Root --numeric-owner > sdc-Root_Restore_20200122.txt 2>&1
tar -xvf sdb-Home_20200122.tar.gz -C /disks/Bkp-Home --numeric-owner > sdc-Home_Restore_20200122.txt 2>&1
execute "grub-install /dev/sdc" reports no errors. This is not required
- mount /dev/sdc1 /disks/Bkp-Root/boot
for i in /dev /dev/pts /proc /sys /run; do mount -B $i /disks/Bkp-Root$i; done
chroot /disks/Bkp-Root
grub-install /dev/sdc
update-grub
ctrl-d to exit chroot
reboot system and select "boot from sdc" in bios.
The system now boots to /dev/sdc.
these lines are no longer relevant:
The system boots but goes to /dev/sdb instead of /dev/sdc.
I used kdiff3 to compare the /boot/grub/grub.cfg on sdb and sdc and they are identical, indicating that the grub-install did not change the grub info on sdc.
I arrived at this process after several days of googling and trying different suggestions and trying to understand the grub information, but I have run out of ideas on how to resolve this.
Any thoughts on what I need to do to be able to boot from sdc at this point?
thanks for any assistance.