I tried deleting Windows partition but now I can’t boot to anything except for live USB

Hii
So I’m suuper new to linux and fedora
I was dual-booting with Windows and Fedora so far
I decided to fully go with Linux and booted into GParted live where I deleted the main Windows partition and some other partition that had something with Microsoft in it’s name
Now when booting, I boot straight into live GParted USB
I went to BIOS and there are no other boot options now
I suspect I removed some bootloader but I have no idea how to fix it
I tried searching online and following the steps some people listed, but I did not understand a thing and in the end couldn’t follow them
The explanations said stuff like „chroot into fedora from live usb” so I tried searching for what this chroot is and trying to mount some partitions from gparted live and making an efi partition with tags like boot and esp for a few hours but I didn’t get anywhere for a long time
And when I finally got into this „chroot” (no idea how, since when i tried doing it again i can’t once more) I tried pasting some commands that reinstalled grub or something, but I got an error that I couldn’t get hostname
Any help is greatly appreciated, since I’ve been trying to boot up my pc for like 5 hours and still cant get fedora to show up

Do you have a live usb with fedora on it? You could use that to try and repair your grub/boot menu. You would boot into live mode and then use the terminal to repair the grub. Like grub-install and update-grub . System Rescue

I assume you’ve done this, but you HAVE removed the LiveUSB from your system haven’t you? It’s not still plugged in and top of the boot priority?

Right, it sounds like you may have deleted an EFI partition that was shared by Windows and Fedora.

Sounds like you are going in the right direction. Can you show us the exact command you tried, and the exact error message you got?

Ahh… that makes more sense. I missed the part where the OP deleted the windows partition “and some other other partition”.

The EFI partition is like a Bios which stores information about your computer. When you remove that the computer can not boot anymore because the information, to exchange data with it, is missing.

Creating a new EFI is the right way to go. But before doing more on your own, it would probably be a good idea to give us a bit more information about your system inkl. Fedora Version.

I think also a overview what you have on your disk now would make sense:

 sudo fdisk -l

Can you post the output for us?

1 Like

well, now I can’t even get to chroot, when I do

sudo chroot /mnt

in the live fedora usb, i get an error “unable to allocate pty: No such device”
i suspect i’m mounting something incorrectly, but I have no idea what (filesystem of fedora installation is btrfs)

what I used is: (i found it somewhere else online)

sudo mount -o subvol=root /dev/nvme0n1p6 /mnt
sudo mount /dev/nvme0n1p1 /mnt/boot
sudo mount /dev /mnt/dev
sudo mount /proc /mnt/proc
sudo mount /sys /mnt/sys
sudo chroot /mnt

(nvme0n1p6 is fedora installation, nvme0n1p1 is the VFAT partition I made earlier with GParted with tags boot and esp)

You can use the official guide in the Fedora documentation: Restoring the bootloader using the Live disk.

When you follow that, your new VFAT partition will be mounted at /mnt/boot/efi. (/mnt/boot will be your Linux boot partition, which is the [probably] 2 GiB partition the Fedora installer made).

1 Like

I followed the steps exactly from this Fedora docs guide and everything seemed to work fine, the reinstall also succeeded and I got no errors, but then when rebooting I didn’t get anything, just a black screen, then it tried again by itself and sent me to BIOS, now in BIOS I had 2 options:

  • Live USB
  • Fedora

Fedora didn’t work, no GRUB menu, no nothing, just black screen and back to BIOS

Could you go back to the Live USB, do the chroot steps again, and show the outputs of these commands:

efibootmgr
sudo cat /boot/efi/EFI/Fedora/grub.cfg
lsblk -f

efibootmgr

