forbidding windows to modify uefi partition files

Page 1 of 2 12 LastLast

  1. Posts : 56
    whatever
       #1

    forbidding windows to modify uefi partition files


    Hello guys, i have no idea where to put it, but i have a strange situation here.
    I have an hp laptop with highly cut down bios, and the only way to make it capable of dualbooting, is to place refind boot mannager files in efi\microsoft\boot\ folder, after coppying entire microsoft folder under a different name.
    The problem is windows keep trying to modyfi that folder after any major update, and makes computer unbootable , unless i handfeed it with the copy of the windows loader file, or copy of the refind bootloader otherwise undetected by bios. Laptop can boot from file so i can go to linux, mount uefi boot partition and fix the damage. But windows will brick itself on the next boot probably.

    Windows was installed first, then linux on another unbootable ssd that shouldn't even be there, the first ssd shouldn't be there either by hp design, so no hope for tech support from them. I literally soldered wires on motherboard for it to work, so i am kind of invested in the computer.

    windows 10 home boots from a copy of bootloader located in uefi partition under a directory *:efi\old\boot\ where old is just renamed copy of microsoft folder
    new microsoft folder has inside renamed redind.efi file that fools the bios it boots windows boot loader as normal so in efi\microsoft\boot i have file called bootmgr.efi which has nothing to do with microsoft, this file launch a gui boot loader which load efi boot driver for nvme drive, and then let me pick windows(from modyfied location) or linux from the other ssd

    windows still thinks it's boot loader files are in efi\microsoft\boot folder and copy over oryginal boot loader files, but only the 2 *.efi files, and nothing else. after some updates that are normally performed at boot level (version upgrade and so on).
    I would really like to either tell windows where it's boot files really are or make it aware it can't modyfi boot files

    windows installed on the laptop is windows 10 home 64 bit 22h2 compilation 19045.3086
    system boots in uefi mode, secure boot is disabled

    if you have some ideas i would be very gratefull
      My Computer


  2. Posts : 17,029
    Windows 10 Home x64 Version 22H2 Build 19045.4170
       #2

    Make an image of the EFI system partition & restore that image after Windows changes the partition.


    Denis
      My Computer


  3. Posts : 56
    whatever
    Thread Starter
       #3

    That is actually more work than just pressing f9, booting to linux and copying 2 files back.
    Still the update it wants to install would not install either way so it would try again on next time using windows and the story would repeat. forever.

    Problem is Windows will break boot every time an update needs to install from outside of windows, but since it modyfying wrong boot files it will never even install.

    The only way i know to stop it is to stop windows updates which i don't want.
      My Computer


  4. Posts : 6,470
    Windows 11 Pro - Windows 7 HP - Lubuntu
       #4

    Under yours "My Computer" it say you have Win 7 pro
    Please edit your profile with ALL your hardware specs. It will help us to help you
    System Specs - Fill in at Ten Forums

    Please post a whole window Disk Manager image of ALL your drives. Don't forget to expand the columns so we can read them. How to Post a Screenshot of Disk Management
    If you have a MiniTool or AOMEI Partition use it instead or Windows disk manager.
      My Computers


  5. Posts : 56
    whatever
    Thread Starter
       #5

    Well i must confess the os bio is not up to date, because i don't really care, I run whatever i have at hand, so mostly some kind of windows from vista to 11 or some flavor of ubuntu and there is no point in updating it every time i change computer. and i am doing it 2-3 times a day if not more ofthen. I am not really attached to anything and i mostly work on os's my work have which are windows vista to 11 with expeption to 8. Or whatever comes with the computer And when i read the request to update i kind of get mad and didn't read the rest and then life got in a way to read it again. I am mostly hardware hack so sometimes it is easier to for me to solder momory stick on top of the motherboard than explain what is not working to another person. So sorry if i sound a bit pushy or seems to intentionally not adhear to the rules, it just kind of happen to me a lot.

    As for screenshots, i don't think they change much, it is regular windows gpt efi partition layout (with recovery partition removed)
    disk 0 is the sata sandisk system drive bios can boot from, containing windows 10, and i think it is a clean install, although it might ben installed on a different phisical ssd and cloned to this one because linux been fusy about the previous one

    disk 1 is the nvme drive that under normal circunstances is not bootable because uefi bios does not contain pcie mass storage driver and is locked so can't be updated, but this disk is technically invisible to the windows during boot processand only loads as a pcie device driver in system

    i also attach pictures of the screen with eror message , and step by step "boot from file" process that could be used by pressing f9 when windows does brick itself
    boot from file>no volume name pci root (0:0)...> <efi> >and inside of efi folder is 6 subfolders:
    tools- i don't know what this is, it was there , i don't touch it
    hp - those are bios flashing utilities hp bios patcher generated
    boot - is something ubuntu grub bootloader created while installing linux one time, not a concern, , since linux is different now it just drop you to grub shell
    old - copy of microsoft folder with efi files that can boot windows 10 even after windows bricks itself
    refind -copy of graphic interface boot loader capable of loading drivers to uefi shell, sadly not permanently to the bios rom
    microsoft- is the default boot folder motherboard looks for on a drive and it only boots one file from there, copying refind inside and renaming efi file refind comes with to what microsoft created makes uefi boot to refind instead of windows and still thinking it boots to windows boot mannager, although secure boot handshake fails so secure boot is disabled.

    on the first screen of f9 menu you can also see booting directly to the sandisk drive, that is legacy boot

    i was kind of thinking about looking for uefi boot variables in registry editor, but that might be pointless if the boot manipulations are hardcoded in updates that fails to install bricking the boot process

    - - - Updated - - -

    sorry one picture got lost
    Attached Thumbnails Attached Thumbnails forbidding windows to modify uefi partition files-img_20231031_192042-1-.jpg   forbidding windows to modify uefi partition files-img_20231031_183553-1-.jpg   forbidding windows to modify uefi partition files-img_20231031_183503-1-.jpg   forbidding windows to modify uefi partition files-img_20231031_183525-1-.jpg   forbidding windows to modify uefi partition files-img_20231031_183538-1-.jpg  

    forbidding windows to modify uefi partition files-disks.jpg  
      My Computer


  6. Posts : 282
    Windows 10 Pro
       #6

    This is kind of a hard problem. I'm wondering if setting the folder/folders to read only would work? But when I did that myself I got problems.

    A hacker way to do it is to write the bootloader back immediately upon change. One way I would do it is with a USB rubber ducky...

    So, say Windows updates, destroys your bootloader and Windows can't boot. Insert the Rubber Ducky and in a practical instant everything is copied back to normal... LOL!

    You can probably build one too. You just need writing ability and copy/paste ability with some scripting language. Hak5's Ducky does that, but YMMV.

    You should have saw me solve an issue like this but the hard drives were encrypted. Took me 10 hours of research to fix that problem.
      My Computer


  7. Posts : 56
    whatever
    Thread Starter
       #7

    Well yes, i could probably make something like that, but it would be even easier to just have my bootloader on usb and leave windows on ssd as it wants to be. Because currently that cursed net framework update that bricking the boot process fails to install each time it don't boot from the mess it created and starts to install itself from scract.

    I could copy back all the content of old folder back to microsoft and then replace only that one file bios boots from, then it probably wouldn't brick itself but remove my bootloader each time it wants. Kind of setting windows in dominant position.

    I could install windows on non bootable ssd in absence of the botable one (or just clone it there), then linux on main ssd and only then my bootloader, because i don't think grub was able to pick up windows from non bootable ssd last time i tryed that.
    Windows don't care from which ssd it boots from, but i don't knowif it checks with bios which ssd is the one selected to boot from.

    There is a lot of hacky ways to do it, but i hoped to find one that windows could understand.
      My Computer


  8. Posts : 5,378
    Windows 11 Pro 64-bit
       #8

    In this video, i will guide you on how to Rebuild the Boot Configuration Data (BCD) to fix some Windows startup issues.


    In this video, i will guide on how to repair EFI System Partition (ESP), if the system partition has been corrupted, you can use BCDBoot command to recreate the system partition files by using new copies of these files from the Windows partition.
      My Computer


  9. Posts : 6,470
    Windows 11 Pro - Windows 7 HP - Lubuntu
       #9

    kokodin said:
    Windows was installed first, then linux on another unbootable ssd that shouldn't even be there, the first ssd shouldn't be there either by hp design, so no hope for tech support from them. I literally soldered wires on motherboard for it to work, so i am kind of invested in the computer.
    I have a old laptop that I replaced the HDD with a SATA SSD and replaced the ODD (CD/DVD) with a 2.5" drive caddy.
    As you refuse to give the laptop specs, can you explain why you did what you did (soldered wires on motherboard)?

    I have Win 7 and Lubuntu on same UEFI-GPT drive and never had any problem with boot manager modification after any update (Win or Linux). I have set Win as the priority boot drive and launch the boot menu (F12) during POST to choose Lubuntu. I have also made some modifications on Grub boot manager script so it doesn't load Win as a boot option.forbidding windows to modify uefi partition files-dm2.jpg
      My Computers


  10. Posts : 2,303
    Linux:Debian, Kali-Linux... 2xWin8.1,1x7Pro, Retro:1x2003server.1xXPpro, 1xW2k,1x98SE,1x95,1x3.11
       #10

    F22 Simpilot said:
    This is kind of a hard problem. I'm wondering if setting the folder/folders to read only would work? But when I did that myself I got problems.

    A hacker way to do it is to write the bootloader back immediately upon change. One way I would do it is with a USB rubber ducky...

    So, say Windows updates, destroys your bootloader and Windows can't boot. Insert the Rubber Ducky and in a practical instant everything is copied back to normal... LOL!

    You can probably build one too. You just need writing ability and copy/paste ability with some scripting language. Hak5's Ducky does that, but YMMV.

    You should have saw me solve an issue like this but the hard drives were encrypted. Took me 10 hours of research to fix that problem.
    Hi Simpilot
    I will only give a thought of my experiences, I started to lab a bit with efi partitions, but i never finished it, as i always take the easy road on dualboot with two or more disks and using Bios boot menu.. Legacy installs is king for that purpose.
    But in theory.. you could mount the efi partition in windows, take ownership and then kick out trusted installer and system on the write/change permissions and only leave them for read/run.. that way they can still use them and you can still tweak them, but the system and trusted installer in theory cant change them on updates to screw up the system.

    But in this case i would go with legacy installs, and skip making a small fat boot partition in linux and just make a / for root and boot. That way windows can't see linux bootloader and cant screw up linux.. almost a bullet proof solution for win/linux dualboot.

    Just my thoughts over my third cup of coffee... nothing more, nothing less.
      My Computer


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 04:14.
Find Us




Windows 10 Forums