This is a static archive of the old Zorin Forum.

The information below may be outdated. Visit the new Zorin Forum here ›

If you have registered on the old forum, you will need to create an account on the new forum.

Unable to login after apt-get autoremove

ndzz

Wed Mar 21, 2018 12:13:27 pm

Hi everybody,
I used the autoremove command in apt-get, now I am unable to login anymore.
I have no idea wether just my keyboard and mouse are not working anymore or if my whole setup is broken. Zorin seems to boot, granted some error messages while booting up, and stays at the login screen, from where my machine does not take any button presses or whatever.

I came to peace with the option of reinstalling zorin but I wanted to rescue my files via live usb stick. I used http://deferred.io/posts/2013/01/06/rec ... e-dir.html for the attempt to recover my home directory. Unfortunately, I had no success, this is what I get
Code:
root@zorin:/media/zorin/da5871be-4c91-4609-b49c-46eef42a8ea2/home/.ecryptfs/phil# sudo ecryptfs-recover-private .Private/
INFO: Found [.Private/].
Try to recover this directory? [Y/n]: y
INFO: Found your wrapped-passphrase
Do you know your LOGIN passphrase? [Y/n] y
INFO: Enter your LOGIN passphrase...
Passphrase:
Error: Unwrapping passphrase and inserting into the user session keyring failed [-5]
Info: Check the system log for more information from libecryptfs


I am pretty sure that I used my correct login password, or am I missing something here? If I cant access my home directory now, is there maybe a different way to save my installation with the live usb?

Swarfendor437

Wed Mar 21, 2018 1:13:40 pm

OK, first off, never Encrypt your hard drive - I learnt that from as early as using SuSE Linux Professional 9.3 8 or so years ago where it gives a clear warning that encrypting your data can lead to data loss - I have never encrypted anything on any OS - and I don't store sensitive personal data on any machine. You are looking at a reinstall and be cautious when using autoremove - it tries to remove everything - better to use Bleach-bit or Ubuntu Tweak System Cleaner in future. ;) :D

zorinantwerp

Wed Mar 21, 2018 7:07:42 pm

If you find yourself in a situation where you need to recover your Encrypted Home or Encrypted Private directory, simply:

* boot the target system using an Ubuntu 12.04 (or newer) Desktop LiveCD
* make sure that your target system's hard drive is mounted
* open a terminal
* install ecryptfs-utils 'sudo apt-get install -y ecryptfs-utils'
* and run 'sudo ecryptfs-recover-private'
* follow the prompts
* access your decrypted data and save somewhere else
* you can also launch the graphical file browser with 'sudo nautilus' and navigate to the temporary directory
source:
Code:
https://www.systutorials.com/docs/linux/man/1-ecryptfs-recover-private/


+++

Linx

Wed Mar 21, 2018 7:32:37 pm

I would use a live disk and try to just repair whatever broke.

after booting from the live disk run the following:

Step 1 ) Find the partition and drive of your install:
Code:
User@Machine:~$ sudo parted -l
Model: ATA OCZ-VERTEX460 (scsi)
Disk /dev/sda: 240GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags:

Number  Start   End    Size   File system  Name                  Flags
1      1049kB  538MB  537MB  fat32        EFI System Partition  boot, esp
2      538MB   240GB  239GB  ext4


Model: ATA Samsung SSD 850 (scsi)
Disk /dev/sdb: 250GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags:

Number  Start   End    Size    File system  Name                          Flags
1      1049kB  473MB  472MB   ntfs         Basic data partition          hidden, diag
2      473MB   577MB  104MB   fat32        EFI system partition          boot, esp
3      577MB   593MB  16.8MB               Microsoft reserved partition  msftres
4      593MB   250GB  249GB   ntfs         Basic data partition          msftdata


Model: ATA WDC WD20EADS-00W (scsi)
Disk /dev/sdc: 2000GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags:

Number  Start   End     Size    File system  Name  Flags
1      17.4kB  2000GB  2000GB  ntfs         Data  msftdata

In my case I have 3 drives in this computer, 1 for windows boot, one for linux boot and one for Shared Slow access HDD Data. You are most likely only going to have one which will make it much easier to find your root partition. I'm looking for the EXT4 partition on my Linux boot drive (Model: ATA OCZ-VERTEX460 (scsi) - Disk /dev/sda: 240GB) The Number on the left side 2 is the partition I need for the following commands.
Code:
sudo su
mount /dev/sda2 /mnt
mount --bind /proc /mnt/proc
mount --bind /sys /mnt/sys
mount --bind /dev /mnt/dev
chroot /mnt


I have an EFI partition and use UEFI boot, you can tell from the parted output "EFI System Partition"
Code:
mount /dev/sda1 /boot/efi


Fix some network issues of a chroot'd system
Code:
echo "nameserver 8.8.8.8" >> /etc/resolv.conf


Now we might be able to fix whatever is broken.
Code:
apt update
apt upgrade
apt full-upgrade
update-grub


and reboot!
Code:
systemctl reboot

Swarfendor437

Thu Mar 22, 2018 12:15:52 am

zorinantwerp wrote:If you find yourself in a situation where you need to recover your Encrypted Home or Encrypted Private directory, simply:

* boot the target system using an Ubuntu 12.04 (or newer) Desktop LiveCD
* make sure that your target system's hard drive is mounted
* open a terminal
* install ecryptfs-utils 'sudo apt-get install -y ecryptfs-utils'
* and run 'sudo ecryptfs-recover-private'
* follow the prompts
* access your decrypted data and save somewhere else
* you can also launch the graphical file browser with 'sudo nautilus' and navigate to the temporary directory
source:
Code:
https://www.systutorials.com/docs/linux/man/1-ecryptfs-recover-private/


+++


Thanks zorinantwerp for your input it is much appreciated - I stil avoid encryption though! ;) :D