LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 01-03-2019, 11:44 PM   #1
etcetera
Member
 
Registered: Aug 2004
Posts: 436

Rep: Reputation: 17
which program can repair Windows EFI partitions? Booted in Fedora 29


I have this system with 4 SSDs, here is the layout.
2 disks are for Win10, clones, 3 disk has Fedora on it and the last one is just data.

I damaged/wiped out the EFI partition on both Win10 disks with an imaging program. Now neither will boot. I am not having any luck booting into a recovery program to repair EFI. It either hangs or does not see the ISO.

I can, however boot into Fedora just fine. Is there a tool in Linux that can mount these drives and repair the EFI partitions - all done under Linux?

I need a Linux-based EFI partition repair program for GPT UEFI Windows 10 machine.


https://i.imgur.com/ApU71fh.jpg


I know about efibootmgr, it's close but doesn't seem like it can do the above, that is operate on Windows entries. Or can it?

Last edited by etcetera; 01-04-2019 at 12:37 AM.
 
Old 01-04-2019, 12:42 AM   #2
mrmazda
LQ Guru
 
Registered: Aug 2016
Location: SE USA
Distribution: openSUSE 24/7; Debian, Knoppix, Mageia, Fedora, others
Posts: 5,826
Blog Entries: 1

Rep: Reputation: 2068Reputation: 2068Reputation: 2068Reputation: 2068Reputation: 2068Reputation: 2068Reputation: 2068Reputation: 2068Reputation: 2068Reputation: 2068Reputation: 2068
I have no idea if there is an answer to the question asked, but if it was me, I'd disconnect all but one of the Windows SSDs you wish to be able to boot from, and use Windows installation media to run bootrec. Once that works I'd add one SSD at a time back to get each to boot. What "recovery program(s)" did you try?
 
Old 01-04-2019, 04:01 AM   #3
Brains
Senior Member
 
Registered: Apr 2009
Distribution: All OS except Apple
Posts: 1,591

Rep: Reputation: 389Reputation: 389Reputation: 389Reputation: 389
Quote:
Originally Posted by etcetera View Post
Is there a tool in Linux that can mount these drives and repair the EFI partitions - all done under Linux?
No

Download Windows PE and burn the ISO to DVD or USB key with etcher or Rufus in Windows. Boot it. Based on your drive layout in Post #4 here the only drives that should show up from the hardware side should be "C" and "G", they may be assigned a different drive letter from within the PE, to fix the boot stuff, you will need to use the letter assigned by the PE in the last command below.

You will run the command prompt as administrator and type: diskpart. Wait for the diskpart prompt to appear. To fix Disk 2 (your first Windows disk) which should be disk 2, you'll need to run commands below, you may opt to not run the format command if you feel it's good.
Code:
list disk
sel disk 2
list par
sel par 1
format quick fs=fat32 label="SYSTEM"
assign letter="S"
exit
Now the EFI (system) partition should show up in "This PC" file browser window with letter S, assuming your C drive is still assigned letter C, issue next command to set up UEFI boot files in the system partition. The letters in blue are the drive letters so you can get a grasp of the command structure.
Code:
bcdboot C:\Windows /s S:\
Now you can reboot and the first copy of Windows should be bootable.

Last edited by Brains; 01-04-2019 at 04:02 AM.
 
1 members found this post helpful.
Old 01-04-2019, 07:07 AM   #4
yancek
LQ Guru
 
Registered: Apr 2008
Distribution: Slackware, Ubuntu, PCLinux,
Posts: 10,534

Rep: Reputation: 2495Reputation: 2495Reputation: 2495Reputation: 2495Reputation: 2495Reputation: 2495Reputation: 2495Reputation: 2495Reputation: 2495Reputation: 2495Reputation: 2495
Quote:
I damaged/wiped out the EFI partition on both Win10 disks with an imaging program
Yet the image you posted shown an EFI partition on each of your drives?? Is the image inaccurate or have you re-created the EFI partitions? Have you mounted each of the EFI partitions from Fedora to look at them and see what files exist there? There is no need to have multiple EFI partitions on the same computer. Each Linux system you install should detect an already existing EFI partition and create a directory for its EFI boot files on that partition. If you have an EFI partition on each drive it will only boot whatever system has proper EFI files on that partition and that physical drive would need to be selected and set in the BIOS.

