chroot from live cd gives : /bin/bash: error while loading shared libraries: __vdso__time: invalid mode for dlopen(): Invalid argument

0

Tried to fix boot problem kernel panic not syncing attemped to kill init exitcode=0x00000100 And trying to chroot from live cd and im getting this error:

/bin/bash: error while loading shared libraries: __vdso__time: invalid mode for dlopen(): Invalid argument

Seems i messed up with some libraries. Anyone know how to fix this? thanks

linux
ubuntu
chroot
asked on Server Fault Feb 10, 2017 by mwweb

1 Answer

2

It seems like you've messed something with 'glibc', it usually gives such error. The only solution that I can currently think of is to try rename your current 'lib' dirs (in environment you are trying to chroot to) and copy (i.e. from live cd) 'clean'. Make sure you keep old 'libs' so you can later reuse them.

For future, I'd recommend to compile and install additional libraries (especially those in different versions that default one) to separate directories, and then explictly point library path using LD_LIBRARY_PATH, when executing binary.

So for now I'd personally try to replace only /lib64 (but it depends on distribution). I can see that at Centos 6 box, /bin/bash depends on:

ldd /bin/bash
linux-vdso.so.1 =>  (0x00007ffd4db63000)
libtinfo.so.5 => /lib64/libtinfo.so.5 (0x00007f9f34f54000)
libdl.so.2 => /lib64/libdl.so.2 (0x00007f9f34d50000)
libc.so.6 => /lib64/libc.so.6 (0x00007f9f349bb000)
/lib64/ld-linux-x86-64.so.2 (0x00007f9f3517f000

Maybe try rename /lib64 to /lib64_messed and copy fresh /lib64 - it should be sufficient for /bin/bash execution. I am writing about most similar version of Live CD OS to that you are trying to chroot. Of course, there may arise new library dependency errors when trying execute diffirent command, but this way you should do the trick and fix your os for 'a bit' usable state.

And I assume that you are using x64 live cd and trying to chroot to x64 env.

Right now, I've checked at Ubuntu 16 box, and paths are bit different:

ldd /bin/bash 
linux-vdso.so.1 =>  (0x00007fffe3567000)
libtinfo.so.5 => /lib/x86_64-linux-gnu/libtinfo.so.5 (0x00007f7611065000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f7610e61000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f7610a96000)
/lib64/ld-linux-x86-64.so.2 (0x000055f0e5734000)

So you'd need probably to replace /lib and /lib64 dirs, or only those particular libs.

answered on Server Fault Feb 10, 2017 by adoado0 • edited Feb 10, 2017 by adoado0

User contributions licensed under CC BY-SA 3.0