macsplex.com 로그인

검색

조회 수 3593 추천 수 0 댓글 0
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 게시글 수정 내역 댓글로 가기 인쇄
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 게시글 수정 내역 댓글로 가기 인쇄
Extra Form

참고: http://forcecore.tistory.com/1238

http://www.linuxjournal.com/content/rebooting-magic-way

Rebooting the Magic Way

 
 in

If you have ever had a hard drive fail on a remote server you may remember the feeling you had after trying to issue the following commands:

    # reboot
    bash: /sbin/reboot: Input/output error
    # shutdown -r now
    bash: /sbin/shutdown: Input/output error

Obviously, there is a problem with your drive. These commands are failing because the kernel is unable to load the /sbin/reboot and /sbin/shutdown binaries from the disk so that it can execute them.

A fsck on the next boot might be able to correct whatever is wrong with the disk, but first you need to get the system to reboot. If your machine is located at a managed hosting provider then you could submit a reboot ticket, but you'll have to wait for someone to take responsibility.

Wouldn't it be nice if there was a way to ask the kernel to reboot without needing to access the failing drive? Well, there is a way, and it is remarkably simple.

The "magic SysRq key" provides a way to send commands directly to the kernel through the /proc filesystem. It is enabled via a kernel compile time option, CONFIG_MAGIC_SYSRQ, which seems to be standard on most distributions. First you must activate the magic SysRq option:

    echo 1 > /proc/sys/kernel/sysrq

When you are ready to reboot the machine simply run the following:

    echo b > /proc/sysrq-trigger

This does not attempt to unmount or sync filesystems, so it should only be used when absolutely necessary, but if your drive is already failing then that may not be a concern.

In addition to rebooting the system the sysrq trick can be used to dump memory information to the console, sync all filesystems, remount all filesystems in read-only mode, send SIGTERM or SIGKILL to all processes except init, or power off the machine entirely, among other things.

Also, instead of echoing into /proc/sys/kernel/sysrq each time you can activate the magic SysRq key at system boot time using sysctl, where supported:

    echo "kernel.sysrq = 1" >> /etc/sysctl.conf

If you would like to learn more about magic SysRq you can read the sysrq.txt file in the kernel documentation.

 

????: http://www.linuxjournal.com/content/rebooting-magic-way





--------------------------------------------------광고(Advertising)-------------------------------------------------------------------------------------



리눅스 Tip

Linux Tip

  1. 데비안에서 나눔폰트설치

    CategoryDebian
    Read More
  2. 델(dell) 제품에 데비안(Debian) 배포본 설치시 부팅불능 대처법

    CategoryDebian
    Read More
  3. 디스크 모니터링 프로그램 iotop

    Read More
  4. 리눅스 ext4로 포맷

    Read More
  5. 리눅스 디스크 확인 및 마운트

    Read More
  6. 리눅스 메모리 사용량순 프로세스 보기

    Read More
  7. 리눅스 민트 19.1 테사(Tessa) 업그레이드 방법

    CategoryLinuxmint
    Read More
  8. 리눅스 배포판확인 명령어

    Read More
  9. 리눅스 백업 스크립트

    Read More
  10. 리눅스 버전 확인 명령어

    Read More
  11. 리눅스 시스템 종료 명령어

    Read More
  12. 리눅스 시스템에 하드디스크 추가하기

    Read More
  13. 리눅스 온도 모니터링 프로그램

    CategoryUbuntu
    Read More
  14. 리눅스 유용한 명령어

    Read More
  15. 리눅스 특정디렉토리 크기 확인하는법

    Read More
  16. 리눅스의 사용상 장점

    Read More
  17. 명령어를 치면 Input/output error가 나오면

    Read More
  18. 무료 웹메일 프로그램 roundcube

    Read More
  19. 빠르게 파일을 복사하는 방법

    Read More
  20. 삼바 설치 및 운영

    Read More
Board Pagination Prev 1 2 3 4 5 6 7 8 Next
/ 8