0

Ubuntu newbie here looking for help please to restore my lost /home, programs and settings, which is now in a state like a fresh first time install of Ubuntu, i.e. all my old documents, pictures and programs are gone. Please excuse me if I do anything wrong on this first post and for it being so long. It's been an odyssey with lots of googling learning software and hardware. Here's the background:

  1. I did a reinstallation of Ubuntu 20.04.5 using a live USB thumb drive because the already existing 20.04.5 version was running very slowly (laggy Firefox browsing) and 2nd monitor wasn’t recognized...only one monitor could work, whereas both monitors worked and system is fast and running well on 20.04.5 from a live USB. Investigating/googling I concluded the amdgpu driver was missing (and maybe more system files) based on comparing the terminal output of lshw -C video, so I thought to reinstall 20.04.5. (I'm not interested in the newer 22.04 due to problems I encountered with snap programs). The reinstall is working well except for my missing docs, pics, programs.

  2. In doing the live USB 20.04.5 reinstall, I used the Something else option shown circled-red in this attached screenshot. I didn't use the green-circle option because it clearly warns that all docs and programs would be erased.

    Install option screenshot here

    Googling suggested to use the Something else option in the screenshot link above and that it would save my docs and programs: https://ubuntuforums.org/showthread.php?t=2456393, hence I did the same. I did not format the drives during the reinstall, but that instruction is a bit different from Ubuntu's official documentation, though its screenshot shows old 14.04LTS and the upgrade/install option there says files will be kept (in contrast to the 20.04.5 installer). It seems different versions behave differently in this regard from what I've seen googling and the answers are not consistent. https://help.ubuntu.com/community/UbuntuReinstallation

  3. When I used the “Something else” above, when prompted, I mounted my nvme0n1p5 partition containing my existing Ubuntu as / and another nvme0n1p6 partition containing my old home as /home. The installer self-identified the /swap partition (nvme0n1p1) and I didn't have to manually select it for mounting. I also have a 4-drive 8TB software raid5 array, but didn't mount it during the reinstall. Here is the terminal output of lsblk run from the live USB when "trying Ubuntu":

    lsblk output here.

  4. More deeper background and why my Ubuntu system became slow in step 1 above, motivating me to re-install, so it’s understood how many changes occurred: This is all happening on a new computer build/upgrade, my first one: New motherboard, new CPU, new graphics card, old raid5 hard drives , new 1 TB NVME drive now holds the Ubuntu 20.04.5 (from step 1) which I used Clonezilla to clone the drive image from the old 60GB SSD (installed by a friend years ago, worked well), two new monitors (old computer had one). The terminal output lshw is in the attached file: https://pastebin.com/2qetrsMG .

  5. After I assembled my new computer but with the old SSD, everything was working, Ubuntu 20.04.5 booted up fine, though only with one monitor recognized as I noted. I then cloned the SSD drive image, installed the new NVMe drive, and installed the cloned image with Clonezilla, and expanded the partition sizes using GParted. Worked so far, Ubuntu booted but only one monitor worked, and I noticed the amdgpu driver was missing and browsing was sluggish. So I rebooted using a Live USB, and performance was better and 2 monitors worked, and amdgpu was present. Rebooting again on the NVMe drive returned to the slower performance and one monitor.

  6. Then I tried to reinstall 20.04.5 via the live USB, but it failed due to my SSD (and now cloned NVMe) had been formatted with MBR/bios and the live USB install just refused to work without GPT/UEFI giving a error message that no EFI partition existed, no matter how hard I tried to change my motherboard BIOS settings (CSM mode, etc) to get it to work in MBR/BIOS-only mode or use Rufus to make the Live USB install via MBR/BIOS. I had to quit the reinstall before completing the prompts.e

  7. Then I used the following procedure to convert the NVMe drive from MBR/BIOS to GPT/UEFI, supposedly without losing data. It worked well I thought. The computer booted fine: How can I change/convert a Ubuntu MBR drive to a GPT, and make Ubuntu boot from EFI?.

  8. Then I reinstalled 20.04.5 with the live USB as noted in step 2 above. Success! The AMDGPU driver is now present, 2 monitors work, computer is fast, but no /home files, programs, pics. No old contents!

  9. For backups, I have Clonezilla images of the SSD/NVMe drive at a few stages of this odyssey, each major operation. I also copied the /home and /etc directories via sudo cp -r to a USB drive (NTFS format). I used cp -r because I had trouble getting Back In Time to work, but this cp -r copy had some error messages related to failed /etc/systemd/... folders not copied or symbolic links not created. I tried formatting a new USB drive with ext4 filesystem, but I had trouble with that, hence I was stuck with NTFS.

Is there a way to A) use the now new/current NVMe 20.04.5 reinstalled system and recover my old /home docs and programs, or B) go back to one of my old Clonezilla images, restore it, and reinstall 20.04.5 using a different choice in step 2 above, or C) some other actions that are better?

