1 / 88

CIS 191 – Lesson 2

CIS 191 – Lesson 2. Lesson Module Status Slides - draft Flash cards – 16 No-stress quiz – done Web Calendar summary – done Web book pages – done Commands – done Course skills pacing - done Lab – Jim's Classroom PC's – rh9 isos done. CIS 191 - Lesson 2. Quiz.

stefan
Télécharger la présentation

CIS 191 – Lesson 2

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. CIS 191 – Lesson 2 • Lesson Module Status • Slides - draft • Flash cards – 16 • No-stress quiz – done • Web Calendar summary – done • Web book pages – done • Commands – done • Course skills pacing - done • Lab – Jim's • Classroom PC's – rh9 isos done

  2. CIS 191 - Lesson 2 Quiz • Please book close your books, turn off your monitor, take out a piece of paper and answer the following questions: • In a long listing (ls –l) what code letter is used for a symbolic link? • Where in the file directory tree is the kernel and how do you recognize it? • What command and option shows how the drives are partitioned?

  3. CIS 191 – Lesson 2 Storage and File Systems  = hands on exercise for topic

  4. 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 9/DOS Lesson 6 RPM, apt-get Tarballs Custom Distro Lesson 5 Troubleshooting openSUSE 11 Lesson 4 Rooting CentOS Install Lesson 7 X windows Debian Install Review Final

  5. CIS 191 - Lesson 2 Last weeks Assignment • Student surveys due today • Questions from previous week? • vmware? • ubuntu install? • course syllabus?

  6. CIS 191 – Lesson 2 Review Exercise Becoming Root on Ubuntu • Howto set the password for root on ubuntu: • sudo passwd root • [see white board] • [see white board] • Switch to root user: su - } Only need to do this once to enable root on Ubuntu The - gives you root's path and environment

  7. CIS 191 – Lesson 2 Review Exercise (continued) Exploring Ubuntu 8.04 Desktop Virtual Machine • Show network configuration: • ifconfig • route –n • cat /etc/resolv.conf • Show hostname: hostname • Show disk partitions: fdisk –l • Mounts: mount • Show disk space usage: du –s /* • Show CPU info: cat /proc/cpuinfo • Show RAM size and usage: free –m or top • Show installed packages: dpkg -l • Find the kernel version: uname –r • Default runlevel: runlevel Tip: man command and google are great ways to get information on commands

  8. CIS 191 – Lesson 2 Review Exercise (continued) Team Process • Each table is one team • CIS 81, 82, 83 alumni identify themselves to the class • Each team picks a pilot and a scribe • Make introductions and share: • High school you attended • Longest job held • Team helps the pilot issue each of the quick inventory commands on previous slide. • Team answers their 3 questions on the next slide. • When finished, scribe writes answers on the white board. • Reports – when all teams are done, we will go around the room, each scribe will introduce the members of his or her team. Each pilot will explain how they got their answers.

  9. CIS 191 – Lesson 2 Review Exercise (continued) Teams • Table 5-8 • What linux command would print a list of top level directories sorted by size? • What are the top 3 largest level directories? • What version is the kernel? • Table 1-4 • What network (n.n.n.n /n) are we on in 2501? • Where is the kernel and what is its name? • What IP addresses are configured for the gateway and DNS server? • Table 13-16 • What processor (model and speed) is the VM using and what is the cache size? • What is the name of one of the Common UNIX Printing System (CUPS) packages that have been installed? • Is CUPS running now? • Table 9-12 • What partition is / mounted on? • What partition is used for swap space? • What happens if your run fdisk –l as a non-root user? • Table 9-12 • What is the default runlevel for the VM. • What does runlevel N mean? • What is the hostname and IP address? • Table 13-16 • How much RAM does your VM have? • How much memory is being used and how much is free? • What are the –m and –k options for the free command?

  10. CIS 191 - Lesson 2 Housekeeping

  11. CIS 191 - Lesson 2 • Call roll • Final surveys • Fix TBA signup sheet • Opus accounts • lllllfff/lllllffff1

  12. CIS 191 - Lesson 2 Storage Devices

  13. CIS 191 - Lesson 2 Storage Devices USB flash drive (aka pen drive) Hard drive (IDE and SCSI) Floppy drive and diskettes

  14. CIS 191 - Lesson 2 Storage Devices DAS – Direct Attached Storage NAS – Network Attached Storage SAN – Storage Area Networks

  15. CIS 191 - Lesson 2 • Recognizing and specifying storage devices • IDE drives: • Primary master (/dev/hda) • Primary slave (/dev/hdb) • Secondary master (/dev/hca) • Secondary slave (/dev/hdd) • SCSI drives: • Each SCSI disk has a target id (1-7) or (1-14). (/dev/sda, /dev/sdb, ...)

  16. CIS 191 - Lesson 2 • Recognizing and specifying storage devices • USB Flash (pen) drives: • Same device naming as SCSI drives • (can use dmesg to distinguish) • Floppies: • First drive (/dev/fd0) • Second drive (/dev/fd1) • …

  17. CIS 191 - Lesson 2 Recognizing Storage Devices

  18. CIS 191 - Lesson 2 • Recognizing and specifying storage devices Master IDE drive on primary One IDE drive

  19. CIS 191 - Lesson 2 • Recognizing and specifying storage devices Master IDE drive on Secondary Master IDE drive on primary Two IDE drives

  20. CIS 191 - Lesson 2 • Recognizing and specifying storage devices USB flash (pen) drive IDE hard drive Floppy drive

  21. CIS 191 - Lesson 2 • Recognizing and specifying storage devices First SCSI drive fdisk doesn’t like LVM yet, so we will suppress bogus errors First SCSI drive, first partition First SCSI drive, second partition Used for LVM SCSI drive (with LVM)

  22. CIS 191 - Lesson 2 • Recognizing and specifying storage devices SCSI hard drive USB flash drive SCSI and USB Flash (pen) drive

  23. CIS 191 - Lesson 2 dmsg command output Plugging in USB flash drive starts here Device identification (/dev/sdb) shows here and log ends here

  24. CIS 191 - Lesson 2 Geometry

  25. CIS 191 - Lesson 2 Example Physical CHS Disk Drive Geometry One head on each side of platter One sector One track 14 tracks 8 sectors per track One imaginary cylinder 3 platters 6 heads 14 cylinders size = cylinders x heads x sectors per track x 512 bytes size = 14 x 6 x 8 x 512 = 344,064 bytes

  26. CIS 191 - Lesson 2 Disk Drive Geometry • Times have changed! • Disk drives are no longer limited to 1024 cylinders (old BIOS restriction) • Modern track density has hit over tens of thousands of tracks per inch (the old 3.5”diskette had 80 per side) • Zone bit recording places more sectors per track on outside tracks. E.g. A IBM 34.2 GB Deskstar has 272 to 452 sectors per track. • NOTE: The OS uses logical disk geometry which does not match physical disk geometry. • Modern drives use Logical Block Addressing (LBA) rather than the old CHS addressing.

  27. CIS 191 - Lesson 2 Disk Drive Geometry physical ≠ logical Modern drives have variable number of sectors per track. It is not possible to represent their full capacity using the old CHS method. The BIOS shows 16 logical heads and 63 logical sectors per track and adjust the number of logical cylinders to approximate the full capacity. The OS fdisk shows 255 logical heads and 63 logical sectors per track and then adjusts logical cylinders accordingly. Disk /dev/hda: 5368 MB, 5368709120 bytes 255 heads, 63 sectors/track, 652 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes

  28. CIS 191 - Lesson 2 Disk sizes (fdisk command) 5GB VMWare Drive 5 x 1024 x 1024 x 1024 = 5,368,709,120 bytes 255 heads x 63 sectors/track x 652 cylinders x 512 bytes = 5,362,882,560 bytes NOTE This is logical (not physical) disk geometry Blocks (1 block = 1024 bytes) Cylinders

  29. CIS 191 - Lesson 2 Disk sizes (df command) 3,5266,204 x 1000 x (1000/1024) = 3,443,558,594 bytes = 3.4 GB 101,107 x 1000 x (1000/1024) = 98,737,304 bytes = 99 MB NOTE: 1 computer KB = 1,024 bytes (2 to the 10th power) 1 human KB = 1,000 bytes

  30. CIS 191 - Lesson 2 Exercise: Partitioning During Installation • Create new VM • Configuration: Typical • Guest OS: Linux, Version: Red Hat Linux • VM name: rh9, Location: See whiteboard • Network connection: Bridged • Disk size: 5GB, don’t allocate space now • CD: Use ISO image: rh9-shrike-cd1.iso • Install Red Hat • Installation type: Workstation

  31. CIS 191 - Lesson 2 Exercise: Partitioning During Installation (continued) • Disk Partitioning Setup: • Manually partition with Disk Druid • /boot (100 MB) force primary • / (2500 MB) force primary • swap (256 MB) force primary • /home (1000 MB) extended

  32. CIS 191 - Lesson 2 Exercise: Partitioning During Installation (continued) • Network Devices: • DHCP • Hostname: rh9

  33. CIS 191 - Lesson 2 Exercise: Partitioning During Installation (continued) • Firewall: • Medium • Trusted: eth0 (checked) • Allow incoming: SSH (checked), DHCP (checked) • Time zone: Los Angeles • Set root password: see whiteboard • Customize the set of packages: • Text-based Internet: remove check • Office/Productivity: remove check • Sound and Video: remove check • Graphics: remove check • Games and Entertainment: remove check • Don't make emergency floppy

  34. CIS 191 - Lesson 2 Exercise: Partitioning During Installation (continued) • Normal user: cis191 and password: see whiteboard • Don’t register the system • Log in and Install VMware Tools • Install RPM • vmware-config-tools.pl • 800 x 600 • Shut down VM • Snapshot VM • Add a floppy drive (if necessary) • Add a second SCSI drive (2 GB, don't allocate space now)

  35. CIS 191 - Lesson 2 Disk Partitions

  36. CIS 191 - Lesson 2 Setting up Hard Drives Step 1 – Add hard drive to computer Free Space • Add the hard drive: • Low-level formatting has already been done at the factory (lays out the physical tracks and sectors). • There are no partitions yet. • There are no file systems yet. Note: Floppies, unlike hard drives, can be low-level formatted with the fdformat command

  37. CIS 191 - Lesson 2 Setting up Hard Drives Step 2 - Partition the hard drive Master Boot Record (MBR) • Partition the hard drive: • The MBR is on the very first sector and is 512 bytes long. • The first 446 bytes of the MBR gets system boot code. • The next 64 bytes of the MBR gets the partition table. • The last 2 bytes are marked 0xAA55. Partition Boot Sector Data Partition Boot Sector Data Free Space

  38. CIS 191 - Lesson 2 Setting up Hard Drives Step 2 - Partition the hard drive Master Boot Record (MBR) The MBR partition table records the location, status and type of each primary partition. Partition Boot Sector Data • Primary • partition Partition Boot Sector Data Primary partition Free Space Each added partition has its own boot sector at the beginning.

  39. CIS 191 - Lesson 2 Setting up Hard Drives Step 2 - Partition the hard drive Master Boot Record (MBR) Partition Boot Sector Data • Primary • partition Partition Boot Sector Primary partition The maximum number of primary partitions is four. Data Partition Boot Sector • Primary • partition Data Partition Boot Sector Primary partition Data

  40. CIS 191 - Lesson 2 Setting up Hard Drives Step 2 - Partition the hard drive Master Boot Record (MBR) One of the four primary partitions can be an extended partition An extended may contain an arbitrary number of logical partitions Partition Boot Sector • Primary • partition Data Partition Boot Sector Primary partition Data Partition Boot Sector • Primary • partition Data Partition Boot Sector Unused Boot Sector Logical partition Data Extended partition Unused Boot Sector Logical partition Data

  41. CIS 191 - Lesson 2 Setting up Hard Drives Step 3 – Add file systems to partitions Master Boot Record (MBR) Partition Boot Sector ext2 file system Data Superblock Partition Boot Sector Inode Table Data Partition Boot Sector Data Partition Boot Sector Unused Boot Sector Data Blocks Data Unused Boot Sector Data

  42. CIS 191 - Lesson 2 fdisk and mount Show current partitions and their usage Master Boot Record (MBR) Partition Boot Sector /dev/sda1 /boot Partition Boot Sector /dev/sda2 / Partition Boot Sector /dev/sda3 swap Partition Boot Sector Unused Boot Sector /dev/sda4 /dev/sda5 /home Free Space

  43. CIS 191 - Lesson 2 Specifying partitions Partitions are labeled by Linux as the drive name following by a number. The numbers 1-4 are reserved for the first four primary partitions. 5 or higher indicates it is a logical partition. Examples: /dev/hda1 = first partition (primary) on the primary master IDE drive. /dev/sdb3 = third partition (primary) on the second SCSI drive. /dev/sda5 = fifth partition (logical partition) on the first SCSI drive.

  44. CIS 191 – Lesson 2 Specifying partitions Add 1 primary and 1 extended to new drive [root@rh9 root]# fdisk -l Disk /dev/sda: 5368 MB, 5368709120 bytes 255 heads, 63 sectors/track, 652 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Device Boot Start End Blocks Id System /dev/sda1 * 1 13 104391 83 Linux /dev/sda2 14 332 2562367+ 83 Linux /dev/sda3 333 365 265072+ 82 Linux swap /dev/sda4 366 652 2305327+ 5 Extended /dev/sda5 366 492 1020096 83 Linux /dev/sda6 493 505 104391 83 Linux Disk /dev/sdb: 2147 MB, 2147483648 bytes 255 heads, 63 sectors/track, 261 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Disk /dev/sdb doesn't contain a valid partition table [root@rh9 root]# fdisk /dev/sdb Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel Building a new DOS disklabel. Changes will remain in memory only, until you decide to write them. After that, of course, the previous content won't be recoverable. Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite) Command (m for help): /dev/sda has been partitioned already. /dev/sdb has not been partitioned yet.

  45. CIS 191 – Lesson 2 Specifying partitions Add 1 primary and 1 extended to new drive Command (m for help): n Command action e extended p primary partition (1-4) e Partition number (1-4): 1 First cylinder (1-261, default 1): 1 Last cylinder or +size or +sizeM or +sizeK (1-261, default 261): 50 Command (m for help): n Command action l logical (5 or over) p primary partition (1-4) l First cylinder (1-50, default 1): Using default value 1 Last cylinder or +size or +sizeM or +sizeK (1-50, default 50): 10 Command (m for help): p Disk /dev/sdb: 2147 MB, 2147483648 bytes 255 heads, 63 sectors/track, 261 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Device Boot Start End Blocks Id System /dev/sdb1 1 50 401593+ 5 Extended /dev/sdb5 1 10 80262 83 Linux Command (m for help): MBR Boot Sector /dev/sdb5 Unused /dev/sdb1 Free Note: The second partition added is number 5 because it is in an extended partition. Numbers 1-4 are reserved for the four primary partitions.

  46. CIS 191 - Lesson 2 fdisk Partition Utility – (n)ew and (p)rint [root@rh9 root]# fdisk /dev/sda Command (m for help): n First cylinder (493-652, default 493): Using default value 493 Last cylinder or +size or +sizeM or +sizeK (493-652, default 652): +100M Command (m for help): p Disk /dev/sda: 5368 MB, 5368709120 bytes 255 heads, 63 sectors/track, 652 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Device Boot Start End Blocks Id System /dev/sda1 * 1 13 104391 83 Linux /dev/sda2 14 332 2562367+ 83 Linux /dev/sda3 333 365 265072+ 82 Linux swap /dev/sda4 366 652 2305327+ 5 Extended /dev/sda5 366 492 1020096 83 Linux /dev/sda6 493 505 104391 83 Linux Command (m for help): MBR /dev/sda1 Boot Sector /boot /dev/sda2 Boot Sector / /dev/sda3 Boot Sector swap Boot Sector /dev/sda5 Unused /home /dev/sda4 /dev/sda6 Unused Free Space

  47. CIS 191 - Lesson 2 fdisk Partition Utility – (m)enu of commands Command (m for help): m Command action a toggle a bootable flag b edit bsddisklabel c toggle the dos compatibility flag d delete a partition l list known partition types m print this menu n add a new partition o create a new empty DOS partition table p print the partition table q quit without saving changes s create a new empty Sun disklabel t change a partition's system id u change display/entry units v verify the partition table w write table to disk and exit x extra functionality (experts only) Command (m for help): MBR /dev/sda1 Boot Sector /boot /dev/sda2 Boot Sector / /dev/sda3 Boot Sector swap Boot Sector /dev/sda5 Unused /home /dev/sda4 /dev/sda6 Unused Free Space

  48. CIS 191 - Lesson 2 fdisk Partition Utility – (w)rite out partition table Command (m for help): w The partition table has been altered! Calling ioctl() to re-read partition table. WARNING: Re-reading the partition table failed with error 16: Device or resource busy. The kernel still uses the old table. The new table will be used at the next reboot. Syncing disks. [root@rh9 root]# partprobe MBR /dev/sda1 Boot Sector /boot /dev/sda2 Boot Sector / /dev/sda3 Boot Sector swap Boot Sector Use partprobe to update the kernel without rebooting. This is required if you want to mount a new partition. /dev/sda5 Unused /home /dev/sda4 /dev/sda6 Unused Free Space

  49. CIS 191 - Lesson 2 fdisk Partition Utility – the l option MBR /dev/sda1 [root@rh9 root]# fdisk -l Disk /dev/sda: 5368 MB, 5368709120 bytes 255 heads, 63 sectors/track, 652 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Device Boot Start End Blocks Id System /dev/sda1 * 1 13 104391 83 Linux /dev/sda2 14 332 2562367+ 83 Linux /dev/sda3 333 365 265072+ 82 Linux swap /dev/sda4 366 652 2305327+ 5 Extended /dev/sda5 366 492 1020096 83 Linux /dev/sda6 493 505 104391 83 Linux Boot Sector /boot /dev/sda2 Boot Sector / /dev/sda3 Boot Sector swap Boot Sector /dev/sda5 Unused /home /dev/sda4 /dev/sda6 Unused Free Space

  50. CIS 191 - Lesson 2 Exercise: Partitioning with fdisk On the rh9 VM, use fdisk –l to show your hard drive and the current partitions. Now run fdisk on your hard drive Add a new 100M partition to /dev/sda. Type p to verify. Delete the partition you just added and verify. Add the partition back in again and verify. Change the system ID of the new partition to Amoeba and verify. Change it back to Linux and verify. Type W to write out partition table and exit. Type partprobe to update the kernel without rebooting. Run fdisk –l to show your hard drive and the updated partitions. Check: Your new partition should be /dev/sda6

More Related