1

Question:

How do I boot into my UEFI? System: Lenovo Yoga 720-13IKB.

I have found only two answers so far, which suggest

systemctl reboot --firmware

and

systemctl reboot --firmware-setup

Neither work with the error message Cannot indicate to EFI to boot into setup mode: Operation not supported.

How do I boot into UEFI?

Reasoning:

After using Ubuntu exclusively for over half a year, I decided to erase my windows partition and make my system Ubuntu-exclusive, in order to get more memory for my relatively small main partition.

Unfortunately, my swap partition is right between my former windows partition and the current Ubuntu partition. In order to merge the two, I thus need to boot from a flash drive and move the swap partition to the side while it isn't in use. For that, I need to access the UEFI - so that I can select my USB stick as partition to boot from.

1
  • 1
    Are you sure you even installed in UEFI mode?
    – Daniel B
    Mar 7, 2019 at 14:55

1 Answer 1

1

No need for a Live Linux. Just disable your swap partition!

swapoff /dev/your/swap-partition

After that, just delete it. Then, do whatever you want while leaving space for a new swap partition. Only when you’re finished, create a new swap partition and check that /etc/fstab is up-to-date.

I just noticed you wrote your swap partition is between your Windows and Linux partitions. So I assume you have the following layout:

ESP | Windows C:\ | Swap | Linux /

In that case, there are two possibilities to move forward:

Use an “offline” partitioning tool (basically your Live Linux idea)

Simple, but slow.

  1. Move the partitions around as desired
  2. Check /etc/fstab

To enter your UEFI setup just keep spamming the usual keys (Del, F2, F1, ...) during startup.

“Clone” the partition while Linux is running

More complex, but faster because it only copies used space.

  1. Replace Windows partition with Linux partition
  2. Delete swap
  3. Copy over files (rsync -avHAXx / /mnt/new-root)
  4. Fix /etc/fstab on the cloned partition
    • Get partition IDs as needed with blkid
  5. Fix boot configuration
    1. Unmount /boot from host and mount it at /mnt/new-root/boot
    2. chroot /mnt/new-root
    3. update-grub
  6. Reboot to new Linux partition
  7. Delete old Linux partition
  8. Expand new Linux partition, create swap partition

About /etc/fstab

/etc/fstab contains the configuration of where to mount which partition. It also defines the swap partitions to use. It can refer to partitions by number (they change when you delete/add partitions), UUID (does not change) or label (can be changed by user, not necessarily unique).

Depending on how partitions are currently referenced in your fstab, you may have to change it after doing whatever you’re doing.

3
  • Okay, can you describe a bit closer how I check /etc/fstab? $
    – Nearoo
    Mar 7, 2019 at 17:06
  • Also, assuming something goes wrong - how do I boot from an USB drive to fix it?
    – Nearoo
    Mar 7, 2019 at 18:09
  • I just noticed that I made a wrong assumption about your partition layout. Please check my updated answer.
    – Daniel B
    Mar 8, 2019 at 8:59

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .