Kernel panic - not syncing; error loading shared libraries: lib.so.6; unable to find persistent home medium
https://askubuntu.com/questions/1503444/kernel-panic-not-syncing-error-loading-shared-libraries-lib-so-6-unable-to
I have been trying to find posts with the same issue as mine, but I had no luck yet, hence I'm posting.
I have Ubuntu 20.04 (ubuntu-20.04.1-desktop-amd64.iso) installed on 64GB USB drive with help of a Rufus persistent live USB. I've been using it for a long time.
Yesterday the screen turned blank. I plugged in the power, but it didn't help and then it shut down. All attempts to reboot lead me to the following boot messages.
[ 2.683048] psmouse serio1: synaptics: TouchPad model: 1, fw: 10.92, id: 0x1e2a1, caps: 0xf014a3/0x940300/0x12e800/0x500000, board id: 3471, fw id: 3972349
[ 2.685678] psmouse serio1: synaptics: serio: Synaptics pass-through port at isa0060/serio1/input0
[ 2.748867] input: SynPS/2 Synaptics TouchPad as /devices/platform/i8042/serio1/input/input7
[ 3.445260] psmouse serio2: trackpoint: Elan TrackPoint firmware: 0x11, buttons: 3/3
Begin: Loading essential drivers ... done.
Begin: Running /scripts/init-premount ... done.
Begin: Mounting root file system ... Begin: Running /scripts/nfs-top ... done.
Begin: Running /scripts/nfs-premount ... done.
[ 3.758519] input: TPPS/2 Elan TrackPoint as /devices/platform/i8042/serio1/serio2/input/input8
[ 4.086398] scsi 0:0:0:0: Direct-Access Samsung Flash Drive FIT 1100 PQ: 0 ANSI: 6
[ 4.089902] sd 0:0:0:0: Attached scsi generic sg0 type 0
[ 4.090851] sd 0:0:0:0: [sda] 125313283 512-byte logical blocks: (64.2 GB/59.8 GiB)
[ 4.094484] sd 0:0:0:0: [sda] Write Protect is off
[ 4.096279] sd 0:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[ 4.131614] sda: sda1 sda2 sda3 sda4
[ 4.136003] sd 0:0:0:0: [sda] Attached SCSI removable disk
Begin: Running /scripts/casper-premount ... done.
done.
stdin: Invalid argument
[ 5.154509] EXT4-fs (sda4): mounted filesystem with ordered data mode. Opts: (null). Quota mode: none.
[ 5.208737] loop0: detected capacity change from 0 to 4323184
[ 5.273279] overlayfs: "xino" feature enabled using 32 upper inode bits.
stdin: Invalid argument
stdin: Invalid argument
Warning: Unable to find the persistent home medium
stdin: Invalid argument
stdin: Invalid argument
Warning: Impossible to include the casper-sn Snapshot
stdin: Invalid argument
[ 5.971324] overlayfs: invalid origin (x86_64-linux-gnu/libc.so.6, ftype=8000, origin ftype=4000).
[ 5.974902] overlayfs: invalid origin (x86_64-linux-gnu/libc.so.6, ftype=8000, origin ftype=4000).
[ 6.012565] overlayfs: invalid origin (x86_64-linux-gnu/libc.so.6, ftype=8000, origin ftype=4000).
[ 6.014182] overlayfs: invalid origin (x86_64-linux-gnu/libc.so.6, ftype=8000, origin ftype=4000).
[ 6.177567] overlayfs: invalid origin (x86_64-linux-gnu/libc.so.6, ftype=8000, origin ftype=4000).
[ 6.179158] overlayfs: invalid origin (x86_64-linux-gnu/libc.so.6, ftype=8000, origin ftype=4000).
[ 6.206105] overlayfs: invalid origin (x86_64-linux-gnu/libc.so.6, ftype=8000, origin ftype=4000).
[ 6.207937] overlayfs: invalid origin (x86_64-linux-gnu/libc.so.6, ftype=8000, origin ftype=4000).
[ 6.234687] overlayfs: invalid origin (x86_64-linux-gnu/libc.so.6, ftype=8000, origin ftype=4000).
[ 6.236217] overlayfs: invalid origin (x86_64-linux-gnu/libc.so.6, ftype=8000, origin ftype=4000).
done.
Begin: Running /scripts/nfs-bottom ... done.
Begin: Running /scripts/init-bottom ... done.
/sbin/init: error while loading shared libraries: libc.so.6: cannot open shared object file: Input/output error
[ 6.694304] kernel panic - not syncing: Attempted to kill init! exitcode=0x00007f00
[ 6.695796] CPU: 0 PID: 1 Comm: init Not tainted 5.11.0-16-generic #17-Ubuntu
[ 6.696625] Hardware name: LENOVO 20UES2KW0Y/20UES2KW0Y, BIOS R1BET67W(1.36 ) 10/19/2021
[ 6.696625] Call Trace:
[ 6.696625] show_stack+0x52/0x58
[ 6.696625] dump_stack+0x70/0x8b
[ 6.696625] panic+0x101/0x2e3
[ 6.696625] do_exit.cold+0xb0/0xb0
[ 6.696625] do_group_exit+0x3b/0xb0
[ 6.696625] __x64_sys_exit_group+0x18/0x20
[ 6.696625] do_syscall_64+0x38/0x90
[ 6.696625] entry_SYSCALL_64_after_hwframe+0x44/0xa9
[ 6.696625] RIP: 0033:0x7f1bbcab4b51
[ 6.696625] Code: 1f 84 00 00 00 00 00 66 90 f3 0f 1e fa be e7 00 00 00 ba 3c 00 00 00 eb 0d 89 d0 0f 05 48 3d 00 f0 ff ff 77 1c f4 89 f0 0f 05 <48> 3d 00 f0 ff ff 76 e7 f7 d8 89 05 87 16 01 00 eb dd 0f 1f 44 00
[ 6.696625] RSP: 002b:00007ffdieb41d28 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7
[ 6.696625] RAX: ffffffffffffffda RBX: 00007f1bbc731f60 RCX: 00007f1bbcab4b51
[ 6.696625] RDX: 000000000000003c RSI: 00000000000000e7 RDI: 0000000000000000
[ 6.696625] RBP: 00007ffdieb428c0 R08: 0000000000000080 R09: 0000000000000000
[ 6.696625] R10: 00000000ffffffff R11: 0000000000000246 R12: 00007f1bbcabdcb0
[ 6.696625] R13: 00007f1bbc731f4f R14: 0000000000000000 R15: 00007f1bbcac6220
[ 6.696625] Kernel Offset: 0x2a000000 from 0xffffffff81000000 (relocation range: 0xffffffff80000000-0xffffffffbfffffff)
[ 6.696625] ---[ end Kernel panic - not syncing: Attempted to kill init! exitcode=0x00007f00 ]---
Grub screen doesn't have any recovery / advance options as recommended in other posts. I am able to plug this drive in an Ubuntu 18.04 live USB and see the folder structure as shown in the Ubuntu and writable screenshots.


