Move /boot/efi and /boot partitions from USB stick on working system to a new drive on same system.

I have used an USB stick to support /boot/efi and /boot partitions because my machine BIOS is not able to boot from PCi NVMe partition, which holds the remainder of my operating system.

I now have the space to install these partitions on a hard drive on the system and thus remove the USB.

If I create the new partitions on the hard drive, how may I copy the contents from the USB and then enable booting from the hard drive with USB removed?

Since I don’t have your computer in front of me, I will have to guess.

The first step is to make sure that your new disk partition is seen as an EFI partition. The output of “parted -l” will probably tell you that.

Next is to make sure that it is mounted at “/boot/efi”. That may require adjusting “/etc/fstab”.

You can test that by rebooting, and being sure that it mounts as wanted. Note that until you have changed EFI settings, you will still need that USB for the booting test. Booting with EFI does not itself require that “/boot/efi” be mounted, because booting starts before anything is mounted.

Once that is done, you can delete the boot entry:


# efibootmgr -v
BootCurrent: 0000
Timeout: 1 seconds
BootOrder: 0001,0000
Boot0000* opensuse-secureboot   HD(1,GPT,8daf0950-e06b-4ac4-90fd-e966912fa23e,0x800,0xfa000)/File(\EFI\opensuse\shim.efi)
Boot0001* Windows Boot Manager  HD(1,GPT,a0547a0a-57c0-405d-b6b9-a01ca4839f0f,0x800,0xfa000)/File(\EFI\Microsoft\Boot\bootmgfw.efi)WINDOWS.........x...B.C.D.O.B.J.E.C.T.=.{.9.d.e.a.8.6.2.c.-.5.c.d.d.-.4.e.7.0.-.a.c.c.1.-.f.3.2.b.3.4.4.d.4.7.9.5.}...}................

That’s the output of “efibootmgr -v” on my main desktop. The boot entry for openSUSE is entry “Boot0000”. I would delete that with:

efibootmgr -b 0000 -B

And then go into Yast Boot Loader, and change something. Maybe increase the timeout by 1 second. Note that there is an option for “update NVRAM entry”. Make sure that is checked. If you don’t want it checked you can change that later. But for now you are updating the NVRAM entry.

That should make sure that everything needed is set in your new EFI partition and it should update NVRAM. You can check with

efibootmgr -v

The updated entry should include the PARTUUID for your new EFI partition.

After that is all done, you can reboot to test. You might also test rebooting with the USB by telling your BIOS to boot from the USB. And that should still work (just in case you make a mistake setting it up).

Hi and thanks for the advice. For reasons I don’t yet understand I cannot re-size the partition on my drive. The drive is on an hardware RAID array and has only one partition which is not mounted. I had no difficulty doing the same thing on an almost identical machine using gparted but on the subject machine no re-sizing is possible so I may have to abandon my plan for now.
If there are any obvious issues I have overlooked please let me know.
Budge

I have avoided RAID, so I have no experience with it. Sorry, but I do not have any helpful suggestions here.

Hi, I have now succeeded in creating the required partitions on my drive and have edited the /etc/fstab file to add these partitions to the file.

I have one question concerning the mounting of the /boot and /boot/efi partitions. How may I do this when partitions with these names are already mounted? What command should I use?

I should have added that I tried to mount these partitions theus

sudo mount /dev/sda1 /boot/efi
sudo mount /dev/sda2 /boot

but on re-boot they were not mounted. Where am I going wrong please?

A supplementary question. I have put both /boot and/boot/efi onto a USB stick because I could not boot from NVMe. Do I need to put both the /boot and /boot/efi partitions on the hard drive or can I put the /boot partition also on NVME and only have the /boot/efi partion of the hard drive?

Hi
Nope, both /boot/efi and /boot need to be on the USB…


lsblk

NAME        MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sda           8:0    1   7.6G  0 disk 
├─sda1        8:1    1   260M  0 part /boot/efi
├─sda2        8:2    1   512M  0 part /boot
└─sda3        8:3    1   6.9G  0 part [SWAP]
nvme0n1     259:0    0 232.9G  0 disk 
├─nvme0n1p1 259:1    0   100G  0 part /
└─nvme0n1p2 259:2    0 132.9G  0 part /var

 parted -l
Model: PNY USB 2.0 FD (scsi)
Disk /dev/sda: 8167MB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags: 

