Start a Conversation

Solved!

Go to Solution

13755

June 18th, 2020 11:00

How to repair broken EFI partition

Hello everyone, I'm going to need some help to repair my broken EFI partition. Also, expect some grammar mistakes since English is not my first language. 

So, I recently bought a second hand Dell Inspiron 15 7567 gaming laptop, the model that has an I7 7700HQ and a GTX 1050ti. It came with an 256gb SSD and a 1tb HDD, the previous owner did not upgrade any of the components except for the RAM which he only added a single 4gb stick to the stock 8gb module. The laptop was formatted with windows and its usual EFI, system reserved and recovery environment partitions aside from the main windows partition, but also the Dell SupportAssist recovery partition.

Turns out that, every now and then support assist would come up, do a quick scan and then either freeze or shutdown the computer, then the laptop would boot normally, this wasn't common at all, but that was only until I completely wiped the SSD, installed both windows and Linux on it, that was my mistake, I only did that, I never tried to configure or check if the efi partition was fine and I never cared for the oem recovery tools, I just figured the windows installer would do everything for me, and it that should be the case but I remember something weird happening, you see, at the time I was formatting the drive, if I selected the main partition to reinstall windows on it, the efi and the rest of the the usual partitions showed up, however, when I did the full wipe, only the system reserved partition was there, not the EFI.

Now, normally, this would cause an unbootable system and I would have to manually create the EFI  partition, but it just so happens that the HDD also had a EFI partition that I suspect the windows installer automatically detected and copied the boot files to, and not only that but also grub did the same when I installed Linux, thus making my system kinda work with an EFI partition on the secondary HDD and everything else on the main SSD, my entries on the boot menu at the time of the bios were as follows: Windows, Linux and a partition I didn't recognize on the secondary drive (probably the efi one), I did not know this was possible.

Up to now, I've been booting into the SupportAssist scan I mentioned earlier everytime I used the laptop, skipping it by aborting the scan and turning on the machine again, then using it as normal, this worked for me so I just figured I would someday fix it, which turned out to be a very big mistake. The real trouble began when I used my computer to fix another laptop by testing a bootable pendrive on it, the exact trigger was probably when I accidentally booted the third entry on my boot menu thinking it was the USB drive, after that, the other two entries were gone.

The SSD is still detected, I can boot into Kali Linux on a live usb session and browse it, the bios settings also detect it, disabling or even physically disconnecting the secondary drive results in no entries on the boot menu, booting into the third, now only, entry just gives me a windows blue screen telling me that my system can't boot (Error code 0xc000000e) which is obviously very useful, my previous working and also current boot mode is UEFI with secure boot disabled (because of Linux), I have RAID on instead of AHCI (was like that by default) and by browsing said partition with Kali Linux I can see that the files are there. 

Things that I have already tried:

* Switching boot modes

* Disabling legacy boot

* Restoring BIOS settings 

