1

I tried dual booting Ubuntu with Windows 10 in my Dell laptop. An grub-install error appeared. Checking through the log files, a launchpad expert advised that my EFI sytem partition is corrupt and I need to run chkdsk on ESP.

Link: bugs.launchpad.net/ubuntu/+source/grub-installer/+bug/170316‌​7

Unfortunately, I do not find any clear resource explaining the same. Kindly explain me the appropriate procedure.

  • What is the exact issue you are having, do you suspect the drive might be failing? If so, you would do better to use the HDD manufacturer's diagnostics tools (SeaTools for Seagate, Lifeguard Utility for WD, etc). Otherwise you can try CHKDSK /f /r and select y to schedule it to run at next boot. – SamAndrew81 Jul 11 '17 at 14:41
  • @SamAndrew81 I tried dual booting Ubuntu with Windows 10 in my Dell laptop. An grub-install error appeared. Checking through the log files, a launchpad expert advised that my EFI sytem partition is corrupt and I need to run chkdsk on ESP. bugs.launchpad.net/ubuntu/+source/grub-installer/+bug/1703167 – Benedict Florance Jul 11 '17 at 14:45
  • I see. You will need to boot to Windows installer USB flash-drive or perhaps the recovery partition, then you can tell CHKDSK which volume/partition to run against: superuser.com/questions/518634/… – SamAndrew81 Jul 11 '17 at 15:58
  • I already have Windows 10 pre-installed along with the lap. – Benedict Florance Jul 11 '17 at 16:09
1

The root cause of this is most likely the Windows Fast Startup and Hibernate features. See here and here for information on how to disable these features in Windows. As background, these features turn a shutdown operation into a suspend-to-disk operation. This has the desired effect of reducing subsequent startup times. Unfortunately, the undesirable consequence is that it becomes unsafe to share partitions between OSes, since they'll be in an inconsistent state when the non-Windows OS boots; and then when Windows boots, it won't know how to handle any changes made by the non-Windows OS. Thus, file corruption can result. This can affect the EFI System Partition (ESP), where both Windows and Ubuntu boot loaders are stored. In your case, I'm speculating that these features were active (as they are by default), which resulted in what looks to Ubuntu like filesystem damage.

The solution, if I'm right, is to disable those features. You might need to reboot back into Windows for the change to take effect. Thereafter, you should be able to safely read and write the ESP.

If the partition still shows damage after disabling these features, there is a native Linux tool for repairing FAT filesystems, dosfsck. You can use that instead of CHKDSK in Windows, but you need to either pass it the -a option, as in sudo dosfsck /dev/sda1 to check /dev/sda1; or use more advanced options to approve individual changes. That said, if you're seeing filesystem damage, you might want to back up the partition first. Using a file-level backup tool (cp, tar, or zip, for instance) should be sufficient. A backup will provide you with a fallback position should a filesystem repair operation make matters worse. (This assumes that all the files are successfully read and backed up, of course!) In that case, you can create a fresh filesystem and restore all the files.

I've never tried using CHKDSK on an ESP in Windows. My suspicion is that it could be done as follows:

  1. Open an Administrator Command Prompt window.
  2. Type mountvol E: /S to mount the ESP as E: in that window. (Change E: to whatever you like.)
  3. Type CHKDSK E: to run the check.

As I said, I've not tried this, so I can't promise it would work. If I'm right about the cause of your problem, this procedure alone will be useless, even if there's filesystem damage; you'll still need to disable Fast Startup and Hibernate to make the system safe for use in a multi-boot environment.

  • Thanks! I did CHKDSK on EFI and it resolved the error. Check the answer :) – Benedict Florance Jul 13 '17 at 19:40
1

On Windows, I used DISKPART to assign the EFI System partition a letter. Fired up DISKPART, and typed LIST DISK to find the disk, followed by SELECT DISK <N> (where is the drive number). Followed the same steps to find the proper partition (i.e. LIST PARTITION followed by SELECT PARTITION <N>), and then simply typed ASSIGN LETTER = X to have Windows mount the partition to letter X.

Then opened CMD with administrative access. Ran CHKDSK X: /f /r

Then, I tried installing Ubuntu once again, and it installed successfully!

-1

I had a similar problem recently while installing Ubuntu 18.04 alongside Windows 10. Linux syslog indicated a problem with creating directory /boot/efi/EFI/ubuntu. So, I ran the chkdsk in windows which found the ESP to be corrupted. It fixed the problem with the Ubuntu entry in the partition by deleting it. I then reinstalled Ubuntu from the live disk and it went through.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.