Number  Start   End     Size    File system     Name                  Flags
 1      1049kB  274MB   273MB   fat16           EFI system partition  boot, esp
 2      274MB   811MB   537MB   btrfs
 3      811MB   8167MB  7356MB  linux-swap(v1)                        swap


Model: NVMe Device (nvme)
Disk /dev/nvme0n1: 250GB
Sector size (logical/physical): 4096B/4096B
Partition Table: gpt
Disk Flags: 

Number  Start   End    Size   File system  Name  Flags
 1      1049kB  107GB  107GB  btrfs
 2      107GB   250GB  143GB  btrfs

I’m losing track of where you are.

You do have to unmount the old partitions before mounting the new.

Hi nrickert, I have misunderstood:

You can test that by rebooting, and being sure that it mounts as wanted. Note that until you have changed EFI settings, you will still need that USB for the booting test. Booting with EFI does not itself require that “/boot/efi” be mounted, because booting starts before anything is mounted.

So you mean I must unmount the working, mount the new and try it.
OK, fingers crossed!

Hi Malcolm,
I asked this because in an earlier related thread you suggested I didn’t need the /boot on the usb. As it is I have left both on the hard drive as I didn’t reach a satisfactory outcome earlier.
Hope this works.

Hi
That might have been when on the RAID? As long as not on the nvme device it can be anywhere that can be mounted…

Strange but I couldn’t mount the /boot/efi partition which was “not found.” Using Yast partition tool however I found it had been mounted but does not show up in lsblk -f.
Took a chance and booted anyhow and here I am, so many thanks. All I have to do now is clean up and remove USB stick.
Very many thanks once again,
Regards,
Budge.

Well not quite! It would help if I copied over the contents of /boot and /boot/efi to the new partitions rather than just creating them. Duh!

In fact I am still using the RAID array and have put the two booting partitions on that drive.

The problem earlier was caused by the serious probing done by the installation when starting from scratch. Even so, installation on a RAID array is not usually a problem but in my particular case it was.

To solve the problem in this case I made some space by reducing the size of the partition and then created the partitions using Yast from a working system using empty space on the RAID drive. Doing it this way was simple.

All the trouble earlier was the result of the installation prober looking past the RAID array and getting to the drives. I have never come across this before on any of my hardware RAID arrays. At least I now know what to look out for in future.

Many thanks again for all your help.

Budge

Rebooting unmounts everything.

If I comment out the “fstab” entry for “/boot” and for “/boot/efi”, my system will still boot. And most everything will work, until I do some updates that might require those partitions to be mounted.

Sadly I have not been so fortunate and having edited out the USB stick from my fstab I cannot boot even using pre-boot bios system so I shall have to use my live DVD.

Remind me please, how I can edit the files on the installed system from live system. I tried but couldn’t mount the installed which is on /dev/nvmexxx? (dont have details in front of me now).

Now booting as normal so this is what I have:-

alastair@ibmserver3:~> lsblk
NAME        MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sda           8:0    0   5.5T  0 disk 
├─sda1        8:1    0   500M  0 part /boot/efi
├─sda2        8:2    0     2G  0 part /boot
└─sda3        8:3    0   5.5T  0 part /multimedia
sdb           8:16   1  28.9G  0 disk 
├─sdb1        8:17   1   500M  0 part 
└─sdb2        8:18   1     2G  0 part 
sr0          11:0    1 943.4M  0 rom  
sr1          11:1    1  1024M  0 rom  
nvme0n1     259:0    0   1.8T  0 disk 
└─nvme0n1p1 259:1    0   1.8T  0 part /var
alastair@ibmserver3:~> 

Boot order is strange but works:-

