誤って/usr/lib64を移動した後に回復する方法

誤って/usr/lib64を移動した後に回復する方法

スペースを解放し、/usr/lib64/を「/srv/maraba_ssd_scratch/apelin/root_files/usr_lib64」に移動しました。次に私がしたことは、/srv/maraba_ssd_scratch/apelin/root_files/usr_lib64を指すようにusrにlib64へのシンボリックリンクを作成することでしたが、まもなくELFの問題を発見しました.

私の最大の問題は、これをすべて実行するためにsudoを使用することです。他の投稿に基づいてコマンドを実行する方法を学び、次のことができます。

$ LD_LIBRARY_PATH=/srv/maraba_ssd_scratch/apelin/root_files/usr_lib64 /srv/maraba_ssd_scratch/apelin/root_files/usr_lib64/ld-linux-x86-64.so.2 /usr/bin/echo a
a
bash: /usr/bin/basename: /lib64/ld-linux-x86-64.so.2: bad ELF interpreter: No such file or directory

ただし、/usr/lib64を復元するにはroot権限が必要です。 sudoを試しましたが失敗しました。

LD_LIBRARY_PATH=/srv/maraba_ssd_scratch/apelin/root_files/usr_lib64 /srv/maraba_ssd_scratch/apelin/root_files/usr_lib64/ld-linux-x86-64.so.2 /usr/bin/sudo /usr/bin/ln -s /srv/maraba_ssd_scratch/apelin/root_files/usr_lib64 lib64
/usr/bin/sudo: error while loading shared libraries: /usr/bin/sudo: cannot open shared object file: Permission denied
bash: /usr/bin/basename: /lib64/ld-linux-x86-64.so.2: bad ELF interpreter: No such file or directory

su を試みるとエラーも発生します。

$ LD_LIBRARY_PATH=/srv/maraba_ssd_scratch/apelin/root_files/usr_lib64 /srv/maraba_ssd_scratch/apelin/root_files/usr_lib64/ld-linux-x86-64.so.2 /usr/bin/su root
su: Module is unknown
bash: /usr/bin/basename: /lib64/ld-linux-x86-64.so.2: bad ELF interpreter: No such file or directory

suエラーが私の/etc/pam.d/suファイルに関連している可能性があると思います。

#%PAM-1.0
auth        sufficient  pam_rootok.so
# Uncomment the following line to implicitly trust users in the "wheel" group.
#auth       sufficient  pam_wheel.so trust use_uid
# Uncomment the following line to require a user to be in the "wheel" group.
#auth       required    pam_wheel.so use_uid
auth        substack    system-auth
auth        include     postlogin
account     sufficient  pam_succeed_if.so uid = 0 use_uid quiet
account     include     system-auth
password    include     system-auth
session     include     system-auth
session     include     postlogin
session     optional    pam_xauth.so
bash: /usr/bin/basename: /lib64/ld-linux-x86-64.so.2: bad ELF interpreter: No such file or directory

pam_rootok.soは移動されたlib64ディレクトリにあります。

ライブディスクから起動する以外に他のアイデアがある人はいますか?ビジーボックスはありません。

PSでは、vncserverを介してGUIがあることに注意する必要があります。 GUIでrootコマンドを呼び出す方法はありますか? CentOS 7、Gnome2。

ベストアンサー1

おすすめ記事