770 likes | 965 Views
CIS 191 – Lesson 5. Lesson Module Status Slides – draft Properties - done Flash cards – 9 No-stress quiz – done Web Calendar summary – done Web book pages – done Commands – done Skills pacing - done Lab – done
E N D
CIS 191 – Lesson 5 • Lesson Module Status • Slides – draft • Properties - done • Flash cards – 9 • No-stress quiz – done • Web Calendar summary – done • Web book pages – done • Commands – done • Skills pacing - done • Lab – done • Supplies – blank floppies, rescue-cd.iso, rescue-floppy.iso, grub.flp, grub-setup.flp • Class PC's – OpenSUSE ISO, Duke, 191-trouble
CIS 191 - Lesson 5 Quiz • Please close your books, turn off your monitor, take out a blank piece of paper and answer the following questions: • On Red Hat systems, what command is used to manage services by runlevel (show and configure services to stop or start)? • How can you view kernel startup messages? • What does the line id:5:initdefault: do in /etc/inittab?
CIS 191 – Lesson 5 Installation and Troubleshooting = hands on exercise for topic
CIS 191A Course Skills Pacing Lesson 1 VMware Server Ubuntu 8.04 Lesson 2 Partitioning Make file systems RH9 Lesson 3 Booting Dual boot Fedora 8/DOS Lesson 6 RPM, apt-get Tarballs Custom Distro Lesson 5 Troubleshooting OpenSUSE Lesson 5 Rooting CentOS Lesson 7 X windows Debian Install Review Final
CIS 191 - Lesson 5 Housekeeping
CIS 191 - Lesson 5 Housekeeping • Questions on previous material or labs? • Return graded material • Review Grades web page • Review Extra Credit page • Lab 2 and 3 due today
CIS 191 - Lesson 5 Test 1 02 xxx 03 xx 06 xx 07 xxx 08 xxx 09 x 10 xxxxx 11 xxxxxxxx 12 xx 13 xxxxxx 14 xxxxxxxxxxx 15 xxxxxx 10. What command is used to make special files? mknod 11. What file shows what gets mounted automatically at boot time? /etc/fstab 13. What command could you use to backup the MBR of the first SCSI drive? dd if=/dev/sda of=mbrbs=512 count=1 14. What command can be used to show superblock information? dumpe2fs -h or tune2fs -l plus device (e.g. /dev/sda2) 15. In an ext2 or ext3 file system, where are the filenames stored? directories Scoring: Extra credit is applied first to offset any incorrect answers
CIS 191 - Lesson 4 OpenSUSE 11 Install
CIS 191 - Lesson 4 Exercise: openSUSE 11 installation MBR • Follow Howto on website: • http://simms-teach.com/howtos/110-openSUSE-11-install.pdf • Name this system "opensuse11" (both VM and hostname) • For the root and CIS191 account, use password on whiteboard. /dev/sda1 Boot Sector swap /dev/sda2* Boot Sector / /dev/sda3 Boot Sector home /dev/sda title openSUSE 11.0 - 2.6.25.5-1.1 root (hd0,1) kernel /boot/vmlinuz-2.6.25.5-1.1-pae root=/dev/sda2 resume=/dev/sda1 splash=silent showoptsvga=0x317 initrd /boot/initrd-2.6.25.5-1.1-pae
CIS 191 - Lesson 5 /dev/sda /dev/sdb Extra Credit Lab See Lab X2 on Calendar Adds a new drive and root file system to the OpenSUSE VM. GRUB is configured to root to the new root file system MBR MBR /dev/sda1 /dev/sdb1 Boot Sector Boot Sector swap / /dev/sda2* Boot Sector / New drive added with custom root file system /dev/sda3 Boot Sector home title openSUSE 11.0 - 2.6.25.5-1.1 root (hd0,1) kernel /boot/vmlinuz-2.6.25.5-1.1-pae root=/dev/sda2 resume=/dev/sda1 splash=silent showoptsvga=0x317 initrd /boot/initrd-2.6.25.5-1.1-pae title My Linux root to 2nd drive root (hd0,1) kernel /boot/vmlinuz-2.6.25.5-1.1-pae ro root=/dev/sdb1 initrd /boot/initrd-2.6.25.5-1.1-pae
CIS 191 - Lesson 5 Skills
CIS 191 - Lesson 5 Lesson 5 New Skills • Boot time GRUB edits (review) • Changing BIOS boot order on a VM (review) • Mounting CD ISO and floppy Image files on loopback devices (new) • Making a diagnostics boot diskette (new)
Boot time GRUB edits
CIS 191 - Lesson 5 GRUB boot edits Fedora 9 Press any key to get boot menu
CIS 191 - Lesson 5 GRUB boot edits Fedora 9 Move up and down using arrow keys. Press e to edit selection.
CIS 191 - Lesson 5 GRUB boot edits Fedora 9 Move up and down using arrow keys. Press e to edit selection.
CIS 191 - Lesson 5 GRUB boot edits Fedora 9 Make changes by moving the cursor and replacing or inserting characters.
CIS 191 - Lesson 5 GRUB boot edits Fedora 9 For this example we replace UUID specification of the / partition with /dev/sda5, remove the rhgb and quiet options and add single to boot up in single user mode. Hit Enter when finished.
CIS 191 - Lesson 3 GRUB boot edits Fedora 9 Now press b to boot up using the changes
CIS 191 - Lesson 5 GRUB boot edits Fedora 9 The system now boots into single user mode. NOTE: The GRUB changes are temporary. /boot/grub/grub.conf must be edited to make changes permanent NOTE: The single option on the kernel line is very handy when troubleshooting boot problems.
BIOS boot order
CIS 191 - Lesson 3 BIOS Boot Order VMware BIOS 1) Click inside the VM so it has the focus 2) Tap F2 repeatedly to enter BIOS configuration. Note: You don't get much time for this so have your finger over the F2 key!
CIS 191 - Lesson 3 BIOS Boot Order VMware BIOS Right arrow over to the Boot menu.
CIS 191 - Lesson 3 BIOS Boot Order VMware BIOS Re-order to suit your needs. This VM will look first on a floppy, then a CD, then the hard drive and then try network boot.
CIS 191 - Lesson 3 BIOS Boot Order VMware BIOS A + means the group can be expanded (use Enter) Noter: VMware BIOS does not support USB pen drive boots.
CIS 191 - Lesson 3 BIOS Boot Order VMware BIOS If you have multiple hard drives, they can be searched in order as well
CIS 191 - Lesson 3 BIOS Boot Order VMware BIOS Save any changes you make.
loopback mounts
CIS 191 - Lesson 5 Lesson 5 Mounting CD ISO and floppy Image files on loopback devices • Desired: • Be able to directly mount an CD ISO image file. Avoids having to burn downloaded ISO's on to CD's , then loading the new CD into computer, and then finally mounting /dev/cd0. • Solution: • Use loopback devices.
CIS 191 - Lesson 5 Mounting File Systems Like pinning the tail on the donkey mount /dev/sdb1 /mnt / /bin /boot /etc /dev /home /lib /mnt lost+found/ cdrom/ cis191/ floppy/ lost+found/ /dev/sda5 grub/ /dev/sda1 /bin /boot /dev /lib /dev/sdb1
CIS 191 - Lesson 5 Mounting File Systems Like pinning the tail on the donkey mount /dev/sdb1 /mnt / /bin /boot /etc /dev /home /lib /mnt bin/ lost+found/ boot/ cis191/ lost+found/ dev/ /dev/sda5 grub/ lib/ /dev/sda1 /dev/sda6
CIS 191 - Lesson 5 Mounting Image Files Like pinning the tail on the donkey mount –o loop Desktop/rescue-cd.iso /mnt / /bin /boot /etc /dev /home /lib /mnt lost+found/ cdrom/ cis191/ floppy/ lost+found/ /dev/sda5 grub/ /dev/sda1 rescue-cd.iso
CIS 191 - Lesson 5 Mounting Image Files Like pinning the tail on the donkey mount –o loop Desktop/rescue-cd.iso /mnt / /bin /boot /etc /dev /home /lib /mnt /lost+found /images /isolinux /rsimms /lost+found TRANS.TBL /dev/sda5 /grub /dev/loop0 /dev/sda1
HW Diags
CIS 191 - Lesson 5 Diagnostics boot diskette Checking out your system prior to installing Linux • Check RAM quantity • Check drive sizes • Inspect other hardware resources as necessary
CIS 191 - Lesson 5 Diagnostics boot disk BIOS code Boot order with floppy drive at top Floppy with boot code for DOS When DOS loads, autoexec.bat run diagnostics program
CIS 191 - Lesson 5 Diagnostics DIAG, the diagnostic program
CIS 191 - Lesson 5 Installation RAM Requirements & Configuration Issues • The more RAM the better • Graphics (X Windows) runs best with a minimum of 64MB RAM • Swap space size should be 1.5 to 2 times RAM – up to 256 MB. At 256MB RAM and above, swap space should equal RAM
CIS 191 - Lesson 5 Exercise: Mounting ISOs using Loopbacks • Follow Howto on website: • http://simms-teach.com/howtos/124-mount-iso-on-loopback.pdf
CIS 191 - Lesson 5 Exercise: Boot Floppy Diagnostics • Follow Howto on website: • http://simms-teach.com/howtos/123-diag-floppy.pdf
CIS 191 - Lesson 5 Trouble shooting
CIS 191 - Lesson 5 Booting the System Power On Self Test (POST) – loads the BIOS. BIOS loads the Master Boot Record. MBR read its partition table to determine which partition to boot into. MBR loads the boot program in the active partition. Boot program presents user with boot prompt menu. Based upon user selection, boot program loads desired kernel along with and supplied boot options Kernel uncompresses and loads into memory. Kernel detects hardware and initializes its data. boot order fdisk grub.conf grub.conf
CIS 191 - Lesson 5 Rooting the System • Kernel mounts the root file system • Kernel creates and starts the init process • init reads /etc/inittab for its instructions • init performs system initialization: • presents some kind of welcome banner • allows for and interactive startup • set up keyboard mapping, system fonts, plug and play devices, … • checks for dirty file systems, can clean them if necessary • checks disk quotas and swap space • mounts all file systems • Chooses which runlevel to come up in and executes those scripts via rc script • daemons load • getty processes are spawned on terminal devices grub.conf /etc/inittab /etc/rc.d
CIS 191 - Lesson 5 Preparing for trouble • Record your partition and mount information (output from fdisk –l and mount) • Make a copy of your MBR. For example: • dd if=/dev/sda of=mbrbs=512 count=1 • Create a bootable rescue floppy with GRUB installed that roots to your / partition on your Linux system. • Record grub.conf • Record MBR xxd output • Record /etc/inittab
CIS 191 - Lesson 5 Rescue boot devices • Put pristine GRUB stage1 and stage2 files • Add GRUB config files for more control • Add a kernel for more options • Make vender rescue disk • Add a kernel and small root file system with tools • Use small Linux distribution like Knoppix
CIS 191 - Lesson 5 Making rescue floppy RH9 example • Method I • The "simplest rescue diskette" • cd /usr/share/grub/i386-redhat • cat stage1 stage2 > /dev/fd0 • Note: this will allow you to boot directly into GRUB. At boot time you would manually enter (use tab completes!): • grub • grub> root (hd0,0) • grub> kernel /vmlinuz-2.4.20-6 ro root=/dev/sda2 • grub> initrd /initrd-2.4.20-6.img • grub> boot • Method II • grub • grub> root (hd0,0) • grub> setup (fd0) • grub> quit MBR /dev/sda1 Boot Sector /dev/fd0 Boot Sector /boot /dev/sda2 Boot Sector / /dev/sda3 Boot Sector swap
CIS 191 - Lesson 5 Making rescue floppy Installing boot code into floppy boot sector MBR • Method III (RH9) • mkbootdisk --device /dev/fd0 $(uname –r) • Method IV • Put grub files to floppy and setup boot sector to use them. See Howto on "Trouble" /dev/sda1 Boot Sector /dev/fd0 Boot Sector /boot /dev/sda2 Boot Sector / /dev/sda3 Boot Sector swap
CIS 191 - Lesson 5 Startup Troubleshooting How to make lots of trouble: http://simms-teach.com/howtos/116-rh9-trouble.pdf
CIS 191 - Lesson 5 The faces of trouble
CIS 191 - Lesson 5 The faces of trouble