BootCurrent: 0005
Timeout: 1 seconds
BootOrder: 0006,0005
Boot0004* UEFI OS       HD(1,GPT,9c35f4d7-d04f-4ea1-bbba-b89ddee9c701,0x800,0xfa000)/\EFI\BOOT\BOOTX64.EFI0000424f
Boot0005* UEFI: SanDisk, Partition 2    PciRoot(0x0)/Pci(0x2,0x1)/Pci(0x0,0x0)/Pci(0x8,0x0)/Pci(0x0,0x0)/Pci(0xc,0x0)/Pci(0x0,0x0)/USB(4,0)/HD(2,GPT,09d661a4-d7d4-4d99-8ec5-b91e3365d7f0,0x606428,0xf000)0000424f
Boot0006* Fedora        HD(1,GPT,9c35f4d7-d04f-4ea1-bbba-b89ddee9c701,0x800,0xfa000)/\EFI\fedora\shimx64.efi0000424f

sudo cat /boot/efi/EFI/Fedora/grub.cfg

search --no-floppy --root-dev-only --fs-uuid --set=dev df6d5e3b-cf90-4e4b-b7fa-a29463514a62
set prefix=($dev)/root/boot/grub2
export $prefix
configfile $prefix/grub.cfg

lsblk -f
(sda and sdb are storage drives, the one with the system is nvme0n1)

NAME      FSTYPE  FSVER     LABEL              UUID                                 FSAVAIL FSUSE% MOUNTPOINTS
loop0     erofs                                c49c3ecb-832b-440f-89b5-a601286ebff0                
sda                                                                                                
├─sda1    ntfs              Dodatkowy          F48607368606F8BE                                    
└─sda2    ntfs                                 8C0E8A130E89F68C                                    
sdb                                                                                                
├─sdb1    ntfs              Magazynowy         B680DD6280DD299F                                    
└─sdb2    btrfs             MagazynLinux       45be8b43-6ad0-4f7f-b3b6-3594b15da000                
sdc       iso9660 Joliet Ex Fedora-KDE-Live-43 2025-10-23-04-17-29-00                              
├─sdc1    iso9660 Joliet Ex Fedora-KDE-Live-43 2025-10-23-04-17-29-00                              
└─sdc2    vfat    FAT16     BOOT               BA0E-CF8F                                           
zram0     swap    1         zram0              4c69567e-5118-47ee-998d-1efd5d55d5df                [SWAP]
nvme0n1                                                                                            
├─nvme0n1p1
│         vfat    FAT32     EFI                D9A0-9423                             479.7M     4% /boot/efi
├─nvme0n1p5
│         ext4    1.0                          c48b7c47-1a5a-4012-88b7-1d8ad59cd8ca    1.2G    30% /boot
├─nvme0n1p6
│         btrfs             fedora             df6d5e3b-cf90-4e4b-b7fa-a29463514a62  209.4G    64% /
└─nvme0n1p7
          ntfs                                 7AF20550F20511D5                 

Thanks. So this part looks wrong (in grub.cfg):

search --no-floppy --root-dev-only --fs-uuid --set=dev df6d5e3b-cf90-4e4b-b7fa-a29463514a62
set prefix=($dev)/root/boot/grub2

That’s pointing to your main btrfs partition, and looking for a “/boot” directory in the root subvolume.

It’s possible to set the system up like that, but it doesn’t work well on btrfs and it’s not the Fedora default. Normally, /boot is a separate partition, and the EFI partition’s grub.cfg should point to that partition.

However it’s surprising that the GRUB reinstall process would create the file wrong in this way.

Just to check the setup before we change anything, can you show the output of this command (in the chroot environment) -

cat /etc/fstab

there you go

cat /etc/fstab

#
# /etc/fstab
# Created by anaconda on Thu Jan 29 01:08:34 2026
#
# Accessible filesystems, by reference, are maintained under '/dev/disk/'.
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info.
#
# After editing this file, run 'systemctl daemon-reload' to update systemd
# units generated from this file.
#
UUID=9c35f4d7-d04f-4ea1-bbba-b89ddee9c701 /boot/efi vfat umask=0077,shortname=winnt 0 2
UUID=df6d5e3b-cf90-4e4b-b7fa-a29463514a62 / btrfs subvol=root,compress=zstd:1 0 0
UUID=c48b7c47-1a5a-4012-88b7-1d8ad59cd8ca /boot ext4 defaults 1 2
UUID=7C6E-1FFB /boot/efi vfat umask=0077,shortname=winnt 0 2
UUID=df6d5e3b-cf90-4e4b-b7fa-a29463514a62 /home btrfs subvol=home,compress=zstd:1 0 0
UUID=45be8b43-6ad0-4f7f-b3b6-3594b15da000 /run/media/erky/MagazynLinux btrfs defaults,nofail

