Score:0

How to move hard drives with Fat32 & EXT2 boot partition(s)?

gg flag

I'm trying to update the SSD on my desktop to a larger one. The computer was originally built around 2011 and has the ubuntu version upgraded over the years (currently on 18.04; I believe started on 12.04); it also dual-boots Windows through GRUB.

I booted into a live flash drive and pulled up GParted expecting to be able to just copy the partition(s) from the old drive to the new one and be good to go. Unfortunately past me wanted to have fun with the new thing at the time of creating this computer and so I found the partitions on my old SSD are the following:

/dev/sda1: Fat32 filesystem; 190MiB; 974KiB Used; flags: boot, esp
/dev/sda2: EXT2 filesystem; 244MiB; 141.03MiB used; flags: msftdata
/dev/sda3: LVM2 filesystem; 111.37GiB; "0.00 B" used; flags: lvm

I followed the instructions on this post to copy the data on the /dev/sda3 partition to a new LVM partition on the new SSD (/dev/sdb3) and copied the other two partitions over as well so the new SSD looks like:

/dev/sdb1: Fat32 filesystem; 190MiB; 974KiB Used; flags: NONE
/dev/sdb2: EXT2 filesystem; 244MiB; 141.03MiB used; flags: NONE
/dev/sdb3: LVM2 filesystem; 931.9Gib; 111.37 Gib used; flags: lvm

I know I need to at least get the boot flag back on the /dev/sdb1 partition but I'm having trouble understanding why there are what appear to be two "boot" partitions here (/dev/sdb1 only has single folder EFI whereas /dev/sdb2 has efi, extlinux, grub, and a few files that all end with -generic) and how to go about setting the proper flag(s) on them to make sure the system boots correctly again.

Main questions:

  1. What are these two "boot" partitions doing and how do they work (I'm assuming together)? 1.a. Why is one Fat32?
  2. Which of the flags on the /dev/sda partitions are important and how do I set those?
  3. Is there anything else I'm missing to make the system boot from the new SSD? I've seen many references to things like grub-update and such but I don't know enough about how that works to know what changes/commands are needed in this specific case.

Thanks a ton for any help or suggestions of things to research!

P.S. I also tried searching for an explication of this partitioning scheme but it seems my Google-fu is not up to the task.

oldfred avatar
cn flag
While 2011, it must have been early UEFI. In 2012 Microsoft required all vendors to install Windows in UEFI boot mode to gpt partitioned drives. So is drive gpt? Do not confuse an ESP - efi system partition which often has boot,esp flags and is FAT32 with a Linux /boot partition which must be Linux formatted. Grub does not use boot flag. I think boot flag on ESP is optional, but esp flag is required. You can use gparted or command line to add flags. You cannot reboot with both drives if you cloned as duplicate UUIDs are not allowed. You do not have typical UEFI Windows partitions?
gg flag
@oldfred yes, that seems to be what's going on here. The drive is GPT and so yes, I believe the `/dev/sda1/` partition is the ESP-EFI partition you mention and then the `/dev/sda2` partition is the actual boot partition for Ubuntu. I'm going to try setting those flags, remove the old SSD and see if the system will boot. My hope is that by cloning the partitions since the UUIDs did not change I don't think I'll need to mess with Grub or anything else like that?
oldfred avatar
cn flag
With UEFI, it uses a GUID as the way to know which ESP to use. In Linux it is seen as the partUUID. Then grub has a three line grub.cfg which uses configfile to load the full grub.cfg in you install. In your case the grub.cfg should be in /boot. I do not use LVM, but newer grub seems to not need /boot with LVM as in the past.
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.