[질문] login이 안됩니다.

ssggkim의 이미지

사용하는 배포본은 gentoo입니다.

얼마전 gcc 에 문제가 있어 다른 pc에서 gcc, glibc, binutils의 binary package를 만들어 까는 방식으로 문제를 해결했다고 생각했는데
새로운 문제가 생겼습니다.
어제 예비군 훈련 갔다와서 오늘 system에 login을 하려고 하니 다음과 같은 에러가 납니다.

======================================
/bin/login: error while loading shared libraries: /lib/libdl.so.2: invalid ELF header
======================================

ssh도 안되고요.

다른 system에서 보니 /lib/libdl.so.2가 libdl-2.3.3.so 로 link 되어 있던데
설치 CD로 booting해서 symbolic link만 손보면 해결되는 문제일까요?

회사에서 file server로 쓰고 있는 놈인지라 쉽게 shutdown 시키기가 어려운 상태입니다.

도움 부탁드리겠습니다.

codebank의 이미지

어차피 설치CD로 부팅을 하려면 Shutdown을 해야하고... 방법은 없겠네요.
잠시 공지돌려서 파일서버 잠시 멈춘다고(시스템 관리차원이라고... :)) 하시고
작업을 하세요.
libdl-2.3.3.so 복사하고 libdl.so.2로 링크시키는걸로 금방 해결될 거라고 생각됩니다.
음... ELF헤더에러면 다른 PC에서 복사할때 문제가 발생한 것 같은데 다른 라이브러리도
확인을 해보는게 어떨까요?
file로 간단하게 확인해 보는것도 좋을 것 같은데요...

------------------------------
좋은 하루 되세요.

ssggkim의 이미지

답변 감사드립니다.

codebank wrote:

libdl-2.3.3.so 복사하고 libdl.so.2로 링크시키는걸로 금방 해결될 거라고 생각됩니다.

사실 이 답변을 원했습니다. :)
유지 보수 시간이 길어지면 이런저런 말들이 많아서요.
그리고 가장 걱정스러운 것이 rebooting했을 때 다른 library 또는 기타의 문제로 booting조차 되지 않는 상황입니다. :cry:

codebank wrote:

음... ELF헤더에러면 다른 PC에서 복사할때 문제가 발생한 것 같은데 다른 라이브러리도
확인을 해보는게 어떨까요?
file로 간단하게 확인해 보는것도 좋을 것 같은데요...

예 그래야 할것 같은데 여러 library를 file로 손쉽게 확인할 방법이 있을까요?
Library는 ldconfig로 확인하곤 했는데( :oops: ) 다른 pc에서 복사하기 전에 ldconfig 명령어를 치면 다음과 같은 에러가 났었습니다.

ldconfig: /usr/lib/libgpm.so is not an ELF file - it has the wrong 
magic bytes at the start.

ldconfig: /usr/lib/libgpg-error.so.0 is not an ELF file - it has the 
wrong magic bytes at the start.

ldconfig: /usr/lib/libol.so.0.0.0 is not an ELF file - it has the wrong 
magic bytes at the start.

ldconfig: /usr/lib/libgcrypt.so.11.1.0 is not an ELF file - it has the 
wrong magic bytes at the start.

ldconfig: /usr/lib/libgpg-error.so is not an ELF file - it has the 
wrong magic bytes at the start.

ldconfig: file /usr/lib/libbfd-2.14.90.0.8.so is truncated

ldconfig: /usr/lib/libgcrypt.so.11 is not an ELF file - it has the 
wrong magic bytes at the start.

ldconfig: /usr/lib/libol.so.0 is not an ELF file - it has the wrong 
magic bytes at the start.

ldconfig: /usr/lib/libgpg-error.so.0.1.1 is not an ELF file - it has 
the wrong magic bytes at the start.

ldconfig: /usr/lib/libgcrypt.so is not an ELF file - it has the wrong 
magic bytes at the start.

ldconfig: /usr/lib/libgpm.so.1 is not an ELF file - it has the wrong 
magic bytes at the start.

ldconfig: /usr/lib/libgcrypt.so.7 is not an ELF file - it has the 
wrong magic bytes at the start.

ldconfig: /usr/lib/libol.so is not an ELF file - it has the wrong 
magic bytes at the start.

ldconfig: /usr/lib/libgpm.so.1.19.0 is not an ELF file - it has the 
wrong magic bytes at the start.

ldconfig: file /usr/lib/libbfd.so is truncated

file system이 깨졌나 싶어 fsck도 돌려보고, 메모리 불량인가 싶어 memtest86도 돌려보았었는데 이상은 없었거든요.

codebank의 이미지

음... 크로스 컴파일할때 문제가 있는것 같군요.
실제로 리부팅을하면 힘든 상황일 것 같아보이네요. :)
잘못하면 리부팅도 못할것 같고...
file을 이용한 간단한 확인방법은 file /lib/*로 해버리면 되겠네요.
문제는 현재 컴퓨터를 리붓할때 제대로 부팅하느냐인데...
해결 방법이 없는것도 아닌것 같네요.
일단 설치 CD를 이용해서 부팅하고 chroot를 이용해서 시스템에 접근하고나서
# emerge glibc
로 라이브러리를 Upgrade해보세요. 이건 시간이 좀 걸리지만...

------------------------------
좋은 하루 되세요.

ssggkim의 이미지

codebank wrote:
음... 크로스 컴파일할때 문제가 있는것 같군요.
실제로 리부팅을하면 힘든 상황일 것 같아보이네요. :)
잘못하면 리부팅도 못할것 같고...

에궁 심장이 떨려옵니다. :cry:
codebank wrote:

file을 이용한 간단한 확인방법은 file /lib/*로 해버리면 되겠네요.

네... 그런 간단한 방법이 있었군요. :)
codebank wrote:

문제는 현재 컴퓨터를 리붓할때 제대로 부팅하느냐인데...
해결 방법이 없는것도 아닌것 같네요.
일단 설치 CD를 이용해서 부팅하고 chroot를 이용해서 시스템에 접근하고나서
# emerge glibc
로 라이브러리를 Upgrade해보세요. 이건 시간이 좀 걸리지만...

이번 주말에 시도해봐야겠습니다. 일단 samba는 문제없이 돌아가는 것처럼 보이니까요.

답변 감사드립니다.

댓글 달기

Filtered HTML

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

BBCode

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param>
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

Textile

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • You can use Textile markup to format text.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Markdown

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • Quick Tips:
    • Two or more spaces at a line's end = Line break
    • Double returns = Paragraph
    • *Single asterisks* or _single underscores_ = Emphasis
    • **Double** or __double__ = Strong
    • This is [a link](http://the.link.example.com "The optional title text")
    For complete details on the Markdown syntax, see the Markdown documentation and Markdown Extra documentation for tables, footnotes, and more.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Plain text

  • HTML 태그를 사용할 수 없습니다.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 줄과 단락은 자동으로 분리됩니다.
댓글 첨부 파일
이 댓글에 이미지나 파일을 업로드 합니다.
파일 크기는 8 MB보다 작아야 합니다.
허용할 파일 형식: txt pdf doc xls gif jpg jpeg mp3 png rar zip.
CAPTCHA
이것은 자동으로 스팸을 올리는 것을 막기 위해서 제공됩니다.