Difference between revisions of "Lab 3 Warnings / Debrief"

From CDOT Wiki
Jump to: navigation, search
Line 46: Line 46:
  
 
If you cannot log graphically into your machine (first 3 common problems), there is a trick to boot your system into '''single-user''' mode. This mode does not provide networking, graphics, or logging in as other regular users, but can connect to a text-based interface as the '''root''' user. This method will only work if a GRUB (<u>'''Gr'''</u>and '''<u>U</u>'''nified <u>'''B'''</u>oot-loader) password has not been set, or that you haven't forgotten the GRUB password.
 
If you cannot log graphically into your machine (first 3 common problems), there is a trick to boot your system into '''single-user''' mode. This mode does not provide networking, graphics, or logging in as other regular users, but can connect to a text-based interface as the '''root''' user. This method will only work if a GRUB (<u>'''Gr'''</u>and '''<u>U</u>'''nified <u>'''B'''</u>oot-loader) password has not been set, or that you haven't forgotten the GRUB password.
 +
 +
 +
 +
 +
'''Steps to Boot into "Single-User Mode":'''
 +
 +
{| width="50%" align="right" cellpadding="10"
 +
|- valign="top"
 +
|
 +
[[Image:grub2_1.png|thumb|right|600px|Add the boot option '''single''' and then press '''ctrl-x''' to boot into single user mode]]
 +
|}
 +
#Boot-up your '''centos1''' VM. '''when the Grub Boot menu appears''', press the letter <b><code><span style="color:#3366CC;font-size:1.2em;">e</span></code></b> (for "edit").
 +
#Using your arrow keys, scroll to next screen to  '''linux16''' command and type the word <b><code><span style="color:#3366CC;font-size:1.2em;">single</span></code></b> as an argument after '''quiet''' (see diagram for reference) and then press <b><code><span style="color:#3366CC;font-size:1.2em;">ctrl-x</span></code></b> to boot.
 +
#The system should boot into text-based mode. Enter your '''root''' password.
 +
#One thing to look at is partition space usage. Issue the command: <b><code><span style="color:#3366CC;font-size:1.2em;">df -h</span></code></b>
 +
#If you notice 0% free space in the '''/''' partition, then there is a problem. This most likely is caused by not following steps to create a <u>compressed</u> copy of the VM image. If that is the case, locate the large image backup and remove it. Do NOT remove the image in ''/var/lib/libvirt/images'' directory!
 +
#You can use the '''passwd''' command to reset your '''regular user''' password (eg. <b><code><span style="color:#3366CC;font-size:1.2em;">passwd regularuserid</span></code></b>). You can press '''ctrl-c''' if you wish to abort (i.e. not change password).
 +
#To restart in graphical mode, simply enter the command <b><code><span style="color:#3366CC;font-size:1.2em;">reboot</span></code></b>.
 +
 +
:Unfortunately, this method does not work if you forgot your '''root''' password (To reset your root password, refer to procedure below).
 +
 +
 +
'''Steps to Reset Root's Password:'''
 +
 +
{| width="50%" align="right" cellpadding="10"
 +
|- valign="top"
 +
|
 +
[[Image:grub2_3.png|thumb|right|600px|Add word '''single''' at the end of boot options, '''ENTER''' and press '''b''' to boot ]]
 +
|}
 +
#The procedure to reset root's password is different than shown above. Press <b><code><span style="color:#3366CC;font-size:1.2em;">e</span></code></b> at the Grub boot menu.
 +
#Using your arrow keys, move to  '''linux16''' command and replace the argument '''ro''' with the argument <b><code><span style="color:#3366CC;font-size:1.2em;">rw init=/sysroot/bin/sh</span></code></b> (see diagram for reference) and then press <b><code><span style="color:#3366CC;font-size:1.2em;">ctrl-x</span></code></b> to boot.
 +
#The system should boot into text-based mode without prompting for root's password.
 +
#Issue the command: <b><code><span style="color:#3366CC;font-size:1.2em;">chroot /sysroot</span></code></b><br><br>
 +
#Issue the command: <b><code><span style="color:#3366CC;font-size:1.2em;">passwd root</span></code></b> in order to change your root password (press '''ctrl-c''' if you wish to abort - i.e. not change password).
 +
#To restart in graphical mode, simply enter the command <b><code><span style="color:#3366CC;font-size:1.2em;">reboot</span></code></b>.
 +
 +
 +
'''Catastrophic Boot Problems:'''
 +
 +
:Not being able to start your '''c7host''' due to '''Kernel Panic''' or some sort of '''catastrophic disk failure''' is not as easy to fix. You might be able to boot from your '''Centos LIVE DVD, open a terminal and mount the partition''' via command line and look for possible problems (setup files like '''/etc/fstab'''). '''Lab5''' will discuss more about mounting and the /etc/fstab file. The "worst-case scenario" would be to purchase a new hard disk, '''perform lab1 completely, perform lab2 to install and set-up virtualization software''', then '''restore your VM image and xml file backups''' (eg. decompressing images, issuing virsh define commands for .xml files). That is why consistently '''performing backups of ALL of your VMS at the end of each lab is absolutely essential! You have been warned!'''
  
 
== Common Mistakes / Warnings ==
 
== Common Mistakes / Warnings ==

Revision as of 12:36, 5 October 2015

