How to use BackInTime to restore (when user can't login)?

21 respostas [Última entrada]
Sunny Day
Desconectado
Joined: 01/05/2023

I messed up and would appreciate help restoring the system to a previous state.

The problem started after installing xfce and continued after removing it. Now, the login window shows my name, but doesn't acccept the password.

Many thanks in advance.

Magic Banana

I am a member!

I am a translator!

Conectado
Joined: 07/24/2010

Every snapshot Back In Time made corresponds to a directory (well, to a sub-sub-...-sub-directory, going through the hostname, your login, a profile id, etc.). It is named after the date the snapshot was taken. Something like 202408221230, if I remember well. You can simply copy files from it. There is an alias for the last snapshot too, named "last" I believe. It is at least like that when the backup is local (on an external disk).

But let us rather solve the login problem. Can you log into a text session? You should be able to get one typing Ctrl+Alt+F3. If you cannot, do you have recovery entries in the menu of the bootloader (if it is hidden, press ESC, F4 or SHIFT little after powering the computer on)? If not, do you know how to add the boot parameter "single" to Linux, editing the entry in the GRUB menu with the E key?

Sunny Day
Desconectado
Joined: 01/05/2023

Thank you Magic Banana! I've managed to restore successfully in the past with BackInTime, but never had this login problem, so am at loss on how to gain access to the home and etc directories, the BackInTime app, or even the backup drive.

I'm glad I've made a second drive from previous backups, which is what I'm using to write to you now.

But let us rather solve the login problem. Can you log into a text session? You should be able to get one typing Ctrl+Alt+F3. If you cannot, do you have recovery entries in the menu of the bootloader (if it is hidden, press ESC, F4 or SHIFT little after powering the computer on)? If not, do you know how to add the boot parameter "single" to Linux, editing the entry in the GRUB menu with the E key?

All of the above seems well beyond my level of experience, I could swap drives and have a go, try Ctrl+Alt+F3 (for a text session?), but I'm not even sure what to ask first.

Feeling a bit like a donkey again :)... but that part is not a problem!

Magic Banana

I am a member!

I am a translator!

Conectado
Joined: 07/24/2010

Type Ctrl+Alt+F3 (all three keys pressed) at the graphical login screen where you are stuck. That should give you a black screen where your login is asked. You enter it (it is normally the name of your home folder too) and [Enter]. Then, your password is asked. Same thing, but nothing will seem to happen while you type it.

If you can log in the text session (the problem then deals with the graphical session only, or maybe with a disk partition that is full), you will get a prompt where to input commands. Something similar to what you have probably already seen, opening a virtual terminal in your graphical session. If not (maybe a problem with the keyboard layout?), it will say "login incorrect" and you can try again. To go back to your graphical session, type Alt+F1.

Sunny Day
Desconectado
Joined: 01/05/2023

I could login at the black screen (after typing Ctrl+Alt+F3), but couldn't get back to the graphical session (by typing Alt+F1), so was a bit lost and tried to get information about login on terminal.

