0

Let me preface by saying I am completely new to Ubuntu and not very well-versed in computer language in general, so if I misuse terms or say things that don’t make sense, I apologize in advance.

I recently got a desktop computer with a lot of storage space (500GB SSD, 1TB HDD) and 32GB of RAM. I want to install Ubuntu on the HDD, as Windows 10 is already on the SSD and duel-booting seems like a very daunting process. I would like to set it up so that when I boot up my computer, I have the option of choosing which OS I want to use.

Here’s what I’ve already tried: I formatted a USB stick for the Ubuntu boot, explored the BIOS menu a bit in case anything went wrong in the start-up, and went through all the steps of the install. I manually set up the needed partitions (/, /home, swap) and made sure the boot loader was set to the HDD, or “sdb”. However, when I tried to advance past that stage, I got an error message that the program also needed an EFI partition or it wouldn’t boot correctly, even though my earlier research seemed to suggest that the /, /home, and swap partitions were all I would need. So I went back and googled EFI partitions (mostly just trying to find what size it should be) and then added a 500MB EFI partition to the sdb. I set the EFI as “primary,” and the other three partitions as “logical” (some people said those labels don’t really matter to Linux, so that may not make a difference, but for the sake of total accuracy I’m letting y’all know anyway).

After completing the installation, it stopped, never took me to a login or anything. It was on a loading screen for a long time, and when I started pressing keys on the keyboard to see if I could make anything happen, I got a screen of text, with lines like “Starting Permit User Sessions...” “Started Unattended Upgrades Shutdown.” “Finished Permit User Sessions.” “Starting GNOME Display Manager...” and so on. It got stuck on “Started Network Manager Script Dispatcher Service” and wouldn’t advance beyond that, other than a message at the bottom that said “A start job is running for Hold until boot process finishes up” along with a little timer that showed how long it had stayed stuck on that process. Over multiple reboots, longest I let it go was a little over 30 minutes, and it never moved beyond that “Network Manager Script Dispatcher” process.

When looking online, it seems when people have a similar problem, the answer always involves entering code into a command prompt. Which is a problem, because I don’t think I can open a command prompt if the computer won’t progress beyond the loading screen. Or if there is an option for this, I have no idea how to do it. If I press F2 during the reboot I can get the BIOS menu pulled up just fine, and I managed to figure out how to change the boot priority to get back to the Windows OS, but I can’t access or even see the HDD from my “Devices and Drives” panel in Windows anymore. I have no idea how to do what I want to do now, which is just to wipe Ubuntu from the HDD and start from scratch.

So, to sum up, my question is: how do I uninstall Ubuntu from my HDD, or just wipe the HDD completely (because Ubuntu is the only thing on it currently), if I can only get onto Windows on the SSD and can’t see the HDD listed in my drives from there? And, to follow, is there anything obvious I did wrong in my original Ubuntu install that I need to change for my second attempt?

Sorry for the obnoxious length, and thank you in advance for any advice!

  • It’s version 20.04. I think it’s a newer version, but I’m not sure – Kara Danielle Jun 08 '20 at 20:15
  • a few things to consider: 1) Windows should be installed first; 2) You have to be consistent in your use of either MBR or UEFI; 2b) if this is a new PC you should be using UEFI with a GPT partition table; 3) you need to make sure your installation media is valid - did you compare checksums?; 4) if you are completely new, let your OS installer set up your partitions - format the hard drive as GPT first (remove all partitions) -- Windows will create a EFI partition; 5) take NOTES and be specific in your question especially regarding errors. It's hard to help if we don't know what's going on. – Nmath Jun 08 '20 at 20:35
  • Please shorten the question by editing, this is not an essay competition. Be to the point rather than painting colors here and there. – Abhay Patil Jun 08 '20 at 20:49
  • user: yes, I can boot Windows 10 fine. I just can’t see the HDD in my devices panel from Windows anymore, and I’m not sure if it’s supposed to do that. – Kara Danielle Jun 08 '20 at 21:11
  • Nmath: 1) Windows is installed, 2) I’ll have to do a bit of research on those terms but thank you for the info, 3) when I get back to the computer I’ll check the install media and 4) try reinstalling using the OS installer. And 5) I apologize if I didn’t provide enough technical info, again I’m very new at this and wasn’t sure how to explain some of the things I was seeing – Kara Danielle Jun 08 '20 at 21:15
  • Abhay: apologies—again—the flowery writing is a habit left over from college. I’ve edited it down so hopefully it’s more precise. – Kara Danielle Jun 08 '20 at 21:16
  • 1
    To tag a person do it like this @KaraDanielle this is used to tag a person – Abhay Patil Jun 08 '20 at 21:24
  • "I can boot Windows 10 fine. I just can’t see the HDD in my devices panel from Windows anymore, and I’m not sure if it’s supposed to do that." Wonderful to hear Windows boots. Windows does not understand ext4 and swap partitions used by Ubuntu. It is normal that Windows won't recognize the HDD if it has no other Windows friendly partitions. – user68186 Jun 08 '20 at 21:34

