You are not logged in.

#1 2020-01-31 08:38:30

7thSon
Member
Registered: 2017-05-07
Posts: 186

[SOLVED] Bootloader issues when migrating to new SSD

I'm migrating to a larger SSD and am having some issues with updating the bootloader (REFind) configuration.
The steps I've taken so far:

  • Partitioned the new disk with GParted
    The new disk has a different partition order than the old one.
    Old:
    /dev/sdo1 boot (flagged boot + esp)
    /dev/sdo2 swap
    /dev/sdo3 /
    /dev/sdo4 /home

    New:
    /dev/sdn1 boot (flagged boot + esp)
    /dev/sdn2 /
    /dev/sdn3 /home
    /dev/sdn4 swap

  • Migrated the partitions using rsync -qaHAXS according to https://wiki.archlinux.org/index.php/Rs … em_cloning

  • Booted using arch live usb and updated the refind.conf files in /boot to point to the new root partition PARTUUID (/dev/sdn2 above)

  • Mounted the new root partition, chrooted into it, mounted /boot into the chroot, ran mkinitcpio -p linux

  • Figuring I was done here, rebooted to the new disk but get the "Reboot and Select proper Boot device or Insert Boot Media in selected Boot device and press a key" error

Have I missed a step or done something in the wrong order?
My fstab isn't updated at this point, but the error I'm getting seems to concern the bootloader more than fstab?
Should I start over since I have the old disk still intact (and bootable), so I can get any files or values from it if I clean out the new /boot?

Last edited by 7thSon (2020-02-01 13:29:26)

Offline

#2 2020-01-31 12:41:34

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 25,399

Re: [SOLVED] Bootloader issues when migrating to new SSD

If you didn't yet install the bootloader into the new ESP you will want to do so. Even if it's "already there", the NVRAM entries stored in your EFI firmware will not yet be updated.

Offline

#3 2020-02-01 09:00:07

7thSon
Member
Registered: 2017-05-07
Posts: 186

Re: [SOLVED] Bootloader issues when migrating to new SSD

V1del wrote:

If you didn't yet install the bootloader into the new ESP you will want to do so. Even if it's "already there", the NVRAM entries stored in your EFI firmware will not yet be updated.

I've done that as well, and I reinstalled REFind again now just to be sure (I booted arch live usb, mounted the new root, arch-chrooted, mounted /boot into the chroot, removed all files and folder in /boot that where not initramfs images or vmlinuz files, and ran 'refind-install'). The only thing that seemed off at all was that REFind didn't create /boot/refind_linux.conf automatically.

So now I have this in my new disk /dev/sda1 /boot:

/boot
├── EFI
│   ├── BOOT
│   │   ├── BOOT.CSV
│   │   ├── bootx64.efi
│   │   ├── icons
│   │   │   └── <lots of pngs + svgs>
│   │   ├── keys
│   │   └── refind.conf
│   └── tools
├── initramfs-linux-fallback.img
├── initramfs-linux.img
├── initramfs-linux-lts-fallback.img
├── initramfs-linux-lts.img
├── refind_linux.conf
├── vmlinuz-linux
└── vmlinuz-linux-lts

where /boot/refind_linux.conf contains this:

"Boot using default options" "root=PARTUUID=0bd3005f-3965-4c29-868b-18937241258c rw add_efi_memmap initrd=/boot/initramfs-linux.img"
"Boot using fallback initramfs" "root=PARTUUID=0bd3005f-3965-4c29-868b-18937241258c rw add_efi_memmap initrd=/boot/initramfs-linux-fallback.img"
"Boot to terminal" "root=PARTUUID=0bd3005f-3965-4c29-868b-18937241258c rw add_efi_memmap initrd=/boot/initramfs-linux.img systemd.unit=multi-user.target"

Where the above PARTUUID is the ID for my new root partition on /dev/sda2 (dev/sdb being the old disk), blkid output:

