Issues with grub, partitions, missing OS (Ubuntu)

Ubuntu Version: 22.04 LTS

Relevant System Information:
An older Dell Latitude laptop

Problem Description:
I cloned a Windows installation onto a new SSD, in my mothers old laptop. I also then installed Ubuntu as a second operating system (she is planning to move away from Windows to Ubuntu as main OS over time).
After a Windows update, it looks like grub no longer recognises the Ubuntu installation, I am not sure why. I also think the partition table is a bit of a mess, but I am not knowledgable enough to make changes there.
If someone could take a look at the pastebin and point me in the right direction I would really appreciate it.

Screenshots or Error Messages:
Pastebin of output from boot-repair:
https://paste.ubuntu.com/p/SQJdJpf2vd/

Partition table says sda5 is Linux. You have UEFI Ubuntu entry & /EFI/ubuntu folder in ESP - efi system partition.
But report does not show anything exists in sda5.
I might try fsck, but if not seen as ext4 that may not work.

To see all the ext4 partitions
Partition must be unmounted:
sudo parted -l
#From liveDVD/Flash so everything is unmounted,swap off if necessary, change example shown with partition sda5 to your partition(s)
#e2fsck is used to check the ext2/ext3/ext4 family of file systems. -p tries fixes where response not required, Run both commands as they have different parameters.
sudo e2fsck -C0 -p -f -v /dev/sda5

-y auto answers yes for fixes needing response, also see man e2fsck

sudo e2fsck -f -y -v /dev/sda5

I might see what testdisk shows. Partition is there, so partition recovery not required, but it may show something?

Thanks. Yes, both the fsck commands fail because it does not recognise an ext4 partition. I am trying testdisk analysis now.

OK, testdisk analysis outputs the following…

TestDisk 7.1, Data Recovery Utility, July 2019
Christophe GRENIER <grenier@cgsecurity.org>
https://www.cgsecurity.org

Disk /dev/sda - 1000 GB / 931 GiB - CHS 121601 255 63

The harddisk (1000 GB / 931 GiB) seems too small! (< 1212 GB / 1128 GiB)
Check the harddisk size: HD jumper settings, BIOS detection...

The following partition can't be recovered:
     Partition               Start        End    Size in sectors
>  Mac HFS                 58411541 2367311563 2308900023 [D^GM-4t]
[ Continue ]
HFS blocksize=33554432, 1182 GB / 1100 GiB

Page two includes a table with partition information. Here is the table (without including the additional information for any partition):

Disk /dev/sda - 1000 GB / 931 GiB - CHS 121601 255 63
     Partition               Start        End    Size in sectors
>D MS Data                   264192    1284192    1020001 [Recovery]
 D MS Data                   264192    1286136    1021945
 D MS Data                  1286136    2308080    1021945
 D MS Data                  1490944  586056096  584565153
 D MS Data                  7248907    7251786       2880 [NO NAME]
 D MS Data                  9920443    9923322       2880 [NO NAME]
 D EFI System              27133540   27142019       8480 [EFI System Partition] [ESP]
 D MS Data                 42122867   42129040       6174
 D MS Data                 42129040   42135213       6174 [Boot]
 D MS Data                 61986843   61993016       6174
 D MS Data                 61993016   61999189       6174 [Boot]
 D MS Data                 93355507   93361680       6174
 D MS Data                 93361680   93367853       6174 [Boot]
 D EFI System             274269852  274279899      10048 [EFI System Partition] [ESP]
 D MS Data                586056096 1170621248  584565153

Testdisk seems to find all the old partitions, not sure how. But if you still have correct set of partitions, you should not attempt to undelete anything. With testdisk restore of partitions always best to know old partitions & sizes, so you can select correct set, otherwise major issues.
Even though I rarely change partitions, every backup I do includes an update to partition list.

Does UEFI settings show drive correctly?
Did you ever have a Mac HFS partition, or is that some random data that is confusing things?
Have you checked drive with Smart Status to see if good or bad? It can run lots of tests, but I do not know how to read them, just pass/fail which is not always 100% correct.

https://help.ubuntu.com/community/Smartmontools
https://www.smartmontools.org/wiki/Howto_ReadSmartctlReports_ATA_542.1
If using Ubuntu, the Gnome Disks app has Smart Control in hamburger menu at top right.

I am using a Lubuntu live USB. I should set up a USB install with persistence, but I can only seem to find relatively small USB drives around.

There has never been a Mac install on this laptop, I cannot see why a Mac FS would exist.

There has been little to no data produced on the Ubuntu install so far, user activity has just been web based. Do you think that reinstalling Ubuntu (and using the install wizard to clean up the partitions slightly) could be a solution?

Running smartctl extended test now.

the smartctl test passed with zero errors

Does Windows still boot? If so I would make sure to backup it or at least your data. Some systems have so many Windows drivers that you have to download separately that using Windows ISO can be a hassle. My dual boot Windows/Kubuntu system, needed new motherboard. I suspect Dell did not update Windows product key. Kubutu would boot, Windows would not and none of the repairs I tried worked. On thing was Dells total recovery which also reformatted drive, removing my Kubuntu. Now use external SSD, just to avoid issues in future.

I used to live near Microcenter store. And behind counter they had the flash drives. Every time I went in larger for same price, or lower price. I know have too many flash drives.

If changing NTFS partitions use Windows tools. While gparted normally works, sometimes something happens and users blame Linux. And use gparted to resize your Linux partitions. Use manual install and choose partition you want as root as / and if separate /home or data choose those partition(s).

OK. Thanks for the help.

Windows does boot, although I have the Windows (recently) backed up, since the original HDD is still there in a USB enclosure. I would almost be tempted to run Windows on the external USB disk as/when necessary, and just give Ubuntu the whole onboard disk. I will test running Windows from USB and see how that goes.

Although, before giving over the whole internal disk to Ubuntu maybe I will try to repartition for Windows from the Windows USB, and then Ubuntu from gparted / ubuntu installer.

Could the Windows clone step be creating another layer of potential complications though?

I doubt that this would work.
You probably need Windows To Go for this, if it is still in development
It is easier to boot an installed Ubuntu flavour from an external USB.

In your original report, did you notice that boot-repair did not detect your Ubuntu OS?
Although, you did have Ubuntu entries in the ESP (lines 28 to 31 in the report)?

Line 63  1 OS detected 
Line 65 OS#1:   Windows 8 or 10 on sda4

How old?
Perhaps consider a lighter flavour Lubuntu 24.04 or Xubuntu 24.04?

If it is easy to swap disks on this PC, you could install an Ubuntu flavour to the whole disk and change the disk if your mother needs Windows?
Or, are you going to try dual booting on one disk again?

Windows in UEFI mode has product key in UEFI. And since Windows is only for one system, does not allow external drives.

I am anti-laptop as screen too small, keyboard not at right height and other ergonomic factors. But needed a laptop for travel and tax software & bought a Dell. My first Windows system since XP in 2006 which was also dual boot. Dual boot worked great but had to have motherboard replaced(twice). First time dual boot still worked. Second time only Kubuntu booted. No Windows repairs worked. Only fix was a Dell image restore which erased my Kubuntu. But Kubuntu was just a copy of my desktop with tweaks for smaller screen. Do not use laptop a lot, so now use external SSD for Kubuntu which I can update from deskstop.

I did indeed. I am not sure why this is though… Also as I mentioned, it only became an issue after a Windows update.

That is good to know about Windows on USB not being an option.

The laptop should be able for Ubuntu, I think… I hope so anyway. It is about 8 years old. It has decent RAM and the SSD now.