2 Answers2

2

UEFI Boot from Installation USB

Since during your first install Ubuntu asked for ESP, you should be doing this already, but let us go through the basics.

  • If Windows 10 is installed in UEFI (as opposed to Legacy BIOS also known as CMS) mode then you must install Ubuntu in UEFI mode.
  • If Windows 10 is installed in Legacy BIOS mode you must install Ubuntu in the same mode.

The Ubuntu installation mode depends on what you choose when you choose to boot from the USB. See this answer for how to figure out if you have booted the installation USB in UEFI or BIOS mode: Installation problems with GRUB, can only install by reinstalling Windows in legacy mode but need to keep in UEFI mode

I assume Windows 10 in this computer is installed in UEFI mode. You should verify before proceeding.

Check Windows 10 boot:

Verify you can boot Windows 10. If you had previously changed the boot order in bios to boot from HDD, then change it back to how it was before, boot from the Windows SSD. If Windows does not boot, search this site on questions about how to revert back to the Windows bootloader.

Erase HDD for a Fresh Start

Boot from the Ubuntu Live Installation USB. Select Try Ubuntu without Installing option. When Ubuntu boots up open the app called Gparted. On the top right corner select the correct disk, in your case the HDD where you want Ubuntu. Make sure it is the right disk!!!

In the main window of Gparted you will see the partitions you had created for Ubuntu, ESP, /, /home/, swap etc. If you don't recognize the partitions made for Ubuntu, look for the correct drive.

Once you are sure we will proceed to deleting all the partitions. Normally, I would recommend you delete all the partitions you created and leave the HDD unallocated. However, since you mentioned primary and logical partitions in your question, I assume your HDD has an old fashioned Master Boot Record (MBR) partition table. This kind of partition table can have only 4 primary partitions and to avoid that limitation you need logical partitions. Newer systems with UEFI use Guided Partition Table (GPT) that does not have this limitation.

If your HDD has MBR this is a good time to switch to GPT. In the Gparted menu select Devices > Create New Partition Table and change the type of partition table to gpt:

enter image description here

This will delete all the partitions in the HDD. If you have any partitions with data, documents, music, photos, videos, etc. you value, don't do this!

Now we are done with Gparted. Close the app and proceed to the installation.

1. Easy Installation

Since you are just starting with Ubuntu I recommend going with the defaults where possible. This means no separate /home and swap partitions. This method will also put the bootloader in the ESP of the SSD where the Windows bootloader is. One disadvantage of this is, sometimes Windows upgrade may overwrite Ubuntu's bootloader. If that happens you will have to fix that at that time.

You can click on the Install Ubuntu icon from the live running version of Ubuntu. Proceed with the installation until you come to the window below:

enter image description here

Select Install Ubuntu site by side Windows as shown above. When you click Install Now button you will see something like this:

enter image description here

