Getting the deleted partition back using TestDisk or Timeshift?

So stuff is missing out of the /etc directory?
How can that be?
Surely timeshift can copy it back correctly.?
Did you clear the partition before restoring to it?
Perhaps all this confusion is caused by restoring stuff on top of residue of a previous OS?

No. My research indicated restoring from Timeshift on top of another OS was do-able. Let me know if we can test anything from root shell prompt. You’d think fsck would be there, can we install it? from CLI?

Sheila

1 Like

I tried install, but of course since it is ‘not there’ no go. I did try booting from grub (normal LM) and it of course got sent me back to the tty1. I think without restoring a point before Cockpit, we will not be successful. So I will do that and report back later. I know it’s late for you. Thanks for all your help.

Sheila

I will say this. I finally got into the tty1 after realizing that the displayed name on the login screen is not your login id: it is the home folder name. So logging in only got me to terminal as user.

After restoring an older snapshot from Jan 12, 2024, where I searched for Cockpit and found it being removed, I figured we were good. But still that tty1 appears AFTER the failed issues at boot, and a new FAILED was added: Failed to start: Rotate log files. Hmmm.

So now I will, indeed, use @nevj 's ‘vote’ and do a fresh install of LM and then see if a timeshift restore helps anything from there.

Will update after/when I have a working system that takes me to a normal login screen.

Sheila

Quick update: I have a working “edge” LM which uses the newer kernel. I am making a complete image of that prior to installing any of my own apps via Timeshift. From there I will try to restore a recent snapshot, but considering I was using the older kernel, it may revert to that one.

Seeing all these things now reminds me how I was seeing the 6.0.5 kernel (apparently used by Kubuntu after recent upgrade) and that should have told me I was not using LM in terminal or grub shell, as it was using 5.15.x. Alas, live and learn.

Thanks,
Sheila

Not sure I believe that .
Restoring LM on top of Kubuntu may be the problem.
I suspect you created ‘Kumint’ … some files from each OS.
becase I dont think Timeshift would delete anything… it just
does something like rsync.
So, if you want further pain, you could try using gparted to
reformat the partition before using timeshift.

If you do my vote and reinstall, you still should reformat first.
Installing over an existing OS is not recommended.

After this is over, you can write your version of “The Timeshift Chronicles”.

Lol…yes, indeed. I found some ‘k’ files out there in tty1 terminal.

That is exactly what it uses, but it does delete things. That is why before the 2nd restore, I searched for Cockpit and found it referenced as “deleting flatpak” so I thought that was maybe before I installed it.

I had often heard remarks not to rely on Timeshift, but to date, it has never failed me; although I have never deleted the working OS partition before and always ran it within the current install if something was broken and then it was fixed.

My thinking, though, doesn’t there have to be an ‘original’ full image since TS is only syncing changes along the way. So how could you have a completely different system and then write partials (hourly, daily, boot, etc.) over that and get it to work?

The only original I see is that one from Oct 2023 and if I have to, I will revert to that rather than start from scratch.

In my opinion, if i attempt restoring any more daily or weekly snapshots and they do not work on a fresh install, then it must be due to that original full scan not being part of the restore.

Will update later as I am getting ready to do first snapshot restore.

Absolutely…lol.

Sheila

I am pretty sure Timeshift snapshots are located by default in the “/” (root) partition.

One of the things I do when a perform a fresh install of LM is move Timeshift to it’s own partition.

1 Like

They are, by default. But I must have sent them to my permanently connected external HDD as that is where I found them. And as far as I can tell, had they only been on that deleted partition, TS would never have found them.

Sheila

I just checked my newest Lenovo 2 in 1 and since it is mobile, I do not have any external sources for the TS snapshots. I need to do this but now I am “gun-shy” about messing around with partitions after the latest fiasco. LOL

But you are right. I need to make a new partition for just those snapshots. Now if I can figure out how to do that without destroying anything currently on the only Linux partition of Pop OS.

Sheila

I thought, when you first used Timeshift, it made an original full image, then later snapshots synced the changes.
So if you delete everything, then restore to a given snapshot, it should use that original full image plus all the snapshots up until the one you chose.
You have to be able to recover from accidentally losing everything, or it is useless.

When I last tried Timeshift (it was actually in Mint) it looked around and found an empty partition and put its images there…without asking me… which I did not like.
So I think if it cant find any vacant partition, it will put the images in the root filesystem… which is a bad place to have them.

Do you not have the original full image?

Even though the “O” stands for manual or on demand, it is the initial snapshot. So how does that work when each of these are separate snapshots? Like I said, I can’t see TS only using an hourly snapshot from yesterday to restore to a new install unless it goes back to the original.

