Score:0

Changing boot drive after installing new SSD

in flag

To upgrade my desktop PC (a nine year old ACER Predator G3620 with six SATA ports, one SATA III, the other five SATA II) I decided to install an SSD to replace the original mechanical hard drive. Before installing the SSD my dual-boot set up was

A small SSD connected to the SATA III port containing a Windows 10 NTFS partition, on /dev/sda3, and an ext4 partition for my Ubuntu 20.04 root, on /dev/sda5, and

a 2TB mechanical drive containing, among other partitions, an ext4 partition for /home, on /dev/sdb3, and a linux swap partition.

I'm not using EFI, but keeping the BIOS setup as it was to use legacy settings when I purchased the PC. I have Boot Priority Order|1st Boot Device [Hardisk ...].

I backed up the partition containing /home using Clonezilla and removed the mechanical drive and replaced it with a 2TB SSD. I swapped SATA ports so that the new SSD was connected to the SATA III port and the old SSD was connected to a SATA II port. Booting from a 20.04 installation USB flash drive, I used gparted to create three partitions on the new drive, which because of the switch in ports was now /dev/sda, /sda1 as ext4, slightly larger than my original /sda5 (which was now /sdb5), /sda2, also ext4, which was all of the disk except for the last 20GB which was formatted as /sda3, a linux swap partition. I then restored my /home partition to /sda3. At this point /sda3 had the same UUID as my old /sdb3 and I changed the swap partition's UUID to match that of the old swap partition.

After shutting down and removing the flash drive I powered up and everything worked as expected, with the change that df reported / mounted on /dev/sdb5 and /home mounted on /dev/sda2. At boot time I could also select my Windows 10 installation in the GRUB2 menu and it booted correctly.

I would like to make one more change, put Ubuntu 20.04 completely on the new drive and let Windows 10 have the entire small SSD, with the new drive becoming the boot disk. Using gparted on the installation flash drive I copied /dev/sdb5 (where / is mounted) to /dev/sda1 and changed the UUID of /dev/sda1 so it didn't conflict with the original /dev/sdb5.

At this point I thought that following the instructions at

https://howtoubuntu.org/how-to-repair-restore-reinstall-grub-2-with-a-ubuntu-live-cd

would do what I wanted, so I could then delete /dev/sdb5 and extend /dev/sdb3. But before I did that, I tried I making my new drive the first boot drive in the BIOS setup. However when I try to boot from it I get the error message

Reboot and Select proper Boot device or Insert Boot Media in Selected Boot device and press a key.

If I switch back to making the old drive first in the boot order, the machine boots but it uses the old root at /dev/sdb5 just as it was before I tried changing the location of GRUB.

I have tried searching for other solutions, but none seem to fit my particular situation. I thought deleting /dev/sdb5 and trying to install GRUB again might work, but I'm reluctant to try something that might completely destroy my setup. I would appreciate any suggestions.

Edit: As requested, here is the link to my Boot-info summary report

https://paste.ubuntu.com/p/QhyPBh4Csq/

oldfred avatar
cn flag
To confirm what is where: Lets see details, use ppa version with your live installer (2nd option) or any working install, not Boot-Repair ISO: Please copy & paste the pastebin link to the Boot-info summary report ( do not post report), do not run the auto fix till reviewed. https://help.ubuntu.com/community/Boot-Repair & https://sourceforge.net/p/boot-repair/home/Home/
in flag
I'm not sure if I've followed proper procedure. Should I also post at help.ubuntu.com/community/Boot-Repair?
oldfred avatar
cn flag
I prefer new clean install, but you can use Boot-Repair's advanced mode and choose the install in sda & the MBR of sda. Only install to sda. I do not like Boot-Repair's autofix with multiple drives as it installs one grub to all drives. You also want Windows boot loader in MBR of sdb. Grub only boots working Windows, so if issue, you want to be able to directly boot sdb. You also need to use gpt partitioning on sdc as MBR(msdos) has max of 2TiB. Converting to or from GPT - must have good backups. http://www.rodsbooks.com/gdisk/mbr2gpt.html If these work, I will make as answer.
in flag
Thanks oldfred. I'll use Clonezilla to backup the entire disk /dev/sdb and separately the partition /sdb5. I'll also backup /dev/sda2. If all goes south I'll have everything I need to restore my current setup. I will also eventually convert /dev/sdc but that's another project. I can use all 4TB since Western Digital sends out the drives with 4096 bit sectors instead of 512. I use the drive to hold backups, so the larger sector size doesn't create too much wasted space.
in flag
I was looking through the boot-repair report one more time and realized I had missed something. The boot flag hadn't been set for /dev/sda1. Now 20.04 boots from /dev/sda1, but I'll still have repair grub to get the Windows 10 installation as an option in the grub menu. I'll wait until I've got everything set up completely before I report this as SOLVED.
oldfred avatar
cn flag
Only Windows uses boot flag to know which BIOS/MBR partition has boot file. Grub searches for the Windows boot files to add to grub menu. And grub does not use boot flag. A few BIOS want a boot flag, so we typically still suggest one if only Linux with grub. UEFI often uses both boot flag & esp flag on the ESP - efi system partition. I also like to use gpt partitioning for all drives except those that boot Windows in BIOS mode. I started conversion to gpt back in 2010 with XP on separate MBR drive. Linux needs bios_grub partition for BIOS boot or ESP for UEFI boot if using gpt.
Score:0
in flag

Thanks to @oldfred for his advice and for pointing me in the right direction.

It was a simple oversight on my part. When I partitioned the new SSD drive I failed to flag /dev/sda1 as bootable. After doing that and changing the boot order of the drives in the BIOS everything works as I intended. I have now deleted /dev/sda5 (the old Ubuntu root) and created an extra NTFS partition in its place. So /dev/sda is all Ubuntu and /dev/sdb is Windows 10.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.