/dev/sda1: UUID="0B56-548E" BLOCK_SIZE="512" TYPE="vfat" PARTLABEL="boot" PARTUUID="b875d012-ca37-41af-98a2-ece91f37758c"
/dev/sda2: UUID="34b0161c-ab4a-4cbe-9623-79920614bfe9" BLOCK_SIZE="4096" TYPE="ext4" PARTLABEL="root" PARTUUID="0bd3005f-3965-4c29-868b-18937241258c"
/dev/sda3: UUID="ff50f71a-0a80-4aef-a75e-8320d7e905fe" BLOCK_SIZE="4096" TYPE="ext4" PARTLABEL="home" PARTUUID="e585e5f4-0227-48ca-82dc-50b7bd43ab73"
/dev/sda4: UUID="4df0cce4-235e-4e29-953a-43921271d54c" TYPE="swap" PARTLABEL="swap" PARTUUID="7b776fc9-ae18-44d6-9ba1-bb6824602496"
/dev/sdb1: UUID="7CE0-4A06" BLOCK_SIZE="512" TYPE="vfat" PARTLABEL="boot" PARTUUID="621488e5-5b06-48a3-9797-0d6209738caf"
/dev/sdb2: UUID="2de6b80e-78d9-4f40-90a3-e6812b2dda94" TYPE="swap" PARTLABEL="swap" PARTUUID="a6d55712-1b47-4f41-9e94-b0ed0fff0675"
/dev/sdb3: UUID="d950e6d9-07de-4a50-b559-bc72fdddc539" BLOCK_SIZE="4096" TYPE="ext4" PARTLABEL="root" PARTUUID="997c979c-5079-43df-9722-192c30f35b78"
/dev/sdb4: UUID="f5886326-a769-4191-9bdc-5becaaa38395" BLOCK_SIZE="4096" TYPE="ext4" PARTLABEL="home" PARTUUID="5926f8b1-bc1d-45ea-b06c-e4dd61dc9562"

Here are the contents of my /boot/EFI/BOOT/refind.conf
Where the Arch Linux section is seen below, I just changed the PARTUUID here and removed the line "disabled" at the end.

menuentry "Arch Linux" {
    icon     /EFI/refind/icons/os_arch.png
    volume   "Arch Linux"
    loader   /boot/vmlinuz-linux
    initrd   /boot/initramfs-linux.img
    options  "root=PARTUUID=0bd3005f-3965-4c29-868b-18937241258c rw add_efi_memmap"
    submenuentry "Boot using fallback initramfs" {
        initrd /boot/initramfs-linux-fallback.img
    }
    submenuentry "Boot to terminal" {
        add_options "systemd.unit=multi-user.target"
    }
}

I'm stumped as to why I'm not able to boot from this disk at this point, and the error message of selecting a "proper boot device" doesn't really point me in any direction for troubleshooting.
One thing I haven't been able to verify is whether the new root partition on my new disk is actually healthy any bootable I guess, and I'm not really sure about how to do that. I migrated between the disks using rsync, so I would expect it to be pretty solid though.

Last edited by 7thSon (2020-02-01 09:08:03)

Offline

#4 2020-02-01 09:05:33

d_fajardo
Member
Registered: 2017-07-28
Posts: 1,687

Re: [SOLVED] Bootloader issues when migrating to new SSD

Did you run efibootmgr again to create an NVRAM entry in your motherboard?
Also I believe your refind_linux.conf should be enough and you don't really need your menuentry.

Last edited by d_fajardo (2020-02-01 09:09:17)

Offline

#5 2020-02-01 09:08:58

7thSon
Member
Registered: 2017-05-07
Posts: 186

Re: [SOLVED] Bootloader issues when migrating to new SSD

d_fajardo wrote:

Did you run efibootmgr again to create an NVRAM entry in your motherboard?

That I did not... am I supposed to do that in the arch-chroot as well?

Offline

#6 2020-02-01 09:15:21

d_fajardo
Member
Registered: 2017-07-28
Posts: 1,687

Re: [SOLVED] Bootloader issues when migrating to new SSD

Yes, I believe so. Have a look at this.
Because of the change from /dev/sdo1 to /dev/sdn1, you need to have a new NVRAM entry for the new name device. You might as well delete the old one if that's not going to be used.

Offline

#7 2020-02-01 09:44:59

7thSon
Member
Registered: 2017-05-07
Posts: 186

