Figure

After several failed attempts to dual-boot Ubuntu 15.04 and Windows 10 on a single hard drive and on a computer with UEFI firmware, and not knowing what caused the first failed attempt, I figured that subsequent failed attempts must have been due to an existing Ubuntu GRUB folder in the Boot EFI folder.

Especially since the machine always froze when the installer is attempting to install GRUB

So I thought that If I could just delete the ubuntu folder from the Boot EFI folder, that the installation would complete – successfully. Ultimately, it didn’t, but I figured out how to delete GRUB files from inside Windows 10, from the command line.

This post documents how it was done. It involved, from the command line, listing and selecting the detected hard drives, listing the partitions on the hard drive, then, finally, listing and deleting the target folder. Another reason you might want to do this, is if you deleted the Linux partitions, which would not automatically delete the GRUB files from the Boot EFI folder.

To start, log into Windows 10, click on the menu and type cmd. Then right-click on the terminal application’s icon and select run as administrator. Figure 1 show the commands (underlined) used to accomplish the first step – listing and selecting the hard drive. To make it possible to copy-and-paste, for those who might need to, I’ve provided the commands in the code block after the last image.

Related Post:  Manual LVM configuration on Fedora 13

In this figure, the target disk is shown as a 465 GB hard drive, with GPT partition.

Windows 10 diskpart
Figure 1: Using diskpart to list hard drives detected on Windows 10

After the target disk has been selected, its partitions are listed, so that the partition (volume) that corresponds to the Boot EFI folder can be identified. In Figure 2, that partition is Volume 2. It’s usually the only volume with FAT32 in the Fs (file system) column, and System in the Info column. After it has been identified and selected, you assign it a drive letter to make it easier to work with. In this example, I assigned it a drive letter D. After that, exit diskpart.

Listing Windows 10 partitions
Figure 2: Listing disk partitions on Windows 10

The final task involves changing into the Boot EFI folder, listing its contents to identify what subfolder the GRUB files would be. It will be in the EFI folder. The GRUB files for the distribution that was installed will be under a folder of the same name as the distribution. For example, if Ubuntu was installed, as in this example, the name of the folder will be ubuntu. Delete the folder using the rmdir /s command. That’s the Windows 10 equivalent of the Unix/Linux rm -r command.

Delete Ubuntu Boot EFI GRUB files
Figure 3: Deleting non-empty Ubuntu GRUB directory in Windows 10

All the commands used are given in this code block. Note that this procedure is not necessarily the best or only way to go about do this, so if you know of a better method, post a comment.

## These commands are used to identify and select the hard drive

diskpart

list disk

sel disk 0

## These commands are used to list the partitions, select the Boot EFI partition, 
## then assign it a drive letter

list vol

sel vol 2

assign letter=D:

exit

## These commands are used to change into the Boot EFI folder and delete the GRUB folder

cd /d D:

ls

ls EFI

cd EFI

ls

rmdir /s ubuntu

Share:

Share on facebook
Facebook
Share on twitter
Twitter
Share on pinterest
Pinterest
Share on linkedin
LinkedIn

Hola! Did you notice that LinuxBSDos.com no longer runs network ads?  Yep, no more ads from the usual suspects that track you across the Internet.  But since  I still need to pay to keep the site running, feel free to make a small donation by PayPal.

Subscribe for updates. Trust me, no spam!

Mailchimp Signup Form

Sponsored links

1. Attend Algorithm Conference, a top AI and ML event for 2020.
2. Reasons to use control panel for your server.
3. DHgate Computers Electronics, Cell Phones & more.

3 Responses

  1. In this tutorial you start the ntp-client manually by using the command:

    # /etc/init.d/ntp-client start

    However that command would not cause ntp-client to be started automatically when you reboot; it only starts ntp-client for the current session.

    Don’t you also have to add net-client to the default runlevel so that it starts automatically when you next boot?:

    # rc-update add ntp-client default

    Or does using ‘Kickoff > Computer > System Settings > Date & Time’ to configure KDE 4 to synchronise automatically with an NTP time server add ntp-client to the default runlevel for you?

    1. Having now configured a couple of PCs to sync their system clock by using NTP, I can answer my own question regarding ntp-client:

      Although I have read on some sites that /etc/init.d/ntp-client should be added to the default runlevel in order to read the time from an NTP server (once-only, during start-up), this in fact does not work because usually the network connection is not up by the time the ntp-client initscript runs. Some solutions to this problem are given in the Sabayon Linux Forums thread http://forum.sabayon.org/viewtopic.php?f=59&t=15119

      If you are using NetworkManager on your PC, an elegant solution is to use NetworkManagerDispatcher to restart ntp-client in order to resync your system clock every time a network connection comes up. Another way is to create a cronjob to run the ntpdate command or the “/etc/init.d/ntp-client restart” command. Yet another way (a ‘quick-and-dirty’ solution) is to delay running ntp-client until the network is up after boot by putting e.g. “sleep 10s && /etc/init.d/ntp-client restart” in /etc/conf.d/local.

      Regarding the NTP daemon, it is possible to set this to run at start-up from the command line rather than via a Desktop Environment GUI. The command:

      # rc-update add ntpd default

      will add the daemon’s initscript to the default runlevel so that it is run automatically at next startup, and the command:

      # /etc/init.d/ntpd start

      will start the daemon running right now.

      If you make clock_systohc=”YES” in the file /etc/conf.d/hwclock then the time in the system clock will be written to the BIOS (CMOS) clock (a.k.a. hardware clock) when you shut down your PC. Sabayon Linux has the file configured this way by default.

      Note that, by default, the NTP daemon won’t correct, all in one go, a time difference between your system clock and the remote NTP server if that difference is above a certain size. However, if you want to override the default behaviour, i.e. allow the NTP daemon to make a large first adjustment to the system clock, you can set the environment variable NTPD_OPTS in the /etc/conf.d/ntpd file as follows:

      NTPD_OPTS=”-g”

      This would mean that you would not need to run ntp-client before ntpd. However, if you run ntp-client automatically — either once after start-up or periodically — then that would be good enough for the typical desktop user and could be an alternative to having a continuously-running NTP daemon. Nothing stops you doing both if you want, of course.

      1. Thank you. For something this detailed, perhaps you should post it in the forum.

        Btw, running NTP is not as involved on a Debian-based system. It just works.

Leave a Reply to Daksh Sharma Cancel reply

Your email address will not be published. Required fields are marked *

Get the latest

On social media
Via my newsletter
Mailchimp Signup Form

Partner links

1. Attend Algorithm Conference, a top AI and ML event for 2021.
2. Reasons to use control panel for your server.
3. DHgate Computers Electronics, Cell Phones & more.
Hacking, pentesting distributions

Linux Distributions for Hacking

Experts use these Linux distributions for hacking, digital forensics, and pentesting.

Categories
Archives

The authors of these books are confirmed to speak during

Algorithm Conference

T-minus AI

Author was the first chairperson of AI for the U.S. Air Force.

The case for killer robots

Author is the Director of the Center for Natural and Artificial Intelligence.

Why greatness cannot be planned

Author works on AI safety as a Senior Research Scientist at Uber AI Labs.

Anastasia Marchenkova

An invitation from Anastasia Marchenkova

Hya, after stints as a quantum researcher at Georgia Tech Quantum Optics & Quantum Telecom Lab, and the University of Maryland Joint Quantum Institute, I’m now working on superconducting qubit quantum processors at Bleximo. I’ll be speaking during Algorithm Conference in Austin, Texas, July 16 – 18, 2020. Meet me there and let’s chat about progress and hype in quantum computing.