14

cross-posted from: https://lemmygrad.ml/post/6734778

My laptop is (maybe was) Linux and Windows 10 dual booted. I was reinstalling the Linux OS and in the process I accidentally formatted the Windows 10 boot partition. At least I think it is the boot partition because I don't really know how Windows works (or doesn't work amirite).

This is the lsblk output:

$ lsblk -f
NAME        FSTYPE     FSVER LABEL [...] MOUNTPOINTS
nvme1n1     zfs_member 5000  zroot [...]
├─nvme1n1p1 vfat       FAT32       [...] /boot/efi
├─nvme1n1p2 swap       1           [...] [SWAP]
└─nvme1n1p3 zfs_member 5000  zroot [...]
nvme0n1
├─nvme0n1p1
└─nvme0n1p2 ntfs

The nvme0n1p1 is the one related to booting. I accidentally formatted it.

I have a Windows 10 USB prepared. I tried looking online and I never found a question asking exactly for this. The ones I found that were similar enough suggested different commands.

Anyone has experience with this?

Thanks in advance.

top 9 comments
sorted by: hot top controversial new old
[-] Hermes@hexbear.net 4 points 2 days ago* (last edited 2 days ago)

I was just fucking around with EFI boot stuff recently. Legitimate hell. efibootmgr on linux can give info on the current boot options, and might be able to help? I don't know how the M$ boot works since I don't use Windoze.

Consider switching to only booting libretion

[-] ksynwa@lemmygrad.ml 4 points 2 days ago

Yeah it is really weird how sparse the info is on this topic.

Consider switching to only booting

I have a terrible secret. I am a gam*r.

[-] KrasMazov@lemmygrad.ml 2 points 2 days ago* (last edited 2 days ago)

What kind of g*mer? Cuz it's possible to game on Linux nowadays. I've been exclusively gaming on Linux for the last 3 years and it is incredible.

Also I don't think efibootmgr can help if your boot files from Windows are gone from the boot partition.

[-] darkcalling@hexbear.net 2 points 2 days ago

You want as mentioned in the other thread to extract the EFI folder contents from the windows installer ISO (can be opened with any decent archive manager, 7zip works for instance) and place them in the EFI partition. You may need to do some boot repair commands on Windows or it may just work.

[-] elidoz@lemmy.ml 2 points 2 days ago* (last edited 2 days ago)

almost as soon as I installed linux I uninstalled windows, so I don't know much but wouldn't it work to just install grub and have it do its thing with os-prober? I have a usb with a system rescue iso so that it can find my linux os, then I boot to it, I get into tty and I reinstall grub

I also accidentally deleted my boot partition once, and deliberately other times because I like poking around in the os, I hope this works for you

[-] ksynwa@lemmygrad.ml 1 points 2 days ago

Os prober isn't detecting windows. I suspect it's because the windows boot partition is gone but I'm not sure how it detects windows exactly.

[-] elidoz@lemmy.ml 1 points 2 days ago* (last edited 1 day ago)

in some distros os-prober may be disabled by default (because of security reasons iirc, I don't know why it would be unsecure) or you may need to mount the windows partition begore running os-prober

for example in arch os-prober only checks mounted partitions

you can try mounting your windows partition to /mnt or somewhere else where you have an empty folder before running os-prober

[-] JoeByeThen@hexbear.net 1 points 2 days ago

Have you tried a bootrec /fixmbr?

https://answers.microsoft.com/en-us/windows/forum/all/fix-windows-10-mbr/dccc20ae-ff02-481b-9840-b8efe4275ab5

Iirc, when someone (definitely not me) did this, I had to do all that fixmbr stuff and then maybe(idk, was a while ago) reinstall the bootmanager I was using.

[-] echolalia@lemmy.ml 1 points 2 days ago* (last edited 2 days ago)

Did u run across this thread?

windows answers forum

This seemed to work for me (I am in a similar situation) but ultimately failed only because (I believe) I have multiple drives and windows tries to incorrectly install on my nvme despite having an efi prepared on an SSD. Seems to be no way to specify the drive for bcdboot. I'm trying again when I have time off. It seems I may need to pull all unnecessary drives to get it on the right one.

Anyway good luck

Edit: I assume bcdboot defaults to my nvme in my specific case because after I tried restoring the boot partition:

  • i gave up and I nuked all partitions on my windows ssd.

  • I attempted a clean windows install on the ssd while Linux (with it's own boot partition) lives on the nvme

  • It creates a new partition layout on the ssd complete with efi parition

  • then it poops its pants without installing anything to the boot partition it just created. Windows completely refuses to install now.

this post was submitted on 14 Jan 2025
14 points (100.0% liked)

technology

23419 readers
204 users here now

On the road to fully automated luxury gay space communism.

Spreading Linux propaganda since 2020

Rules:

founded 4 years ago
MODERATORS