* Letting SupportAssist do a full scan (results in it telling me that I should wipe out the ssd and start over again, it's slowly convincing me to).

Things I think should work but haven't tried because I fear of breaking my system any further:

* Switching from RAID on to AHCI

* Making another partition on the SSD using gparted, moving both the windows and Linux from SDA2 and SDA3 to SDA 3 and SDA 4 respectively, and either cloning the secondary driver's efi partition there or build a new one (I think this will only break Linux but I'm not sure, my question is, does efi HAVE to be before the OS's partitions or not?)

So, that's the problem, I don't want to try any of the above because I have some files that don't have a backup of, so if any of you have any idea how to fix this mess, I beg of you, please post them, I will answer every question you have about my system and post Screenshots and photos accordingly, so thank you in advance, and again, sorry for making you read such an essay written in my broken English, I will also appreciate any corrections you make. 

4 Operator

 • 

14K Posts

June 18th, 2020 12:00

@hosu6  Well you could just run the simple command that Windows Setup uses in the background to set up an EFI partition when it's installing onto a fresh system.

Boot into something like Windows Setup or Windows Recovery where you'll have access to Command Prompt.  Make sure that both your Windows partition and your EFI partition are assigned a drive letter.  The EFI partition by default is not assigned a drive letter, but you can use diskpart to assign a letter temporarily.  Then make sure you know which drive letter each partition is assigned in the environment you're using.  The Windows partition will not necessarily be assigned "C" in all cases.  When you've got both partitions assigned a drive letter and you know which partition has which drive letter, modify the example command below as needed.  In the command below, the EFI partition is X: and the Windows partition is W.  Change those as needed for your setup:

W:\Windows\System32\bcdboot W:\Windows /s X:

That will cause the EFI bootloader files from your Windows partition to be copied onto your EFI partition, which should get it working.  It won't do anything to help Linux, but it should at least get Windows working.

If it doesn't work, try formatting your EFI partition as FAT32 just to erase it and start from scratch, then try running that command again.  Again, that command is what Windows Setup runs when it first installs Windows in order to set up the EFI partition, so it should be able to get you a working EFI partition again.

4 Operator

 • 

14K Posts

June 18th, 2020 12:00

@hosu6 A few extra suggestions and notes:

  • I'm surprised you're able to access your SSD from Linux if your system is in RAID mode.  Typically you have to switch to AHCI mode in order to allow Linux to see internal storage.  Maybe Linux now has an Intel Rapid Storage driver that supports at least certain generations of the Intel RST controllers built into laptops.
  • The EFI and MSR partitions are supposed be before any OS partitions.  I don't know if it HAS to be that way in order to make things work, but Microsoft's guidance is that the MSR partition must be directly after the EFI partition, and both of those partitions need to be before any OS partitions.
  • If you're worried about your data, then just capture an image backup of your entire disk before you continue experimenting.  There are several free tools that can accomplish this.  Macrium Reflect is a popular choice.  It supports Linux partitions, although Reflect itself only works in Windows, so if you wanted to access data from your Linux partitions in the backup without having to restore the backup onto a physical disk, you would need to make sure you have a way to read Linux partitions within Windows.  But this is a pretty easy way to make sure you back up your data before you create any further damage, so if you have data you don't want to lose, I don't understand why you haven't already done this.  Or you could have at least copied individual files from your disk onto some other drive by using your Linux Live disc.

4 Posts

June 19th, 2020 05:00

Yeah, I really should make a backup before doing anything else, so that's what I'm doing today. 

I'm guessing the RAID situation happened because while the RAID on option is enabled in the bios, the drives are listed as non-RAID on the device configuration menu and a RAID volume has not been created, even though I remember having the Intel Rapid Storage software running in the background while I was using Windows, pretty weird. I mentioned RAID beacuse I found someone with a similar problem on this same forum who solved their issue by switch to AHCI mode. 

IMG_20200619_074703.jpg

4 Posts

June 19th, 2020 07:00

Hmm, so I shouldn't be capable of accessing the windows partition from Linux with my current setup, that's weird, maybe there really is support for RST in the current kernel, I had no idea.

4 Posts

June 19th, 2020 07:00

Thank you, this actually reverted the situation back to what it was before I tried to boot from the secondary drive by mistake except for Linux not booting as expected, but I think I can make it work by doing the Linux installation equivalent to the command you provided, this leads me to believe that the EFI partition doesn't really have to be before the data partition so I will try to make one on the SSD and disable the one I'm using as to not be able to make the same mistake again, I believe this will also solve the issue of SupportAssist showing up everytime I turn on my computer since it will detect the SSD as a bootable device now. So, thanks again for the quick reply, I hope you have a great day. 

4 Operator

 • 

14K Posts

June 19th, 2020 07:00

@hosu6  RAID mode means the Intel Rapid Storage Technology controller is active and abstracting the underlying storage from the OS.  That can be the case even if there's no actual RAID virtual disk involved.  Switching to AHCI completely disables the RST controller.  Dell defaults to RAID mode on all systems for a variety of reasons that have to do with functionality and a bit of history -- except on the handful of systems that they ship with Linux pre-installed from the factory.  If you don't actually need RAID mode, then you can switch to AHCI, but that is generally done before reinstalling an OS, not in the middle of a live OS installation.

But in any case, having RAID enabled but having no RAID virtual disk involved is still NOT the same thing as having AHCI mode enabled.  With RAID mode enabled, the OS still needs to be able to talk to the Intel RST controller, and this is the first time I've seen somebody say that they were able to do that from Linux.

No Events found!

Top