Hopefully, the suggestion above will work but since your windows systems are clones, who knows.
 
Old 01-04-2019, 08:26 AM   #5
etcetera
Member
 
Registered: Aug 2004
Posts: 436

Original Poster
Rep: Reputation: 17
Quote:
Originally Posted by yancek View Post
Yet the image you posted shown an EFI partition on each of your drives?? Is the image inaccurate or have you re-created the EFI partitions? Have you mounted each of the EFI partitions from Fedora to look at them and see what files exist there? There is no need to have multiple EFI partitions on the same computer. Each Linux system you install should detect an already existing EFI partition and create a directory for its EFI boot files on that partition. If you have an EFI partition on each drive it will only boot whatever system has proper EFI files on that partition and that physical drive would need to be selected and set in the BIOS.

Hopefully, the suggestion above will work but since your windows systems are clones, who knows.
It is an older image of the way it was before.
 
Old 01-04-2019, 01:24 PM   #6
yancek
LQ Guru
 
Registered: Apr 2008
Distribution: Slackware, Ubuntu, PCLinux,
Posts: 10,534

Rep: Reputation: 2495Reputation: 2495Reputation: 2495Reputation: 2495Reputation: 2495Reputation: 2495Reputation: 2495Reputation: 2495Reputation: 2495Reputation: 2495Reputation: 2495
If the solution offered in post 3 does not work for you, post some updated drive/partition info using parted, fdisk or gdisk.
 
Old 01-04-2019, 02:03 PM   #7
etcetera
Member
 
Registered: Aug 2004
Posts: 436

Original Poster
Rep: Reputation: 17
Understood
 
Old 01-04-2019, 08:08 PM   #8
etcetera
Member
 
Registered: Aug 2004
Posts: 436

Original Poster
Rep: Reputation: 17
Quote:
Originally Posted by Brains View Post
No

Download Windows PE and burn the ISO to DVD or USB key with etcher or Rufus in Windows. Boot it. Based on your drive layout in Post #4 here the only drives that should show up from the hardware side should be "C" and "G", they may be assigned a different drive letter from within the PE, to fix the boot stuff, you will need to use the letter assigned by the PE in the last command below.

You will run the command prompt as administrator and type: diskpart. Wait for the diskpart prompt to appear. To fix Disk 2 (your first Windows disk) which should be disk 2, you'll need to run commands below, you may opt to not run the format command if you feel it's good.
Code:
list disk
sel disk 2
list par
sel par 1
format quick fs=fat32 label="SYSTEM"
assign letter="S"
exit
Now the EFI (system) partition should show up in "This PC" file browser window with letter S, assuming your C drive is still assigned letter C, issue next command to set up UEFI boot files in the system partition. The letters in blue are the drive letters so you can get a grasp of the command structure.
Code:
bcdboot C:\Windows /s S:\
Now you can reboot and the first copy of Windows should be bootable.
I am booted into the recovery disk, created by Rufus, nice tool. Created a bootable Flash drive.

I am into diskpart. Are these commands literal or do I need to modify something?
 
Old 01-04-2019, 08:35 PM   #9
Brains
Senior Member
 
Registered: Apr 2009
Distribution: All OS except Apple
Posts: 1,591

Rep: Reputation: 389Reputation: 389Reputation: 389Reputation: 389
Quote:
Originally Posted by etcetera View Post
I am booted into the recovery disk, created by Rufus, nice tool. Created a bootable Flash drive.

I am into diskpart. Are these commands literal or do I need to modify something?
Those should work, I've rebuilt Windows systems and it worked for me, this is assuming there is nothing wrong with the Windows partitions.
You can also consolidate all boot entries in one EFI partition on Drive 0 by simply using: sel drive 0 instead of: sel drive 2 which is where I assume Fedora is installed, but the formatting would wipe out Fedora's boot files, be carefull. The boot files created will refer to UID of the Windows partition and only that partition will be attempted to be booted. You can then either add the other Windows to the menu of the first one or add separate boot entry in EFI partition, they will likely be named the same so not sure how that will pan out.
The main thing to remember, the list disk command will show all disks, select the appropriate one if you've changed orientation relative to post #4 in the other thread.

