Removing Windows from one and installing Ubuntu on another drive

Hi,

I bought a new pc with 2 SSD drives. For testing the shop installed Windows on one of them. I installed Xubuntu on it and expected the Windows partition would disappear, but it didn’t and now it’s still on the drive and it was added to the boot menu by the Xubuntu installer.

So how do I remove the Windows partition (I want the drive to be NTFS for file storage) and the main drive ext4 for Xubuntu, no LVM, but I do prefer swap (I have 32GB RAM, so for what I read 32GB RAM should be right) and I think it’s best to do a fresh install of Xubuntu as well.

How do I go about partitioning and installing? I have a Xubuntu 24 thumb drive, but that’s for reasons unbeknownst to me unreliable, and a Xubuntu 22 thumb drive, that the last time I checked seemed to be working fine, so I think I better stick with that one and upgrade from there. I believe the installers for both 22 and 24 are the same, so that shouldn’t make any difference.

I do know how to use GParted, so I think I could at first just reformat the drive with Windows to an empty NTFS drive and then simply install Xubuntu and then I think the Xubuntu installer would not see the Windows partition anymore so it would not be in the boot menu again, but I’m just not sure if that’s the right way to handle this.

I hope someone can help me out with this. It’s been years ago since I’ve been partitioning and such so I could need some guidance. Normally with one a single drive I’d have no problems, but now with this rogue Windows drive and the entry in the boot menu I better get it right.

Thanks for any help.

Xubuntu only releases deb based products, so there is 24.04 LTS & 22.04 LTS; so I’ll assume you’re talking about them.

Partition the system however suits you. If you’d prefer not to use the installer; fair enough. I actually prefer using tools I’m more familiar with too, so I’d use gparted or KDE Partition Manager to partition the system exactly as I wanted, I ensure none of my partitions are the same size (so they’re easy for me to detect; sizes & details usually written on a scrap of paper), then I select them using the installer & tell the installer how to use them.

Xubuntu 22.04 LTS uses the ubiquity installer, where as Xubuntu 24.04 LTS uses the ubuntu-desktop-installer so they do differ; but that’s mostly the code underneath & how they appear on screen, but what you do with them is essentially the same.

FYI: My current system is on a single partition, with the required ESP or EFI System Partition too, though I also have another partition as my system is dual boot (another Ubuntu release, it shares the same ESP though). I’m using this partition layout as I used a QA testcase to install it, otherwise I’d have created a separate /home for each of my Ubuntu’s. I have other boxes that don’t have an ESP, but those boxes are rather old & thus box firmware doesn’t know how to use the ESP (using MBR only).

I don’t know how to advise you in regards partitioning, as your usage of the install will dictate what will work best for you, but generally KISS or keeping it simple is usually best. I’ll provide

https://help.ubuntu.com/community/HowtoPartition/PartitioningBasics

Thanks for your reply. I just added a paragraph to my original post (the second from the bottom), when you were typing I think. Maybe this is useful information to respond to and you can edit your post accordingly. I’m in dire need of sleep right now so I’ll be visiting and reading later again. Thanks again!

If not using Windows, do not use NTFS. NTFS will require maintenance, chkdsk or defrag that you only can do from Windows. I might backup Windows, just to have a copy. Many come back after installing Ubuntu and find they want one game or program that only runs in Windows.

If Windows is installed, it will be in UEFI one time boot menu and have files in the ESP - efi system partition. If totally re-partitioning drive be sure to use gpt partitioning. You can use live installer to remove the /EFI/Microsoft folder in the ESP. And you can use efibootmgr to remove UEFI boot entries.

man efibootmgr
sudo efibootmgr  # note older copies needed -v to see details, newer versions give too much detail with -v parameter.
sudo efibootmgr -b XXXX -B
1 Like

Hi guiverc and oldfred

Thanks for your replies.

I currently use 22.04 and that’s on the thumb drive I’m going to use again because the 24.04 thumb drive just doesn’t work well. It interrupts in the main menu’s and then I’ll have to start everything all over again so I don’t trust it to use it for full install.

I normally format all my non-Linux drives NTFS. But maybe I could format the second drive ext4 as it’s an internal SDD that’s not gong to be connected to any other pc I suppose, but I’m not aware of having run into any problems with my NTFS drives without the maintenance either.

I don’t need Windows on this pc, I’ve not even booted into it because it asks me for MS account details that I don’t have, and I don’t have a registration key either. I have had no need for Windows for years. I do have a Windows install on the pc I’m typing this on though, but I haven’t started it for years and maybe it won’t even run at all anymore. And I have a laptop with dual boot, but the last time I updated Xubnutu on that one (also some years ago I think) Windows wouldn’t start again after that. I tried a Grub-repair to no avail. But when I’m in need of Windows I’ll probably come here to ask for assistance on how to solve that one.

Now about the new install. I can use the installer partitioning but I find the installer’s partitioner layout quite confusing. I’d prefer to use GParted, but it of course depends on what I’ve got to do.

In the installer partitioner (in the “something else” part of the “installation type” menu the device for the boot loader is on “nvme0n1” drive which is the drive with Xubuntu on it as far as I know (the other drive is NTFS with Windows boot manager on it). Both drives have what I think are primary partitions of the “efi” type. There’s noting in the installer partitioner that indicates how it’s formatted besides this efi type in one of the primary partitions, but GParted says there’s a fat32 and a “lvm2 pv” filesystem on the linux partition. I don’t need this lvm formatting I think as I want to separate drives and as far as I’ve been able to figure out this lvm formatting merges physically separate drives into one virtual drive or something like that. When installing I won’t opt-in on that option.

I’m sorry for my ignorance, but I don’t know what to do with this efi, should I remove all of them as oldfred described? When I do 'sudo efibootmgr" I get 5 entries, Boot0000 being the Windows Boot Manager. And if so, should I do that from the Live CD right before re-installation or from my current install? As you can see I’m confused.

There is a 2 GB swap partition (as seen from the Live CD), but it’s not really clear to me where that resides. I can’t even find it in GParted, I assume it’s on the Linux drive.

Maybe I should write down some planning and you can correct me where I go wrong:

  • Boot the Live CD/thumb drive.
  • Remove all efibootmgr entries (Boot0000 through Boot0005), where XXXX is “Boot0000” and the other entries I presume)
  • Format the current Linux and Windows partition to ext4
  • Extend the SWAP to 32 GB (and if necessary decrease the Linux partition by that same amount to make the SWAP fit.
  • Install Xubuntu.

Is that it? And then there will also be no more entry of A Windows partition in the Grub boot menu?

I hope you can help me out in case I get things wrong. Many thanks in advance again for the support!

Make sure you keep drive as gpt. I think gparted still defaults to old MBR(msdos).
With gparted select gpt under device, advanced over msdos(MBR) default partitioning before starting.

If you have LVM or logical volumes that is an advanced way to divide drive. Often used with servers, but if you want or need full drive encryption it also uses LVM. Best not to have LVM across drives as if one drive fails all data is lost. LVM also has advantage of easy resizing. If too many small partitions you can have issues resize and managing sizes of separate partitions. I do not use LVM.

Swap is now a file, not a partition by default. If you have a swap partition it will be used. Default I think is still 2GB, most that suggest partitions use 4+GB. The only reason for large swap is hibernation which is not recommended.

I prefer smaller / (root) and larger data partitions. But now with snaps larger / is often required. I saw one user with 20GB of snaps alone.

Bit more advanced. I have not used a flash drive for install for ages. I directly boot ISO using grub2 loopmount command. So second drive always has ISO to install to first & first drive has ISO to install to second. And now external SSD with full install of Kubuntu has ISO to install everywhere. And bootable ISO can be used for repairs. And added ISO like gparted & other repair ISO also are bootable. Or every drive is a repair drive.

Thanks for your help. But to be sure I’ve got some more questions. I can’t get to that pc at the moment so I can’t check or do anything on it, but I’m a bit in a hurry with this (my fault) and am pretty busy so have not much time to waste on this either with this so I think I better ask as asap. Not to pressure you of course, but it’s just how things are at the moment.

The questions:
Is this gpt for both drives? And is ext4 okay?
Was the rest of my planning list okay, like with the efibootmgr entries, should I delete all of them with that command you gave me?

Thanks for your help again.

If you use GPT for both disks, then you will not have to worry about removing any EFI entries or partitions.
When you create GPT on a disk, everything is then in virgin condition, ready to accept new file systems etc.

Consequently, boot the the Xubuntu installer in UEFI mode to allow automatic creation of partitions (FAT32 for ESP and ext4 for system).

When you have installed Xubuntu and tested everything, then turn your attention to the second disk.

1 Like

+1 for tea-for-one’s answer

Gpt became the new standard when Microsoft required it for Windows 8 (and newer) with UEFI in 2012. It requires MBR for BIOS installs, which should not be used except for very old systems. Systems from 2012 to 2020 usually could be booted in both UEFI or BIOS mode. How you boot live installer UEFI or BIOS is then how it installs. Newer laptop systems since about 2020 are UEFI only. But my Dell laptop says “BIOS” but once in BIOS it says UEFI only.

Ext4 is standard default for Linux partitions, but FAT32 required for the ESP - efi system partition.

Thanks again guys, things seem to have worked out so far. I just installed Xubuntu 22.04. On the linux drive in GParted I get 1 512 MB partition fat32 /boot/efi with flags “boot, esp”; this is what oldfred mentioned I suppose. The other partition is the rest of the drive, ext4 no flags. In the device information in GParted it says the partition table is gpt for both drives.

In GParted I named the 2nd drive “data”, but in Thunar in the sidebar I get “1,0 TB Volume” and in the location bar in my profile of the “media” directory I get the UUID (some very obscure lengthy code) in stead of the name. Is there a way to get the name in there? What else is a name for…

Gparted > Select disk > Select partition > Right click > Label Filesystem
Example VM1 below

lsblk -e 7 -o name,size,type,fstype,label,fsuse%,fsavail,mountpoint
NAME          SIZE TYPE FSTYPE LABEL FSUSE% FSAVAIL MOUNTPOINT
nvme0n1     465.8G disk                             
├─nvme0n1p1     1G part vfat             1% 1015.8M /boot/efi
├─nvme0n1p2    40G part ext4            51%   17.3G /
├─nvme0n1p3    30G part ext4            41%   15.8G /home
└─nvme0n1p4   110G part ext4   VM1      74%   22.5G /mntvm1/381ee381-e1af-4ca4-9

When I create partition I use gparted like tea-for-one. But often forget.
I then have terminal commands in my notes.

I like to label all partitions, particularly those I do not mount in fstab.

I have an install of plucky in my sda8. I add both labels. gpt also has a label.

sudo e2label /dev/sda8 plucky-a
sudo sgdisk -c 8:plucky-a /dev/sda

When I had Ubuntu I used the Disks app, and that was about all I used Disks for.
There also is fatlabel for labeling ESP. And parted has command.
sudo parted /dev/xxx name NUMBER NAME

I used GParted and “label” did the trick. I had mistakenly used “name”. I also upgraded to 24.04. I had to do it all over again from a clean install when the Thunderbird upgrade looked like it hung. I aborted but couldn’t log in again ans so on, so had to start all over from flash. When upgrading the 2nd time I noticed I could press enter in that “hung” screen which was just a notification and then things went smoothly until completion. So I think I’m done with the installation.

Thank you for all your help guys. I really appreciate it!