0

I installed Ubuntu on a fraction of one of my SSD drives. However, I ended up removing Ubuntu and deleting the space on the partition it was allocating.

Now there's an EFI System Partition between my D: drive and the unallocated space Ubuntu used to be - so now I'm unable to extend the D: drive to make use of the unallocated space since the EFI Partition is in the way.

How do I safely delete/move this partition so that I can extend my D: drive? From my understanding removing this partition can be really dangerous and I have no idea if Windows or something else in my Computer is making use of it - or if it was added during the Ubuntu installation.

Here's what my Disk Manager looks like currently:

enter image description here

How can I extend my D: drive without bricking my computer?

2
  • Temporarily disconnect or disable Disk 1. Try booting and if successful that means the ESP in the other drive is NOT the one from where Windows is booting. Considering the size it seems to be one created by the Ubuntu installer when following outdated and/or uninformed instructions that told you to disconnect/disable the Windows drive. wasn't it? Now, if it boots correctly with just the first drive it perfectly safe to delete that 2nd ESP. Commented Jan 10 at 19:17
  • Disconnecting the disk is not an option, how do I disable it? Commented Jan 11 at 18:42

3 Answers 3

1

How do I safely delete/move this partition so that I can extend my D: drive? From my understanding removing this partition can be really dangerous and I have no idea if Windows or something else in my Computer is making use of it - or if it was added during the Ubuntu installation.

Look inside it. Depending on what files it has, you'll know which OS uses it.

Windows is extremely unlikely to just start using an ESP that appeared long after its installation (especially one that's on another disk); its boot files are still going to be in the Disk 0 partition. Still, you can assign a drive letter to that partition and check.

(Using mountvol /s <letter:> will assign a temporary drive letter to the currently used boot partition, so by doing that you can rule out the partitions that aren't used.)

Once you know that the partition is not used (and has no Windows-related files), you can delete it through diskpart (or through GParted from Ubuntu, if you want).

DISKPART> list disk             -- List disks
DISKPART> sel disk 1            -- Choose disk
DISKPART> list part             -- List partitions
DISKPART> det disk              -- List partitions again, to make sure
DISKPART> sel part XYZ          -- Choose a partition
DISKPART> del part override     -- Delete it
1
  • Great, looks like it's indeed the 260MB EFI partition that Windows is using. When I run the delete partition/delete partition override command on the Ubuntu one (partition 4), I'm getting an error saying the following: "The specified command or parameters are not supported on this system." Could this be due to the D: disk being dynamic? Commented Jan 11 at 17:57
0

If you don't need the D partition, you may delete it from Disk Management in Windows. It's unlikely that it was created by Ubuntu, since a Linux-created partition wouldn't have the drive-letter D. Also, its total space is 1443 GB but the free space is 1280 GB, so you do have 163 GB of data in it.

However, the EFI partition is another matter, since you have two of them. The one on Disk1 is larger and was likely created later than the one on Disk0, perhaps by the installation of Ubuntu.

To avoid any risk of the computer not booting, I would leave both ESP partitions on their respective disks. It's unimportant where the EFI partitions are situated on the disks.

If D is not required, you may delete it and move the EFI partition to the top of the disk, so the entire rest of the disk is one unallocated space that you can partition to make a new D partition.

If you do need D, you can simply move the EFI partition to the end of the disk, so the unallocated space follows D and can be merged into it by resizing D in Disk Management. Windows can't move partitions, so you need a third-party utility. Use for example AOMEI Partition Assistant freeware.

See for that the AOMEI article How to Move Partition to End of Disk in Windows 7, 8, 10, 11.

2
  • I did as you suggested and deleted my D: drive, but the AOMEI partition manager cannot detect the EFI System Partition and so I can't move it. It could however pester me with a ton of popups and advertisement. Commented Jan 11 at 18:47
  • I see from your answer that you made it work. I hope you formatted the disk as Basic - Dynamic is somewhat troublesome. If Windows still boots this means that my analysis was correct and the EFI partition was added by Ubuntu.
    – harrymc
    Commented Jan 11 at 20:38
0

So I finally found a solution with diskpart.

  1. I moved all my files from the D disk and deleted it with Disk Management
  2. With diskpart, I selected the disk, select disk 1
  3. I then ran the clean command in diskpart.
  4. Restarted my PC
  5. Opened Disk Manager again and reinitialized the disk with default settings.

Really not sure why this did the trick, but the dangling Ubuntu EFI partition disappeared.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .