Getting the deleted partition back using TestDisk or Timeshift?

Yes and yes.
I think we are getting on top of it now

mv grub.cfg grub,cfg.hide
ie rename it

Yes, use blkid to list the uuids

One other thing may be necessary… writing grub in the efi boot partition… I think you said TS would not setup the EFI partition.
You can do it with the live distro…
grub-install devicenameofdisk
that will write grub in the EFI partition on the nominated disk
Do it before you restore

I never noticed any difference… maybe the gparted usb stick is having problems with your graphics card… there are usually
failsafe boot options.

1 Like

Sorry, this is new territory for me. Since I have the partitions already set up and am then in live session, in terminal I type the above command, but how do I know the name of the disk? In other words, do I need to point to the EFI PARTITION in name of disk?

Sheila

I may need help with checking the hooks before rebooting. I will navigate to the destination TS provides and see if I can determine any issues, but may just post output here to be sure before rebooting after restore.

Same with editing fstab :grin:

Sheila

It will be something like /dev/sda ie the disk name, not the partition.
You dont need to tell it where the EFI partition is, if you are using uefi boot, it will just find it, on the disk that you nominate
… see man grub-install

lsblk will give you the disk names ( and all the partitions)

Okay. Is the flag “msftdata” okay for EFI in gparted?

Sheila

And all the mount points! Thanks!

Sheila

Okay. First off, I knew that msftdata was not right, but could not seem to get it set correctly in GP. Finally just used parted in CLI.

sudo parted /dev/sda set 1 esp

The fstab after restore:

overlay / overlay rw 0 0
tmpfs /tmp tmpfs nosuid,nodev 0 0

So there is nothing in it?

The output from blkid
/dev/sda1 UUID=516D-9F9A
dev/sda2 UUID=957dd872-2d3c-4a14-997a-ad7edadac79a
dev/sda3 UUID=ccfb76c8-e5fb-4a50-be14-d9ab76aaba53

But no need for PARTUUID?

Now for the rest of the issues. I have not rebooted yet since restoring the snapshot.

Well this is not working.
grub-install sda
error: cannot find EFI directory

Because I am at mint@mint prompt? (in live session)

From manpage:
Install GRUB on an UEFI system

grub-install --target=[x86_64-efi] --efi-directory=[path/to/efi_directory] --bootloader-id=[GRUB]

There is no directory yet, so I have to make it?

sudo mkdir /dev/sda1/boot/efi

cannot create directory ‘/dev/sda1/boot/efi’ not a directory

This is where I messed up. I did not do it BEFORE. Can I do it now?

I will wait further instructions here as everything I keep finding is really old info or does not apply to my situation.

Thanks,
Sheila

Oh, and that /etc/timeshift/restore-hooks.d only showed this in a fille named 50_linuxmint:
#!/bin/bash

/usr/share/ubuntu-system-adjustments/systemd/adjust-grub-title

Not sure what that means or what needs to be done before rebooting.

Sheila

Fstab should look something like this. The # sign for comments makes the text enlarged here so I replaced the # sign with a ‘–’. All the lines are comments except for the UUID lines.

–/etc/fstab: static file system information.

–Use ‘blkid’ to print the universally unique identifier for a
–device; this may be used with UUID= as a more robust way to name devices
–that works even if disks are added and removed. See fstab(5).


– root
–/ was on /dev/sda2 during installation
UUID=90908782-8b04-4f4e-b2bb-9a0f2922604a / ext4 errors=remount-ro 0 1
– home
– /home on /dev/sda4 during installation
UUID=449369c2-40c9-47e5-b757-f01483b7b9a7 /home ext4 defaults 0 2
– swap
– swap was on /dev/sda3 during installation
UUID=f45ce9d5-30a8-4c60-a929-8fdda320c678 none swap sw 0 0

1 Like

Pardon my ignorance @easyt50 , but is this your fstab? And if so, in mine, I just add these lines with UUID not the part about /root was on sda1 during installation? Or are you interpreting mine–which I thought had nothing?

I have only ever edited fstab which had all the info in it…not created it from scratch.

Thanks so much,
Sheila