Preparing for Lab 3

Purpose of Lab3

In this lab, you are going to identify potential problems such as not properly compressing VM image files when backing up VMs, or forgetting your root password. You will also learn to conserve hard disk space by learning how to compress and decompress files that are stored on your computer server. In addition, you will learn alternative methods of how to install applications (i.e. programs).

Main Objectives

  • Learn to troubleshoot some common problems after installing VMs
  • Create and extract archive files (tar and tar.gz)
  • Install applications using various methods:
  • Download, decompress and archive file from the Internet, then compile source code in order to install an application.
  • Use yum utility to install software from local source programs (on DVD drive)
  • Use yum utility to install software from repositories (online storage areas)
  • Learn how to add repositories (online software storage areas) to install less common applications.
  • Demonstrate the use of Bash Shell scripts to automate routine tasks (generate a customized software report)


Rescuing Your System

Press e at Grub Boot Menu to edit

There are a few "classic problems" that students can encounter with their virtual machines and their host machine after performing lab2. Although all OPS235 students may not encounter these problems, it is good to be aware of what a potential problem may look like, and know how to solve that problem.


A few common problems are:

  • I Can't boot into Graphical Mode on my c7host machine
  • I Forgot My Regular User Password
  • I Forgot My root Password
  • I Can't Start My Virtual Machine
  • I Can't start my Host machine


Troubleshooting consists of 3 basic elements:

  • Asking Questions (eg. what was done recently prior to problem?)
  • Eliminating what the problem IS NOT
  • Tenacity and patience (ability to focus on finding the cause of the problem)


If you cannot log graphically into your machine (first 3 common problems), there is a trick to boot your system into single-user mode. This mode does not provide networking, graphics, or logging in as other regular users, but can connect to a text-based interface as the root user. This method will only work if a GRUB (Grand Unified Boot-loader) password has not been set, or that you haven't forgotten the GRUB password.



Steps to Boot into "Single-User Mode":

Add the boot option single and then press ctrl-x to boot into single user mode
  1. Boot-up your centos1 VM. when the Grub Boot menu appears, press the letter e (for "edit").
  2. Using your arrow keys, scroll to next screen to linux16 command and type the word single as an argument after quiet (see diagram for reference) and then press ctrl-x to boot.
  3. The system should boot into text-based mode. Enter your root password.
  4. One thing to look at is partition space usage. Issue the command: df -h
  5. If you notice 0% free space in the / partition, then there is a problem. This most likely is caused by not following steps to create a compressed copy of the VM image. If that is the case, locate the large image backup and remove it. Do NOT remove the image in /var/lib/libvirt/images directory!
  6. You can use the passwd command to reset your regular user password (eg. passwd regularuserid). You can press ctrl-c if you wish to abort (i.e. not change password).
  7. To restart in graphical mode, simply enter the command reboot.
Unfortunately, this method does not work if you forgot your root password (To reset your root password, refer to procedure below).


Steps to Reset Root's Password:

Add word single at the end of boot options, ENTER and press b to boot
  1. The procedure to reset root's password is different than shown above. Press e at the Grub boot menu.
  2. Using your arrow keys, move to linux16 command and replace the argument ro with the argument rw init=/sysroot/bin/sh (see diagram for reference) and then press ctrl-x to boot.
  3. The system should boot into text-based mode without prompting for root's password.
  4. Issue the command: chroot /sysroot

  5. Issue the command: passwd root in order to change your root password (press ctrl-c if you wish to abort - i.e. not change password).
  6. To restart in graphical mode, simply enter the command reboot.


Catastrophic Boot Problems:

Not being able to start your c7host due to Kernel Panic or some sort of catastrophic disk failure is not as easy to fix. You might be able to boot from your Centos LIVE DVD, open a terminal and mount the partition via command line and look for possible problems (setup files like /etc/fstab). Lab5 will discuss more about mounting and the /etc/fstab file. The "worst-case scenario" would be to purchase a new hard disk, perform lab1 completely, perform lab2 to install and set-up virtualization software, then restore your VM image and xml file backups (eg. decompressing images, issuing virsh define commands for .xml files). That is why consistently performing backups of ALL of your VMS at the end of each lab is absolutely essential! You have been warned!

Common Mistakes / Warnings

Important.png
Be Aware of the Following Issues
Be aware of these common mistakes that students make that can cause problems for their future labs.


Preparing for Lab Sign-Off

Students should be prepared with all required commands (system information) displayed in a terminal (or multiple terminals) prior to calling the instructor for signoff.


In order to properly complete your lab and move to the next lab, you must have your instructor "sign-off" on your lab

  • Each "signed-off" lab (before due date) is worth 1% of your final grade.
  • Signing-off on labs help to spot errors that can cause problems with future labs.
  • Do you ask the instructor what to check for! Read at the bottom of the lab the requirements, and have all proof available for instructor to view at same time.
  • Failing to be prepared and asking instructor what to check when assignment is mark will result in deduct of marks!
  • For example, open multiple terminals with command results. If properly set-up ahead of sign-off, the process should only take instructor approx 20 seconds to sign-off your lab.
  • If you do not have your lab-logbook, you MUST show your work and your lab log-book to your instructor for sign-off in the next class. This may cause a late penalty if past the required due date.


Lab 3 Debrief