also, earlier when i followed some other guides i might have made some changes to fstab, I’m not sure but I’m pretty sure some tutorial said something about it, so there could be something wrong here

OK, you have two lines for /boot/efi and both of them are wrong :grinning_face:

Can you edit the file (sudoedit /etc/fstab inside the chroot) and do this:

  1. Delete the first entry for /boot/efi (the one that starts UUID=9c35…)
  2. Edit the remaining entry for /boot/efi, changing 7C6E-1FFB to D9A0-9423 as per your lsblk output

Then:

  1. Do the GRUB reinstall steps again from the documentation
  2. Once again do sudo cat /boot/efi/EFI/Fedora/grub.cfg and see if it has changed

Edit: one more question. When setting up the chroot, did you do mount /dev/nvme0n1p5 /mnt/boot ? Without that, I can see that the GRUB install wouldn’t know where the boot partition was.

when doing it for the first time, I think I didn’t do that step, but later when trying again I did mount the boot partition

as specified, i changed /etc/fstab to

UUID=df6d5e3b-cf90-4e4b-b7fa-a29463514a62 / btrfs subvol=root,compress=zstd:1 0 0
UUID=c48b7c47-1a5a-4012-88b7-1d8ad59cd8ca /boot ext4 defaults 1 2
UUID=D9A0-9423 /boot/efi vfat umask=0077,shortname=winnt 0 2
UUID=df6d5e3b-cf90-4e4b-b7fa-a29463514a62 /home btrfs subvol=home,compress=zstd:1 0 0
UUID=45be8b43-6ad0-4f7f-b3b6-3594b15da000 /run/media/erky/MagazynLinux btrfs defaults,nofail

i did the reinstall steps from the docs, then did the sync && exit and rebooted as specified in the docs, now i’m back in the live usb

now it returns this (pretty sure it’s the same, no?)
cat /boot/efi/EFI/Fedora/grub.cfg

search --no-floppy --root-dev-only --fs-uuid --set=dev df6d5e3b-cf90-4e4b-b7fa-a29463514a62
set prefix=($dev)/root/boot/grub2
export $prefix
configfile $prefix/grub.cfg

Yes, it does seem to be the same :slightly_frowning_face:

What I think that file should be is this:

search --no-floppy --root-dev-only --fs-uuid --set=dev c48b7c47-1a5a-4012-88b7-1d8ad59cd8ca
set prefix=($dev)/grub2
export $prefix
configfile $prefix/grub.cfg

(First two lines are different from what you have now, last two lines are the same.)

I don’t really love manually editing files without knowing the root cause, but you could try editing this file and then seeing whether you can boot successfully.

oh, wow, this actually worked perfectly!
thank you so so so much!!
seriously, i’ve been struggling with this since probably about 10am and it’s currently 18am here, so i’m extreeeemely thankful

are there any other steps i should do, or can i just go back to using my system the same way as before?
(except for the fact that now i know not to delete partitions if i’m not 100% sure what they do haha)

anyway, thank you very very much again, i’m extremely grateful

2 Likes

Excellent :grinning_face:

My only slight worry would be whether any future GRUB reinstall or config regeneration would take that grub.cfg file back to its previous bad state.

I suspect that it’ll be fine, and the problem we saw was somehow associated with how the chroot was set up.

However, maybe you just want to take a note of the correct contents of that file (it should never change unless you change your partition layout) in case of any future trouble.

If you want to completely wipe Windows, you should be able to delete that nvme0n1p7 ntfs partiton (probably a Windows recovery partition?)

Get some sleep before trying anything else though :wink: