chapter 8 troubleshoot linux system

28
TROUBLESHOOT LINUX SYSTEM CHAPTER 8

Upload: muhammad-faiz-zakaria

Post on 17-Nov-2015

16 views

Category:

Documents


0 download

DESCRIPTION

Troubleshoot

TRANSCRIPT

  • TROUBLESHOOT LINUX SYSTEMCHAPTER 8

  • 8.1 Troubleshoot methodologyThe maintenance cycle

  • Monitoring: Observing system areas for problems or irregularitiesProactive maintenance: Minimizing chance of future problemse.g., perform regular system backupsReactive maintenance: Correcting problems when they ariseDocumenting solutionsDeveloping better proactive maintenance methods

  • Documentation: System information stored in a log book for future referencesTroubleshooting procedures: Tasks performed when solving system problems

  • Common troubleshooting procedures

  • Two troubleshooting golden rules:Prioritize problems according to severitySpend reasonable amount of time on each problem given its priorityTry to solve root of problemAvoid missing underlying cause Justify why a certain solution is successful

  • Two categories of problems: Hardware-related Software-related

  • 8.2 Hardware-Related ProblemsHardware-Related ProblemsOften involve improper hardware or software configurationSCSI terminationVideo card and monitor configurationPOST test alertsLoose hardware connectionsIRQ or I/O address conflictsView output of dmesg (control or print the kernel ring buffer) command

  • Absence of device drivers prevent OS from using associated devicesKudzu program: Detect and install support for new hardwareIf hardware device not detected, device driver must be configured manuallyHDDs most common device to failGood idea to use RAID

  • The kudzu welcome screen

  • Configuring new hardware using kudzu

  • If HDD containing partitions mounted on noncritical directories fails:Power down computer and replace failed HDDBoot Linux systemUse fdisk to create partitions on replaced HDDUse mkfs to create filesystemsRestore original dataEnsure /etc/fstab has appropriate entries to mount filesystems

  • If HDD containing / filesystem fails:Power down computer and replace failed HDDReinstall Linux on new HDDRestore original configuration and data filesYou should update your package every time you made changes to your system (hardware/software).You can run PUP, yum, apt-get, or GUI based synaptic package manager to do the update.

  • 8.3 Software-Related Problems:Application-Related ProblemsMissing program libraries/files, process restrictions, or conflicting applicationsDependencies: Prerequisite shared libraries or packages required for program executionPrograms usually check at installationPackage files may be removed accidentally

  • rpm V command: Identify missing files in a package or package dependencyldd command: Display shared libraries used by a programldconfig command: Updates /etc/ld.so.conf and /etc/ld.so.cache files

  • /etc/ld.so.conf file: List of directories containing shared libraries/etc/ld.so.cache file: Contains location of shared library filescompressor/decompressor (codec) file: Contains rules to compress or decompress multimedia information

  • ulimit command: Modify process limit parameters in current shellCan also modify max number of filehandles/var/log directory: Contains most system log filesIf applications stop functioning due to difficulty gaining resources, restart using SIGHUP / SIGHKILL

  • 8.4 Software-Related Problems:Operating System-Related ProblemsMost software-related problems related to OSBoot loader, filesystem, serial device problemsLILO problems: Place linear in, remove compact from /etc/lilo.conf fileGRUB problems: Typically result of missing files in /boot directorymkbootdisk command: Create a boot floppy diskette

  • If filesystem on partition mounted to noncritical directory becomes corrupted:Unmount filesystemRun fsck command with f (full) option If fsck command cannot repair filesystem, use mkfs command to re-create the filesystemRestore filesystems original data

  • If / filesystem is corrupted:Boot from first Red Hat Fedora installation CDType linux rescue at welcome screenEnter shell for Linux system on CD Create new / filesystem via mkfs commandRestore original data to re-created / filesystemReboot system

  • Lost root passwordFirst, you have to reboot into recovery mode.

  • If you have a single-boot (Ubuntu is the only operating system on your computer), you may have to press the Escape key during bootup in order to see the boot menu. If you have a dual-boot (Ubuntu is installed next to Windows, another Linux operating system, or Mac OS X; and you choose at boot time which operating system to boot into), the boot menu should appear without the need to press the Escape key.

  • From the boot menu, select recovery mode, which is usually the second boot option.

  • After you select recovery mode and wait for all the boot-up processes to finish, you'll be presented with a few options. In this case, you want the Drop to root shell prompt option so press the Down arrow to get to that option, and then press Enter to select it.

  • The root account is the ultimate administrator and can do anything to the Ubuntu installation (including erase it), so please be careful with what commands you enter in the root terminal. Once you're at the root shell prompt, if you have forgotten your username as well, type

    ls /home

  • You should then see a list of the users on your Ubuntu installation. To reset the password, typeusername is the username you want to reset.

    passwd username

  • You'll then be prompted for a new password. When you type the password you will get no visual response acknowledging your typing. Your password is still being accepted. Just type the password and hit Enter when you're done. You'll be prompted to retype the password. Do so and hit Enter again.

  • Now the password should be reset. Type to return to the recovery menu.

    After you get back to the recovery menu, select resume normal boot, and use Ubuntu as you normally wouldonly this time, you actually know the password!

    exit