PDA

View Full Version : Broken installation - please help! Reinstalling kali linux and keeping configuration?



wtf
2015-11-21, 08:49
Hi guys it will be hard to explain the mess I made on my system, but it was basically due to mixing repistories with the debian ones, and then trying to upgrade to the recent kali version. I have been tryin fixing the mess with apt-get and aptitude, however in the end I deleted the kernel and now grub is not even showing me the option to load my linux partition (grub menu is loading on boot though, however it gives me only the choice to load windows).

What I need to know is if there's any way to make a "reinstall" of kali from cd without deleting my configuration files. On top of that I do have an encrypted LVM partition which I insist on keeping. I tried using the live cd installation menu, but there's no recovery mode there - when I hit install it asks me to recreate partition tables which I guess is unnecessary and I have no idea whether it would not delete my existing data.

So my basic questions are is there something like a recovery mode (I know where my installation is located - in /dev/sda6, my encrypted partition is in /dev/sda7) or a way to make a new installation on top of the old one while keeping all my data?

wtf
2015-11-21, 08:55
Ok, I got into the broken installation by overwritting the /boot directory as I made a backup of it prior to deleting the kernel (actually apt-get deleted it, I was dumb enough to confirm), however it's all a mess now - it does not mount my encrypted partition, spits a bunch of errors, however I am able to spawn a root shell.

wtf
2015-11-21, 08:58
here's the error message when it tries to mount my crypt partition on boot:
device-mapper: table: 254:0: crypt: unknown target type
device-mapper: reload ioctl on temporary-cryptsetup-835 failed: Invalid argumen
Failed to setup dm-crypt key mapping for device /dev/disk/byuuid/04fa0692-e021-44f8-b4ae-fad6af7853b9
Check that kernel supports aes-xts-plain64 cipher (check syslog for more info).

Please tell me that my LVM partition is not lost forever..

FAIL crypt (failed)
Activating lvm and md swap... done
Checking file systems... fsck from util-linux 2.27
fsck.ext4: No such file or directory while trying to open /dev/mapper/sda7_crypt
Probably non-existent device?
fsck exited with satus code 8
failed (code 8)
File system check failed. A log is being saved in /var/log/fsck/checkfs i*** location is writable. Please repair the file system manually. ... failed!
A maintenance shell will now be started. CONTROL-D will terminate this and resume system boot. ... (warning)
Give root password for maintenance

/var/log/fsck:
Log of fsck -C -R -A -a

fsck from util-linux 2.27
fsck.ext4: No such file or directory while trying to open /dev/mapper/sda7_crypt
Possibly non-existent device?
fsck exited with status code 8


I guess parittions are OK, however configuration is bugos. When I try to mount my windows partition:
mount /dev/sda3 /mnt
mount: unknown filesystem type 'ntfs'

fdisk -l
/dev/sda3 ... .. Type HPFS/MNTFS/exFAT

wtf
2015-11-21, 09:32
Update:
Just found out that my crypt partition is not gone. Logged in through live cd and mounted it using cryptsetup, I am going to back it up now using fsarchiver just in case. I still need to know how to get a new installation done without reformatting the partitions, any help would be appreciated.