alastair@ibmserver3:~> sudo efibootmgr -v
[sudo] password for root: 
BootCurrent: 0007
Timeout: 10 seconds
BootOrder: 0007,0001,0002,0003,0004,0005,0006,0000,0008,0009,000A,000B,000C,000E
Boot0000* CD/DVD Rom    PciRoot(0x0)/Pci(0x1f,0x2)/Ata(0,0,0)/CDROM(1,0x740e0,0x7800)
Boot0001* Floppy Disk   VenMedia(0c588db8-6af4-11dd-a992-00197d890238,00)
Boot0002* Hard Disk 0   VenMedia(0c588db8-6af4-11dd-a992-00197d890238,08)
Boot0003* PXE Network   PciRoot(0x0)/Pci(0x1,0x0)/Pci(0x0,0x0)/MAC(3440b592a054,0)/IPv4(0.0.0.00.0.0.0,0,0)
Boot0004* Hard Disk 1   VenMedia(0c588db8-6af4-11dd-a992-00197d890238,09)
Boot0005* Hard Disk 2   VenMedia(0c588db8-6af4-11dd-a992-00197d890238,0a)
Boot0006* Hard Disk 3   VenMedia(0c588db8-6af4-11dd-a992-00197d890238,0b)
Boot0007* opensuse      HD(1,GPT,bb17f2bd-67b7-41b2-9527-19d1beca5cb2,0x800,0xfa000)/File(\EFI\opensuse\grubx64.efi)
Boot0008* Diagnostics   VenMedia(0c588db8-6af4-11dd-a992-00197d890238,da)
Boot0009* iSCSI VenMedia(0c588db8-6af4-11dd-a992-00197d890238,04)
Boot000A* iSCSI Critical        VenMedia(0c588db8-6af4-11dd-a992-00197d890238,05)
Boot000B* Legacy Only   VenMedia(0c588db8-6af4-11dd-a992-00197d890238,ee)
Boot000C* Embedded Hypervisor   VenMedia(0c588db8-6af4-11dd-a992-00197d890238,01)
Boot000E* USB Storage   PciRoot(0x0)/Pci(0x1a,0x7)/USB(0,0)/HD(2,GPT,21800a4c-ab06-4d3c-a1c4-619a3eaf4a31,0xfa800,0x400000)
alastair@ibmserver3:~>

I have no idea what all the VenMedia UUIDs are about and I had no sight of the 500 MB FAT partition which contains the EFI partition. In other words I am not conscious of copying it from the USB to /dev/sda1. It just appeared there after I had done everything else and rebooted.

Maybe this, from a PC here with RAID, NVME and separate /boot partition, will help clarify a mental image:

# efibootmgr -v
BootCurrent: 0000
Timeout: 1 seconds
BootOrder: **0000**,0003,0004
**Boot0000* opensusetw**    HD(1,GPT,...4c**1de4**,0x800,0xa0000)/File(\EFI\OPENSUSETW\GRUBX64.EFI)
Boot0003* Hard Drive    BBS(HD....BO
Boot0004* CD/DVD Drive  BBS(CDROM....BO
# blkid | grep **1de4**
**/dev/nvme0n1p1**: SEC_TYPE="msdos" LABEL_FATBOOT="PI3P01**ESP**" LABEL="PI3P01ESP" UUID="..." BLOCK_SIZE="512" TYPE="**vfat**" PARTLABEL="MuP P01 EFI System  (**ESP**)" PARTUUID="...4c**1de4**"
# parted -l | grep **ESP**
 1      1049kB  337MB   336MB   fat16           MuP P01 EFI System  (**ESP**)    boot, **esp**
# mount | egrep ' / |boot'
/dev/md3 on / type ext4 (rw,noatime)
/dev/nvme0n1p3 on /boot type ext2 (rw,noatime,noacl)
/dev/**nvme0n1p1** on **/boot/efi** type vfat (rw,noatime,fmask=0002,dmask=0002,allow_utime=0020,codepage=437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro)

Hi
Not sure it will as both the OP and myself are unable to boot from the nvme device as no BIOS support… hence boot and boot/efi on a normal device (USB, SATA etc)

I was trying to show relationships, and particularly that of the UUID of the opensuse entry in efibootmgr output. Pretend where nvme is shown in post #8 that it is sda. I’m having a hard time understanding the difficulty Budgie seems to be having understanding the relationships involved.

On that partitular PC, before yesterday, there was a UEFI TW installation exclusively on NVME, and another TW exclusively on a pair of MBR HDDs, major portions of which are devoted to several MD devices, other portions of which are non-RAID for boot, /tmp and swap. Yesterday on the latter, I “moved” (copied actually, but moved according to fstab) TW’s boot from MBR HDD to UEFI NVME, and added a stanza for it to the UEFI system’s custom.cfg, so that mounting the ESP to /boot/efi was optional, and YaST, os-prober and/or Grub modifications/updates were unnecessary.