The command 'info login' gave me loads, but nothing I could use in this case. I then tried to update (sudo apt update), as an alternative way to resolve the login problem, but there was no option available to activate the wired connection (I'm not using wifi).

To be fair, I think that installlation is probably doomed and might be best to reinstall and restore. No problem, nothing is lost when we learn.

Thank you very much for your help, Magic Banana! Your clear guidance is always a gift!

Magic Banana

I am a member!

I am a translator!

Conectado
Joined: 07/24/2010

couldn't get back to the graphical session (by typing Alt+F1)

Maybe it is Alt+F7 on your system (does it depends on the display manager?).

was a bit lost

A useful command, to properly power off:
$ poweroff

there was no option available to activate the wired connection (I'm not using wifi)

The wired connection should be automatically activated. Was it the case when your graphical session was functional?

I doubt the problem relates to logging in per se, since you can do so in a text session. The problem rather relates to what happens at the start of your graphical session. Something that makes it crash. Maybe it tries to write something on a partition but it is full. That happened to me. To see the available spaces, you can execute in a text session:
$ df

To be fair, I think that installlation is probably doomed and might be best to reinstall and restore.

That may be faster. But the current system does not look "doomed". It can probably be fixed from a text session. Without an Internet connection (that would for instance allow to install a different display manager), that may be harder though.

Unless you made a backup right before the problem occurred, you probably want to copy the user data to an external drive before reinstalling. You can do so with in the text session. If you use Back In Time with an external drive, plug it in and execute:
$ backintime backup

Sunny Day
Desconectado
Joined: 01/05/2023

Great stuff, Magic Banana!

I'll try 'Alt+F7'.

The 'poweroff' command is so logical (once we know it, of course :)... Thank you! The learning almost makes the problem worth it.

The wired connection should be automatically activated. Was it the case when your graphical session was functional?

I would have to 'connect', I'm sure it was off.

I doubt the problem relates to logging in per se, since you can do so in a text session. The problem rather relates to what happens at the start of your graphical session. Something that makes it crash.

Nice to hear that! I think it could be my doing, trying to achieve a fully standalone system, the one I lovingly call Trisquelo (for Trisquel Local)... on the oher hand, 'Trisquelo' had no problems with mate, in fact it was working beautifully... hummm, it seems my mystake was to install xfce (minimal, just parts) without knowing exactly what I was doing.

As for partitions, the drive is 1TB and seems well spaced, but I'll try the 'df' command, just in case.

$ backintime backup

Music to my ears, using BackInTime to restore is exactly what I was after. Yes, I made a backup (home and etc) just before I installed xfce, so, it would be perfect if I could restore (with BackInTime) using terminal.

I've also saved full markings with Synaptic, so could apply and install as it was, before xfce came in. Could that be done via terminal?

Appologies for the long message + I hope it makes sense.

Magic Banana

I am a member!

I am a translator!

Conectado
Joined: 07/24/2010

I would have to 'connect', I'm sure it was off.

You mean there is proxy you need to connect to then have access to the Internet?

'Trisquelo' had no problems with mate, in fact it was working beautifully... hummm, it seems my mystake was to install xfce (minimal, just parts) without knowing exactly what I was doing.

If you have not removed MATE, have you tried launching it? On the graphical login screen, after selecting your user, there is an icon to click to choose the desktop environment. If your display manager is LightDM, I believe that icon is at the right of your user name. With GDM, it is a gear in the bottom-right corner.

As for partitions, the drive is 1TB and seems well spaced, but I'll try the 'df' command, just in case.

By default, Trisquel's installer allocates (or used to allocate?) little space for /: it may be full while /home is almost empty.

Music to my ears, using BackInTime to restore is exactly what I was after.

'backintime backup' is to back up. To restore, that would be 'backintime restore'. But I guess you only backed your user files up (not the system, which can be reinstalled). If so, I doubt restoring will solve your problem (if it is an issue with one of your personal configuration file though...). If you configured Back In Time to backup the system (I have never done that), you need 'sudo' to restore it. But, again: have you actually tried launching MATE (or other sessions) from the graphical login screen?

Sunny Day
Desconectado
Joined: 01/05/2023

You mean there is proxy you need to connect to then have access to the Internet?

No, I'm quite sure 'Enable Networking' was unchecked when I shut down for the last time (before the login problem), so would have to turn it on to activate the wired connection.

But, again: have you actually tried launching MATE (or other sessions) from the graphical login screen?

I wish I could have done it, but the option to switch betwen desktop environments had disappeared. There was only a space to enter the password, which wasn't accepted. As now, when there were no options to be seen and I could only login by using the black window (as I per your instructions).

This was the first time I tried to use another desktop environment, other than mate.

By default, Trisquel's installer allocates (or used to allocate?) little space for /: it may be full while /home is almost empty.

I tend to check how full the partitions are on a regular basis (usually with System Monitor), and the fullest was only about half-full.

On that subject, I've been thinking of removing unused localizations (with BleachBit) to make even more room and can't remember now if I've actually done it, or just checked how much space would be gained... there was a lot going on at the time.

I'm back to consider re-installing and starting afresh, which is also a good opportunity to make a copy of the installed packages using your guide... I read it and think it's great.

Could I ask you to add the command for copying "/var/cache/apt" to an external drive? Want to make sure I am doing it correctly.

Thank you Magic Banana!!

+ for this one too!
'backintime restore'

Avron

I am a translator!

Desconectado
Joined: 08/18/2020

In case you want to reinstall: if you use the network installer, if you select to use LVM and encryption, you have the option to have all in one partition, which later avoids any issue with some partition full.

Of course, this only works if you can have an internet connection during installation, and one small drawback I noticed is that some of the packages for the language I selected during installation were not installed, I had to install them manually.

Magic Banana

I am a member!

I am a translator!

Conectado
Joined: 07/24/2010

In case you want to reinstall: if you use the network installer, if you select to use LVM and encryption, you have the option to have all in one partition, which later avoids any issue with some partition full.

LVM or encryption are not required to achieve that: the "Something else" type of installation goes through a partitioning step where you can setup a single partition, where to mount /.

Of course, this only works if you can have an internet connection during installation, and one small drawback I noticed is that some of the packages for the language I selected during installation were not installed, I had to install them manually.

The "Something else" type of installation exists on the full-featured ISOs of Trisquel, which allow the installation with no network connection.

Avron

I am a translator!

Desconectado
Joined: 08/18/2020

LVM or encryption are not required to achieve that ...

I know that. I was giving advice for someone who wants encryption and who wants to let the installer do the partitioning automatically (I find the "something else" rather difficult to use with encryption). With the graphic installer, the volume for root will be separate and small, but with the netinstaller, by selecting "all in one partition" after selecting encryption (misleading description, /boot will be separate because not encrypted), root and home are not separate and have a large disk space. So the second option might be better.

Why is an Internet connection required?

The netinstaller have very few packages. In my understanding, it is meant to be used with an internet connection. I don't know whether it could work at all without.

Sunny Day
Desconectado
Joined: 01/05/2023

Thank you for the info on installation options, Avron. There is so much I haven't tried yet!

Magic Banana

I am a member!

I am a translator!

Conectado
Joined: 07/24/2010

I wish I could have done it, but the option to switch betwen desktop environments had disappeared.

Hasn't the graphical login screen changed in other ways? It would mean the installation of Xfce came with that of another display manager, where the icon to choose the session may be present, but elsewhere.

when there were no options to be seen

No gear in the bottom-right corner in particular, right?

I've been thinking of removing unused localizations (with BleachBit) to make even more room and can't remember now if I've actually done it, or just checked how much space would be gained.

I personally consider that it is more of a waste of time and a source of issue than anything else to try to save disk space or RAM if you never run short of them.

Could I ask you to add the command for copying "/var/cache/apt" to an external drive?

It aims to avoid the download of packages you currently have.

The external drive should be auto-mounted somewhere in /media. To discover where, execute:
$ mount

Let say, it is in /media/sunny/disk. cp is the command to copy and the option -r option is needed to copy a whole directory:
$ cp -r /var/cache/apt /media/sunny/disk

Sunny Day
Desconectado
Joined: 01/05/2023

No gear in the bottom-right corner in particular, right?

No gear, no options at all, not anywhere on the screen. It was quite odd.

... I personally consider that it is more of a waste of time and a source of issue than anything else...

Interesting point, I wondered about that, if removing extra/unused localizations could create problems.

It aims to avoid the download of packages you currently have.

I understand, and think it's brillliant!

Thank you for the commands and clear directions, Magic Banana - it's so helpful!!

Sunny Day
Desconectado
Joined: 01/05/2023

Magic Banana, please help!!

Everything worked beautifully until I came to instal the packages (offline, from "/var/cache/apt").

Finally, to actually install the packages on the fresh Trisquel:

1. launch the "Synaptic Package Manager" (in the "System Settings") and enter your password;
2. click on "Read Markings..." in the "File" menu;
3. open the list of packages you have transfered;
4. click the "Apply" button and confirm.

When I click on "Apply": Synaptic attempts to download the packages and offers no other option. I can't see a way to access "/var/cache/apt".

I copied "/var/cache/apt" back, to the fresh installation, but still can't access it. I checked everything, but could still be missing something, of course.

Magic Banana

I am a member!

I am a translator!

Conectado
Joined: 07/24/2010

You certainly do not have all the required packages locally. Maybe because Trisquel's installer does not copy the packages in /var/cache/apt/archives/ (for the packages that have not been updated since then), maybe because you (directly or indirectly) ran 'sudo apt clean' at some point (that commands empties /var/cache/apt/archives/), maybe because a new version of the package has been recently released, etc. My understanding is that the package manager will only download what is not already in /var/cache/apt/archives/ (in the same version). Am I wrong?

Sunny Day
Desconectado
Joined: 01/05/2023

I checked the directory before and after copying. Now I can see packages that were not there before, but don't know what to do to get Synaptic to find those packages... how do I do that? That is puzzling me.

My understanding is that the package manager will only download what is not already in /var/cache/apt/archives/ (in the same version). Am I wrong?

You are probably right! Would it help if I edit Synaptic's preferences (for same version, for example)?

Magic Banana

I am a member!

I am a translator!

Conectado
Joined: 07/24/2010

I believe there is nothing to do: the package manager does not download what is in /var/cache/apt/archives/ and downloads what is not there (or not in the latest version: you want the latest security fixes!). By beeping the content of /var/cache/apt/archives/, even though not every package for the reinstall, you have saved some time and bandwidth.

Sunny Day
Desconectado
Joined: 01/05/2023

Thank you with hugs, Magic Banana!

Magic Banana

I am a member!

I am a translator!

Conectado
Joined: 07/24/2010

You are welcome!

By the way, my last message was actually referring to "keeping" and not "beeping" (a typo) the content of /var/cache/apt/archives/. :-)

Sunny Day
Desconectado
Joined: 01/05/2023

Sweet :)