My overall goal was to build this new computer and move Ubuntu over from the old computer to the new computer easily, keeping my old data. It's been interesting learning as I go.

  • 1
    If you converted a UEFI/gpt install to BIOS/MBR that probably erase things. And the instructions caution you to have good backups. Backups to NTFS are not good backups,as NTFS cannot store ownership & permissions. If only data you can restore you as owner & default /home permissions. Can you mount clonezilla image? – oldfred Feb 13 '23 at 22:30
  • Thanks oldfred. I converted my mvme drive from bios/mbr TO uefi/gpt, not the other way around. Does that make a difference? The link I posted said it would save my data. If i understand your comment, my NTFS "cp -r"backup is useless. Yes, I can mount the clonezilla backup image, but that would wipe out my current install, or are you suggesting I somehow mount it in parallel to my current install? – luckycat Feb 13 '23 at 22:38
  • I do not know clonezilla. But I saw where you can create a virtual system and install there or convert to .img & mount the .img file and copy anything from that. Unless you extracted a list of installed apps, difficult to get that. I do that extract as part of my script to rsync my data. https://askubuntu.com/questions/17823/how-to-list-all-installed-packages – oldfred Feb 13 '23 at 22:58
  • oldfred, I understand you to mean I can use your link to learn how to make a list of packages/programs installed on my old system, then can use it to install those packages on my fresh reinstalled system. But how to recover also my docs and old /home files? Clonezilla is used to make a cloned image of a whole drive. I googled and found this link on how to mount the old image so I can get that old package list. https://ubuntuforums.org/showthread.php?t=872832. I need to read and understand it and will do so now. This all seems complicated and I was hoping for a easier newbie method ;-) – luckycat Feb 14 '23 at 00:33
  • How large is your clonezillla file? I think you found info on extracting from Clonezilla. I do not use nor like any sort of compressed or encrypted backup. Lost too much data many years ago when space was expensive. Now that drives are relatively inexpensive, it just want copies of my data. So I use rsync to other drives, flash drives & critical data burned to DVD periodically, so old versions still can be found, if needed. – oldfred Feb 14 '23 at 03:49
  • Thanks karel. Seems like those tools in your link are for recovering a few files that were accidentally deleted but maybe still on the disk. In my case, I am missing all my /home files and sub folders, and programs, so those tools might not be best for me. – luckycat Feb 14 '23 at 07:53
  • oldfred, my latest clonezilla image file is only 5.0GB (after changed to UEFI/GPT and reinstall of 20.04.5). The image file prior to that (still on mbr/bios) is 11.8G. Not sure why. If I can mount those old images, do I just copy and replace /home/... on current system with /home/... from the clonezilla image? Alternatively, should I just try a re-install of 20.04.5 again but start from a old recovered clonezilla image if there is a way you know to get the 20.04.5 installer to keep my old files and programs? Thanks also for your good points about uncompressed backups.. – luckycat Feb 14 '23 at 08:09

1 Answers1

0

I was finally able to solve my problem.

The path I took was to restore an older clonezilla backup image that still contained my /home data and programs, but was laggy and had graphics issues (step 7 in my original post). The AMDGPU generic graphics driver was missing, then I realized the linux kernal was very old (5.4.0-139-generic) and I was not being offered newer kernels in "sudo apt update". After installing a missing package by "sudo apt install linux-generic-hwe-20.04" from this post, bingo! my kernals then properly updated to the latest versions (5.15.0-60-generic) which included the AMDGPU driver, which fixed all my graphics and laggy performance issues. I'm happy now with latest Ubuntu 20.04.5 kernals and working two monitors and /home, settings, and programs still present.

My other learnings/takeaways:

  • Converting from MBR/Bios to GPT/UEFI using gdisk and gparted and then adding back GRUB with "boot-repair" was successful and saved my existing /home , settings, and programs.
  • Subsequently updating Ubuntu with the GUI installer for 20.04.5 from a Live-USB drive and selecting the "something else" option seemed to erase my old /home, settings, and programs even though I was sure to NOT check the "format" tick box. The program seems to format (at least erase) my /home, and programs anyway, in contrast to what others experienced with older Ubuntu versions. I repeated this a few times to be sure. Maybe this is a bug in the 20.04.5 installer??

Thanks to oldfred and karel for your comments. Hope mine help other newbies like me :-).