Note: the disk drive location in this picture is sdb. Make sure this matches the location of your HDD. This means Ubuntu installation has found the unallocated disk space in your HDD and assumed that you want to install Ubuntu in the HDD. If you don't see the correct device name at this point STOP.

Note: As mentioned above this process will use the EFI System Partition (ESP) in the Windows SSD to put the bootloader. Don't try to change it to the Ubuntu HDD. There is a bug in the installer that will revert it back to the Windows SSD.

The rest of the installation should be familiar by now. If all goes well you will have a working dualboot computer.

2. Manual Installation

If you really want to have a separate /home and/or a swap partition(s) or if you don't want to the Ubuntu bootloader to be in the Windows SSD, then this is your only option.

The process is a little more complicated because of the bug I talked about.

For Ubuntu 23.04 and above

I understand that this bug was fixed in 23.04. I have not tested it. If it works, the Workaround below is not needed anymore.

Bug Alert!

There is a bug (bug number: 1396379) in the Ubuntu installer that installs the grub bootloader on the first ESP it finds. See https://ubuntuforums.org/showthread.php?t=2182302 for discussions on this.

To workaround this bug you will need to take a few extra steps.

Workaround

  1. When you boot from the LiveUSB in UEFI mode, use the Try Ubuntu without Installing option.
  2. Open the Gparted application when the Ubuntu desktop starts.
  3. Select the Windows (first) drive within Gparted at the top right corner(1):

enter image description here

The NVME drive in this picture does not have Windows. However, it has an EFI System Partition (ESP).

  1. Highlight the ESP in the bottom list of partitions as shown above (2). Right click on the highlighted partition and select Manage Flags from the context menu. You will see:

enter image description here

You should see two flags, boot and esp checked. Uncheck those two flags. Click Close button to exit the Manage Flag window. Click the green "Apply" button if it is clickable.

You will need to restore those check marks once Ubuntu is installed using the same above process so that Windows can boot from the first drive.

Close Gparted.

Reference for the workaround.

This is the end of the workaround.

See this answer for details on how to proceed:

Dual Booting win 10 and Ubuntu 18.04 on two separate physical ssds

Basically either you will have to disconnect the the Windows SSD or disable it using the UEFI (BIOS) menu. Install Ubuntu on the only remaining HDD. Connect or enable SSD.

Once you have done all that. Change the internal boot order to HDD first in the UEFI so that the ESP in the HDD takes precedence. All the details are in the above answer.

Hope this helps

user68186
  • 33,360
  • 1
    How you boot install media, UEFI or BIOS is then how it installs. I have yet to get Ubuntu to install grub boot loader to ESP on sdb, without this work around. Posted work around to manually unmount & mount correct ESP during install #23 & #26 https://bugs.launchpad.net/ubuntu/+source/ubiquity/+bug/1396379 You can let it install grub to ESP on Windows drive. But copy /EFI/ubuntu & /EFI/boot to sdb's ESP. Only if your Ubuntu HDD is seen as first drive will it install grub to that drive. Some also suggest disconnecting drive or in UEFI change to disabled for install so seen as first drive. – oldfred Jun 08 '20 at 21:22
  • @oldfred I agree. Your comments are valuable to me. I have anothe answer with pictures showing the difference between booting USB UEFI and USB BIOS. The first link in the answer points to that. The last link in the answer above deals with the bug and putting ESP in on sdb. – user68186 Jun 08 '20 at 21:29
  • 1
    @user68186 That worked! Guess I was getting in over my head trying to do the manual install. Thank you so much!! – Kara Danielle Jun 09 '20 at 00:34
  • @KaraDanielle You are welcome. I have added workaround instructions for the bug now, for future reference. – user68186 Jun 09 '20 at 00:44
0

You should be able to re-install Ubuntu from an USB and select the option:

erase disk and install Ubuntu

and let the system make the partition tables automatically.

You should view the disk once you are installing Ubuntu, and if you have 2 separated disks, one for each OS, you shouldn't have problems by doing the automatic installation and erasing previous installation.

Nandete82
  • 329