And given that all of my originals & sequentials are on an ext HDD (I don’t even remember but what I ‘copied’ that Oct '23 “O” to timeshift) I have my doubts that it links incrementals to originals.

For instance, I just installed LM. Did not install anything else. Immediately made a snapshot in that same folder where all the old ones reside. But TS shows at the bottom:
Latest snapshot (the one I just made)
Oldest snapshot (the one I just made)

So I am thinking, you only link those sequentials to the original? If that is so, me trying to restore a snapshot from the old LM install may indeed NOT work here.

We will see, but so far, this is taking waaaay longer than any dry run I have seen just to build a file list?

Sheila

It has to link them. Does it not know you shifted things to HDD… or maybe did shifting them destroy its links?
We had better find out… next time we want TS to work.

How did you shift them?

Well since today is fresh in my mind, first start of TS on a fresh install, you are given the option of where to put the snapshots and just like gparted, it brings up all devices attached to the machine.

Now I know I did not copy all of these daily, etc. over the past few months, so I must have chosen that to be the location. However, I am thinking that once I discovered you could use an ext source for the snapshots, I simply created an additional folder (named Timeshift) on that Linux Home Data partition (where all my symlinks point) and then went into the app and changed the location in settings.

I must say that I do not like this “edge” LM as everything is so slow. May have to revert to the old kernel anyway.

Sheila

@Sheila_Flanagan you sure are learning a lot about grub and Timeshift with your efforts to recover the LM partition. Wishing you good luck. I ran into trouble with grub one time when I deleted a “test” distro partition when I was finished testing. I forget the outcome, but I believe I ended up doing a fresh install.

Beside using Timeshift on a separate partition, I make a monthly standalone backup of the efi and root partitions using Clonezilla just encase TS can not recover my mistake. Sort of like saying “Close the barn door after the horse got out.”.

1 Like

Well here’s what I know so far…I think.

First restored the most recent “O” which was Nov 1, 2023. That was back before LM upgraded to 21.3. This was all done inside the live CD via GUI. System rebooted and my LM was back…sort of.

I am not sure how TS handles app settings, but I only opened one and it no longer held some data that I know it had at that point.

So rather than just move forward to the next daily/weekly/hourly, I jumped to the 1st Weekly snapshot after upgrade to Victoria 21.3. This took me out of the OS in order to do a multitude of files. Note on both of these I chose to check the box on bootloader initramfs update. Restore of “O” had this and booted fine. Next restore, I saw

So everything went without error except the initramfs got the same “fsck” error on all 3 versions.

Now the system booted back to tty1 without my logging in and went to a prompt where it iscurrently dealing with iwlwifi unhandled alg:

So the moral of this story is…don’t check the initramfs option–probably why it is left unchecked by default.

So I guess I will try the same snapshot without that bootloader option and see if she boots.

Thanks all,
Sheila

UPDATE: maybe it was not done with all that from the last screenshot, but I decided first to reboot, hold shift and GRUB came up. Chose normal boot and landed on tty1 login. I’m guessing something between Nov 1 and that update I chose included that ttty1 login. Will attempt boot repair and see if we have fsck now in grub shell.

I like that. TS is complicated, CZ is simple, it will fail less often

Okay, something is not right. More research uncovers that when the login screen appears, it has already bypassed the tty1 login. Does this really happen?

But that if your LM is stalling at that, something is not right with the system. And the slowness—never has been like this.

So since I restored from Timeshift, wondering: it does not wipe the disk and then restore? It just restores by adding to and deleting certain things. Maybe there is some residual stuff being left. So this time I am doing the fresh install of normal LM (not edge) and see if that makes a difference. At least I will be on current version.

BUT, if I have to restore back to ver 21.2, using the “O” version and then keep restoring forward… I just don’t know how TS just deletes or creates nor if it does wipe anything prior to restore.

I will see how the system acts after another fresh install and go from there. But if anyone knows about the whole “tty1” always being present, I’d like to know as I thought it was me who caused that with the install of Cockpit.

Thanks,
Sheila

The mystery is… why should a TS restored system do that, when the original LM never did it.

and
Do you have to restore the full image, and then the snapshot?
Can you not give it a date, and tell it to restore to what it was on that date? I guess I dont understand TS.

My question exactly. That was my understanding till now. But, of course, that may only work when you are on the same system, just needing to roll back or forward. This instance is we are starting with a completely different system and trying to put a snapshot onto it.

Reading @Abishek’s article on Timeshift, he says you can try out a distro (installed) and then if you change your mind, restore your old TS snapshot to replace it. That would indicate this can be done.

But, like you, I do not know why you cannot just choose a snapshot from any date and use it. I do know that the “o” restore I did today, did not ever show the tty1 login. Restoring forward after that, it came back.

Sheila