Last edited by Brains; 01-04-2019 at 08:39 PM.
 
Old 01-07-2019, 05:05 PM   #10
jefro
Moderator
 
Registered: Mar 2008
Posts: 21,993

Rep: Reputation: 3628Reputation: 3628Reputation: 3628Reputation: 3628Reputation: 3628Reputation: 3628Reputation: 3628Reputation: 3628Reputation: 3628Reputation: 3628Reputation: 3628
Just a note. I think I'd have used almost any windows 10 dvd to work on this. Microsoft offers disc images free for such use. Not sure there was ever a legal PE offered free by Microsoft. Your bios or side panel may have key if needed but repairs won't usually require it.
 
Old 01-08-2019, 12:58 AM   #11
Brains
Senior Member
 
Registered: Apr 2009
Distribution: All OS except Apple
Posts: 1,591

Rep: Reputation: 389Reputation: 389Reputation: 389Reputation: 389
Quote:
Originally Posted by jefro View Post
Just a note. I think I'd have used almost any windows 10 dvd to work on this. Microsoft offers disc images free for such use. Not sure there was ever a legal PE offered free by Microsoft. Your bios or side panel may have key if needed but repairs won't usually require it.
Microsoft offers the Windows Assessment and Deployment Kit and the Windows Preinstallation Environment (PE) for free, but this is over 4GB of software to download, and over 4GB of extra software installed. The PE you'll get is kind of bland and minimalistic so to speak.

But, you can download this free software (321MB), that will only download 10MB of the tools from that 4GB+ ADK---> (free from Microsoft) and dress up your PE as you see fit and include all kinds of free legal software, a favorite avenue for Administrators. You still need a Windows OS ISO---> (free from Microsoft) to add the desktop and Windows graphical applications. Most every custom PE you can download are built with this software which has been around since the days of Windows XP, if it were illegal, they would have been shut down long time ago.

The differences between a custom PE downloaded from the net and a Microsoft full OS ISO is somewhere in the neighborhood of 3GB less download, you don't need to install anything, and you don't have to activate a PE, meaning you can use it beyond 3 months.
 
Old 01-08-2019, 01:28 AM   #12
mrmazda
LQ Guru
 
Registered: Aug 2016
Location: SE USA
Distribution: openSUSE 24/7; Debian, Knoppix, Mageia, Fedora, others
Posts: 5,826
Blog Entries: 1

Rep: Reputation: 2068Reputation: 2068Reputation: 2068Reputation: 2068Reputation: 2068Reputation: 2068Reputation: 2068Reputation: 2068Reputation: 2068Reputation: 2068Reputation: 2068
Brains, if OP has Win10 installation media already, it's all he needs to run bootrec as I suggested in comment 2, little different from what jefro's reply #10 suggested.
 
Old 01-08-2019, 01:40 AM   #13
Brains
Senior Member
 
Registered: Apr 2009
Distribution: All OS except Apple
Posts: 1,591

Rep: Reputation: 389Reputation: 389Reputation: 389Reputation: 389
Quote:
Originally Posted by mrmazda View Post
Brains, if OP has Win10 installation media already, it's all he needs to run bootrec as I suggested in comment 2, little different from what jefro's reply #10 suggested.
Quote:
Not sure there was ever a legal PE offered free by Microsoft
Just saying there's nothing illegal with Windows PE which is a lot smaller download.
 
Old 01-08-2019, 09:03 AM   #14
etcetera
Member
 
Registered: Aug 2004
Posts: 436

Original Poster
Rep: Reputation: 17
I got it recovered.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Ooooy. EFI boot mmx64.efi.efi not found bulgin Linux - Newbie 12 12-20-2018 11:03 AM
[SOLVED] Can't find /boot/efi/EFI/Slackware/vmlinuz kernel configuration ironQiu Slackware 4 02-09-2015 06:21 AM
boot efi disk with without a non-efi bios pc... masavini Programming 1 11-12-2013 08:48 PM
EFI main GPT overwritten everytime (when windows 7 runs) - structure of EFI masuch Linux - Newbie 2 07-20-2012 02:49 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 08:51 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration