You are not logged in.

#1 2023-12-11 11:28:38

dev-ardi
Member
Registered: 2023-12-11
Posts: 3

I destroyed windows bootloader

I installed Arch a while ago (I don't quite remember the details of the install) and while doing so I destroyed the windows bootloader. Didn't care then but I need my windows install back (the partitions are intact).

I'm a noob about all of the booting process so I have no idea how to fix this. I also don't know what info to give to make this easier so just ask if you need anything.

This is my fstab

UUID=a6e092fd-0969-4f12-93fa-2c6dd7a6d997 /              ext4    defaults,noatime 0 1
UUID=0c3a5da8-c2f0-4686-b8cb-bead1942f083 /home          ext4    defaults,noatime 0 2
tmpfs                                     /tmp           tmpfs   defaults,noatime,mode=1777 0 0
$ lsblk -o NAME,FSTYPE,SIZE
NAME        FSTYPE   SIZE
nvme0n1            931,5G
├─nvme0n1p1          100M
├─nvme0n1p2           16M
├─nvme0n1p3 ntfs      93G
├─nvme0n1p4 ext4    57,5G
├─nvme0n1p5 ntfs   295,8G
└─nvme0n1p6 ext4     485G

My /etc/default/grub

GRUB_TIMEOUT='3'
GRUB_CMDLINE_LINUX_DEFAULT='nowatchdog nvme_load=YES loglevel=3'
GRUB_CMDLINE_LINUX=""
GRUB_PRELOAD_MODULES="part_gpt part_msdos"
GRUB_TIMEOUT_STYLE=menu
GRUB_TERMINAL_INPUT=console
GRUB_GFXMODE=auto
GRUB_GFXPAYLOAD_LINUX=keep
GRUB_DISABLE_RECOVERY='true'
GRUB_DISABLE_SUBMENU='false'
GRUB_DISABLE_OS_PROBER=false

Offline

#2 2023-12-12 15:30:29

jl2
Member
From: 47° 18' N 8° 34' E
Registered: 2022-06-01
Posts: 1,383

Re: I destroyed windows bootloader

post efibootmgr.
try booting esp/EFI/microsoft/Boot/bootmgfw.efi or something like that.


Why I run Arch? To "BTW I run Arch" the guy one grade younger.
And to let my siblings and cousins laugh at Arsch Linux...

Upload longer text output like this

Offline

#3 2023-12-13 01:04:03

dev-ardi
Member
Registered: 2023-12-11
Posts: 3

Re: I destroyed windows bootloader

$ efibootmgr
EFI variables are not supported on this system.

Also

$ sudo parted -l
[sudo] password for ardi: 
Model: VendorCo ProductCode (scsi)
Disk /dev/sda: 62,9GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags: 

Number  Start   End     Size    Type     File system  Flags
 1      16,4kB  62,9GB  62,9GB  primary  udf          boot


Model: KIOXIA-EXCERIA G2 SSD (nvme)
Disk /dev/nvme0n1: 1000GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags: 

Number  Start   End     Size    File system  Name                          Flags
 1      1049kB  106MB   105MB                EFI system partition          bios_grub, no_automount
 2      106MB   123MB   16,8MB               Microsoft reserved partition  msftres, no_automount
 3      123MB   100GB   99,9GB  ntfs         Basic data partition          msftdata
 5      100GB   418GB   318GB   ntfs         Basic data partition          msftdata
 4      418GB   479GB   61,8GB  ext4         /
 6      479GB   1000GB  521GB   ext4         /home

Last edited by dev-ardi (2023-12-13 01:17:24)

Offline

#4 2023-12-13 01:16:39

dev-ardi
Member
Registered: 2023-12-11
Posts: 3

Re: I destroyed windows bootloader

I remembered that I installed my system using BIOS for whatever reason. I don't know why I did such a thing because my system supports uefi. I'll try to fix it.

Last edited by dev-ardi (2023-12-13 01:54:37)

Offline

#5 2023-12-13 06:47:20

Head_on_a_Stick
Member
From: The Wirral
Registered: 2014-02-20
Posts: 9,003
Website

Re: I destroyed windows bootloader

Your EFI system partition has the wrong "flag" (partition type).

Use this to correct it:

# parted /dev/nvme0n1 set 1 'esp' on

With that change does disabling CSM ("Legacy" mode) in the firmware ("BIOS") options get Windows booting?

If so then re-installing the GRUB bootloader in UEFI mode and updating the configuration should give you a boot menu for both systems.

Mount the ESP under (for example) /boot/efi/ then follow https://wiki.archlinux.org/title/GRUB#Installation (/boot/efi/ is the presumed ESP location so the --efi-directory option can be omitted).

EDIT: if you want Arch to be bootable in non-UEFI mode after changing the ESP type you will need to create another (very small) partition to hold GRUB's non-UEFI core.img — mark it with the "bios_grub" flag, do not format it, and run  the non-UEFI grub-install command. I use sectors 34-2048 for this purpose, the misalignment isn't an issue for the bootloader.

Last edited by Head_on_a_Stick (2023-12-13 06:50:01)


Jin, Jîyan, Azadî

Offline

Board footer

Powered by FluxBB