Is it possible to recover ubuntu 20.04?
https://askubuntu.com/questions/1350638/is-it-possible-to-recover-ubuntu-20-04
Somehow I ended with an unbootable system. I traced the problem to my /lib folder and possibly to other system folders
I currently have this ls -lsha lib lib32 lib64 libx32 usr/lib32/ usr/lib64 usr/libx32/
ubuntu@ubuntu:/media/ubuntu/8e5c9899-7541-4ab3-9577-27efa7337808$ ls -lsha lib lib32 lib64 libx32 usr/lib32/ usr/lib64 usr/libx32/
0 lrwxrwxrwx 1 root root 9 Jun 4 2020 lib32 -> usr/lib32
0 lrwxrwxrwx 1 root root 9 Jun 4 2020 lib64 -> usr/lib64
0 lrwxrwxrwx 1 root root 10 Jun 4 2020 libx32 -> usr/libx32
lib:
total 12K
4.0K drwxr-xr-x 3 root root 4.0K May 14 16:22 .
4.0K drwxr-xr-x 22 root root 4.0K Jul 6 23:26 ..
4.0K drwxr-xr-x 3 root root 4.0K Feb 26 2020 terminfo
usr/lib32/:
total 8.0K
4.0K drwxr-xr-x 2 root root 4.0K Apr 23 2020 .
4.0K drwxr-xr-x 14 root root 4.0K Apr 23 2020 ..
usr/lib64:
total 8.0K
4.0K drwxr-xr-x 2 root root 4.0K Jan 27 16:29 .
4.0K drwxr-xr-x 14 root root 4.0K Apr 23 2020 ..
0 lrwxrwxrwx 1 root root 32 Dec 16 2020 ld-linux-x86-64.so.2 -> /lib/x86_64-linux-gnu/ld-2.31.so
usr/libx32/:
total 8.0K
4.0K drwxr-xr-x 2 root root 4.0K Apr 23 2020 .
4.0K drwxr-xr-x 14 root root 4.0K Apr 23 2020 ..
My libs folders are empty.
When I try to boot I get this kernel panic:
/dev/sda5: clean, 781569/3751936 files, 9781643/15000064 blocks
run-init: can't execute '/sbin/init': No such file or directory
Target filesystem doesn't have requested /sbin/init.
run-init: can't execute '/sbin/init': No such file or directory
run-init: can't execute '/etc/init': Permission denied
[ 4.121942] Kernel panic - not syncing: Attempted to kill init! exitcode=0x00000100
[ 4.121969] CPU: 1 PID: 1 Comm: run-init Not tainted 5.8.0-59-generic #66~20.04.1-Ubuntu
[ 4.121991] Hardware name: System manufacturer System Product Name/PRIME A320M-K, BIOS 5007 06/18/2019
[ 4.122016] Call Trace:
[ 4.122033] dump_stack+0x74/0x92
[ 4.122044] panic+0x101/0x2e3
[ 4.122054] do_exit.cold+0x54/0xa7
[ 4.122068] ? __prepare_exit_to_usermode+0x76/0x210
[ 4.122083] do_group_exit+0x43/0xa0
[ 4.122094] __x64_sys_exit_group+0x18/0x20
[ 4.122108] do_syscall_64+0x49/0xc0
[ 4.122119] entry_SYSCALL_64_after_hwframe+0x44/0xa9
[ 4.122135] RIP: 0033:0x7ff4cc04e2c6
[ 4.122147] Code: fa 41 b8 e7 00 00 00 be 3c 00 00 00 eb 15 66 0f 1f 44 00 00 89 d7 89 f0 0f 05 48 3d 00 f0 ff ff 77 22 f4 89
d7 44 89 c0 0f 05 <48> 3d 00 f0 ff ff 76 e2 f7 d8 64 41 89 01 eb da 66 2e 0f 1f 84 00
[ 4.122193] RSP: 002b:00007ffca93c79b8 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7
[ 4.122214] RAX: ffffffffffffffda RBX: 00007ff4cc155610 RCX: 00007ff4cc04e2c6
[ 4.122233] RDX: 0000000000000001 RSI: 000000000000003c RDI: 0000000000000001
[ 4.122251] RBP: 0000000000000001 R08: 00000000000000e7 R09: ffffffffffffff80
[ 4.122269] R10: 0000000000000002 R11: 0000000000000246 R12: 00007ff4cc155610
[ 4.122288] R13: 0000000000000001 R14: 00007ff4cc158fc8 R15: 0000000000000000
[ 4.122468] Kernel Offset: 0x3e00000 from 0xffffffff81000000 (relocation range: 0xffffffff80000000-0xffffffffbfffffff)
[ 4.122516] ---[ end Kernel panic - not syncing: Attempted to kill init! exitcode=0x00000100 ]---
_
I'm guessing the only solution is to reinstall the system. Am I correct?
My system partition is OK, I think. As well as my home partition. I ran fsck with no problem.
ubuntu@ubuntu:~$ sudo fsck -f /dev/sda5
fsck from util-linux 2.34
e2fsck 1.45.5 (07-Jan-2020)
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
/dev/sda5: 781569/3751936 files (0.3% non-contiguous), 9781643/15000064 blocks
ubuntu@ubuntu:~$ sudo fsck -f /dev/sda6
fsck from util-linux 2.34
e2fsck 1.45.5 (07-Jan-2020)
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
/dev/sda6: 628676/3751936 files (0.6% non-contiguous), 9520496/15000064 blocks
I also executed boot-repair and I got this link https://paste.ubuntu.com/p/4CG9s4R9Dr/
Is there any way to recover the missing system files?
FWIW I think the culprit was a bad Debian package I built myself or the checkinstall program for that matter when I was compiling emacs.
ubuntu@ubuntu:/media/ubuntu/8e5c9899-7541-4ab3-9577-27efa7337808/usr/local/emacs$ ls -lsha backup-070620211826-pre-emacs-27.2-custom.tgz
30M -rw-r--r-- 1 root root 30M Jul 6 23:26 backup-070620211826-pre-emacs-27.2-custom.tgz
It has the same contents I have in my /lib folder.