Re: [SOLVED] Bootloader issues when migrating to new SSD

d_fajardo wrote:

Yes, I believe so. Have a look at this.
Because of the change from /dev/sdo1 to /dev/sdn1, you need to have a new NVRAM entry for the new name device. You might as well delete the old one if that's not going to be used.

I updated the EFI boot entries with efibootmgr now, but I'm still not able to boot using the new disk, same "select proper boot device" error.
I didn't go into arch-chroot to run efibootmgr though, I just ran it on my running Arch from the old OS disk.

My efibootmgr entries ("rEFInd Boot Manager" is the old disk, just "rEFInd" is the new one):

efibootmgr -v    
BootCurrent: 0001
Timeout: 1 seconds
BootOrder: 0002,0001,0003,0000
Boot0000* Windows 10	HD(1,GPT,6790838f-5b6b-11e7-b46d-bc5ff4496923,0x800,0x32000)/File(\EFI\Microsoft\Boot\bootmgfw.efi)
Boot0001* rEFInd Boot Manager	HD(1,GPT,621488e5-5b06-48a3-9797-0d6209738caf,0x800,0x100000)/File(\EFI\refind\refind_x64.efi)
Boot0002* rEFInd	HD(1,GPT,b875d012-ca37-41af-98a2-ece91f37758c,0x800,0x100000)/File(\EFI\refind\refind_x64.efi)
Boot0003* Hard Drive 	BBS(HD,,0x0)AMGOAMNO........u.S.a.m.s.u.n.g. .S.S.D. .8.6.0. .E.V.O. .1.T.B....................A.................................>..Gd-.;.A..MQ..L.4.S.S.C.F.N.M.0.2.9.9.1.9.2. .K. . . . ......AMBOAMNO........u.I.N.T.E.L. .S.S.D.S.C.2.C.W.2.4.0.A.3....................A.................................>..Gd-.;.A..MQ..L.V.C.V.C.0.2.4.2.4.0.5.R.4.2.C.0.N.G. . ......AMBO

Looking at the UUIDs both rEFInd entries point to their respective disk boot partitions.
When registering the new rEFInd entry I ran this:

sudo efibootmgr --create --disk /dev/sda --part 1 --loader /EFI/refind/refind_x64.efi --label "rEFInd" --verbose

EDIT: I just realized there is not /EFI/refind/refind_x64.efi in /boot on my new disk.
I don't have the /EFI/refind folder at all, just /EFI/BOOT
Does that mean that my rEFInd installation failed somehow? And if so, what did I do wrong?

Last edited by 7thSon (2020-02-01 10:29:51)

Offline

#8 2020-02-01 12:11:26

d_fajardo
Member
Registered: 2017-07-28
Posts: 1,687

Re: [SOLVED] Bootloader issues when migrating to new SSD

Yes if you don't have refind_x64.efi  then your refind installation failed. The NVRAM needs it to boot.
You might need to backtrack and see where your installation failed. Check the rEFInd wiki again.

sudo efibootmgr --create --disk /dev/sda --part 1 --loader /EFI/refind/refind_x64.efi --label "rEFInd" --verbose

Read the wiki again. Check --create --disk is pointing to the correct partiton name.

Last edited by d_fajardo (2020-02-01 12:13:39)

Offline

#9 2020-02-01 13:29:10

7thSon
Member
Registered: 2017-05-07
Posts: 186

Re: [SOLVED] Bootloader issues when migrating to new SSD

d_fajardo wrote:

Yes if you don't have refind_x64.efi  then your refind installation failed. The NVRAM needs it to boot.
You might need to backtrack and see where your installation failed. Check the rEFInd wiki again.

sudo efibootmgr --create --disk /dev/sda --part 1 --loader /EFI/refind/refind_x64.efi --label "rEFInd" --verbose

Read the wiki again. Check --create --disk is pointing to the correct partiton name.

It seems to me that the rEFInd installer no longer reates a refind_x64.efi in /boot/EFI/BOOT/, it's now called "bootx64.efi" and after switching to it I now have the bootloader working perfectly.
Thanks for all the help!

Offline

Board footer

Powered by FluxBB