I hope this is not a complicated question to answer.
I had a laptop with primary SSD and secondary HDD. It came with Ubuntu 20.04 pre-installed on the SSD, and I mounted /home and /var on the HDD, and used the laptop for several months without issue. Then the hard drive failed catastrophically.
I thought I had an adequate backup strategy (via regular background rsyncs to a NAS) but when the HDD failed (>25% bad sectors on efsck) I checked the NAS and found that the job has been silently failing for weeks. I suppose this could be due to the defective disk, there's no way to tell now.
SO: I have an undamaged 500GB SSD which contains:
- a tiny EFi partition
- a 495GB primary Ubuntu partition (20.04)
- a 4.3GB swap partition
- 1.1MB unallocated
and a trashed 1TB HDD which was partitioned into:
- 500GB ext4 /dev/sda1, mounted as /home
- 300GB ext4 /dev/sda2, mounted as /var
- 200GB unallocated
I have a replacement HDD supplied under warranty but I'm not sure if there's a way to retain the existing software installed on the primary partition and somehow catch my home directory up with it (the software manager in Ubuntu croaks because my home directory is rubbish).
(To clarify: Booting from the primary partition, it walks me through several "brand new user" dialogs and then the software manager reports "structure needs cleaning" and halts. Booting from a portable Ubuntu 22 on a USB drive, I can't mount the HDD partitions at all.)
Is my best option just to do a brand new install of everything over the top?
If I do go down the complete re-install route, is there a tool which can analyse my primary partition and identify exactly what packages were installed on it? Because so far as I can tell the normal way to access that information needs access to some files that are no longer accessible.
Thanks for any advice you can offer (besides REGULARLY TEST YOUR BACKUPS, that is)
Cheers, T