Hi Sheila,

This is just an example for you. Yes, it is from my system and you are correct, you only need the lines of the UUID but with your UUID information form your system.

Good Luck,
Howard

1 Like

Sorry that I am having to post pics vs copy/paste, but since I don’t have my tools on the restored pc available yet, here is how I edited fstab:


Also, since I could not paste from the text file into terminal while editing (meaning I would have had to type it all over again), I just opened /etc as root in Nemo and edited/saved the fstab file.

Does it matter whether you use tabs between sections on lines? Just couldn’t tell looking at my Pop OS fstab but it looked like tabs were used.

Also, since the instructions stated UUID but I saw both in Pop’s fstab, is the PARTUUID okay for /efi or do I need UUID only?

Thanks,
Sheila

As for the other issues with /boot/efi, I created the /mnt/boot, mounted the efi partition to it and made the efi directory. But since it still says it cannot find EFI directory:

sudo mkdir /mnt/boot
sudo mount /dev/sda1 /mnt/boot
sudo mkdir /mnt/boot/efi

grub-install /dev/sda
Installing for x86_64-efi platform.
grub-install: error: cannot find EFI directory

So what am I doing wrong? Even though I made the directory do I also have to create a mount point with /efi and mount /dev/sda1 on it?

Sorry to be such a pain, but this is def new territory for me.

Thanks,
Sheila

I don’t believe it does.
It looked like you had the swap line commented out. Maybe on purpose.

Me too. I hope to never need to go through this myself.

When I was working on that VM on Friday I found it had both /etc/grub2/grub.cfg and /etc/EFI/efi/grub.cfg or something like that. But that was Alma.

Well, I was following Howard’s fstab and comparing with my Pop OS fstab (which is different–it hides swap??). Does it hurt anything to comment the line swap but not the UUID for swap?

What??? LOL. It’s definitely a learning experience.

Sheila

1 Like

Hey, it should have restored the fstab file with previous mount points.
Are you sure you are looking at etc/fstab on the sda disk in the root partition?
If so, you need to add a mount line for /

/dev/sda2/boot/efi is the directiory
It is a mount point in the root filesystem
It is normally mounted to /dev/sda1… ie the efi partition
It should have a mount line in fstab

If TS restored a root filesystem it should contain this mount point and it should have an etc/fstab file with some mount points defined… unless it is clever enough to realize you are restoring to different partition?

Have a close look at that root filesystem TS restored… does it look like a complete linux filesystem… /boot/efi should be there.

error: cannot find EFI directory

When you made sda1 in gparted , did you label it EFI system directory? It might need a label or maybe a flag… cant remember which?

2 Likes

You can enclose stuff like that in ‘```’
Put 3 backquotes on a line on its own
copy in the stuff
Put another 3 backquotes on a line following the copied stuff

Thanks for the fstab example… Shiela will need it

1 Like

That is what is normally done.
Only the lines with UUID are valid fstab entries… the rest are
real comments, not commented instructions.
You can use tabs

I note you got lots of help with fstab… thats great

I think maybe the EFI one was /boot/efi/EFI/grub.cfg. I can’t remember right now.

Odd. I just checked on one of our AWS EC2 instances running Alma and it has a soft link from /etc/grub.cfg → /boot/grub2.cfg. Not sure why they’d be different between a VM on VMWare and an EC2 instance on AWS, but they were.

In any case I think you were running on Pop!_OS as am I. Here I see /etc/grub.d/35_fwupd and /boot/efi/EFI/ lots of files in that directory but nothing named grub at all.

Different versions?
Differences due to platforms?

Sorry not much help.

At this point, I am not sure of anything…lol.

I assumed after the restore, like when I have a running system, that I can choose “File System” from the left and see sys files of my system. But now, I do not think so. For instance, if I had autostart apps which would show up in the autostart folder, then I should see them now? Cause there is nothing in these sys files that tell me this is MY restored install.

If we restore, but have not rebooted, are those restored sys files even available? Let’s establish that I can see those files or else I will have to reboot and I have not updated grub yet as I cannot from where I am now.

Thanks,
Sheila