I don't know if it's a kernel issue or if some other file is corrupt/stuck which is preventing it from booting up.
Update: I followed steps recommended by mcendu. I made some progress. libc.so.6 error is not showing up anymore. Here's the latest boo messages after replacing libc.so.6 of persistent 21.04 from the live USB 21.04.
[ 4.595708] sda: sda1 sda2 sda3 sda4
[ 4.598036] sd 0:0:0:0: [sda] Attached SCSI removable disk
stdin: Invalid argument
[ 5.971132] EXT4-fs (sda4): mounted filesystem with ordered data mode. Opts: (null). Quota mode: none.
[ 6.009178] loop0: detected capacity change from 0 to 4323184
[ 6.079952] overlayfs: "xino" feature enabled using 32 upper inode bits.
stdin: Invalid argument
stdin: Invalid argument
Warning: Unable to find the persistent home medium
stdin: Invalid argument
stdin: Invalid argument
Warning: Impossible to include the casper-sn Snapshot
stdin: Invalid argument
stdin: Invalid argument
Warning: Impossible to include the home-sn Snapshot
done.
Begin: Creating debconf-communicate fifo mechanism ... done.
Begin: Running /scripts/casper-bottom ... Begin: Moving mount points... ... done.
/usr/bin/perl: symbol lookup error: /usr/bin/perl: undefined symbol: pthread_getspecific, version GLIBC_2.2.5
Begin: Configuring fstab... ... done.
Begin: Setting up swap... ... done.
Begin: Setting up locales... ... done.
Begin: Setting up automatic login... ... done.
Begin: Disabling systemd's GPT auto generator... ... done.
Begin: Setting hostname... ... done.
Begin: Setting up console keyboard... ... done.
Begin: Applying desktop settings... ... glib-compile-schemas: symbol lookup error: /lib/x86_64-linux-gnu/libselinux.so.1: undefined symbol: dlopen, version GLIBC_2.2.5
done.
Begin: Regenerating SSL certificate... ... /bin/bash: symbol lookup error: /bin/bash: undefined symbol: dlopen, version GLIBC_2.2.5
done.
Begin: Loading preseed file... ... Begin: Adding live session user... ... Begin: Setting up init... ... ln: /root/usr/sbin/anacron: File exists
done.
ln: /root/lib/systemd/system/cdrom.mount: File exists
Begin: Configuring accessibility options... ... done.
Begin: Disabling update-notifier... ... done.
Begin: Configuring power management... ... done.
Begin: Enabling detection of crashes... ... done.
Begin: Disabling unnecessary KDE services... ... done.
Begin: Fixing language selector... ... done.
Begin: Disabling trackerd... ... done.
Begin: Adding APT-CDROM source... ... done.
Begin: Running /scripts/nfs-bottom ... done.
Begin: Running /scripts/init-bottom ... done.
/sbin/init: symbol lookup error: /lib/x86_64-linux-gnu/libcrypto.so.1.1: undefined symbol: pthread_getspecific, version GLIBC_2.2.5
[ 7.807914] Kernel panic - not syncing: Attempted to kill init! exitcode=0x00007f00
[ 7.809390] CPU: 8 PID: 1 COMM: init Not tainted 5.11.0-16-generic #17-Ubuntu
[ 7.809390] Hardware name: LENOVO 20UES2KWOY/20UES2KWOY, BIOS R1BET67W(1.36 ) 10/19/2021
[ 7.809390] Call Trace:
[ 7.809390] show_stack+0x52/0x58
[ 7.809390] dump_stack+0x70/0x8b
[ 7.816936] panic+0x101/0x2e3
[ 7.816936] do_exit.cold+0xb0/0xb0
[ 7.816936] do_group_exit+0x3b/0xb0
[ 7.816936] __x64_sys_exit_group+0x18/0x20
[ 7.816936] do_syscall_64+0x38/0x90
[ 7.824935] entry_SYSCALL_64_after_hwframe+0x44/0xa9
[ 7.824935] RIP: 0033:0x7f8a93d99b51
[ 7.824935] Code: 1f 84 00 00 00 00 00 66 90 f3 0f 1e fa be e7 00 00 00 ba 3c 00 00 00 eb 0d 89 d0 0f 05 48 3d 00 f0 ff ff 77 1c f4 89 f0 0f 05 <48> 3d 00 f0 ff ff 76 e7 f7 d8 89 05 87 16 01 00 eb dd 0f 1f
[ 7.824935] RSP: 002b:00007ffe4e288418 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7
[ 7.824935] RAX: ffffffffffffffda RBX: 000000006204ad92 RCX: 00007f8a93d99b51
[ 7.824935] RDX: 000000000000003c RSI: 0000000000000e7 RDI: 000000000000007f
[ 7.832936] RBP: 00007ffe4e2889f0 R08: 0000000000000000 R09: 0000000000000000
[ 7.832936] R10: 00000000ffffffff R11: 0000000000000246 R12: 00007f8a93d9fd94
[ 7.832936] R13: 00007f8a9312d4ab R14: 00007ffe4e2889c0 R15: 00007ffe4e2889d0
[ 7.832936] Kernel Offset: 0x1c000000 from 0xffffffff81000000 (relocation range: 0xffffffff80000000-0xffffffffbfffffff)
[ 7.832936] ---[ end Kernel panic - not syncing: Attempted to kill init! exitcode=0x00007f00 ]---