COMP2018

Lab 9 Hardware Management

Overview

In this lab, you will practice retrieving system hardware information and adding virtual hardware by configuring an additional storage device in your virtual machine. For each task, take a screenshot showing your command and as much of the output as is showing in your terminal window. These screenshots will be put together into a single pdf for submission. Questions which ask for you to describe or explain something should have their answers in the PDF file next to any screenshots that apply to them.

Gathering System Information

The following tasks will introdce you to identifying hardware present in your system.

  1. Using lshw -short or lshw -businfo, identify the names of your network interface device and your disk device and your cdrom device if you have one.
  2. Use the lscpu command to determine your cpu architecture, cpu model name, cpu clock speed, cpu cache(s) size(s), and number of cpu cores. Does the arch command show the same cpu architecture as the lspcu command?
  3. Use lshw -class memory to determine your BIOS vendor, BIOS description, BIOS version, and BIOS revision date.
  4. Use lshw -class memory to determine how many motherboard slots have DIMMs in them and how big each one is.
  5. Does the amount of memory swapped, free, and used for buffers and cache agree when you compare the output of the vmstat and free commands?
  6. Use the lshw -class disk command to produce a list of your storage devices showing, vendor, product (name and capacity), serial number, and version information.

Observing Hardware Activity

In this section, you will run a tiny script to create activity in your system. While that script is running, you be able to observe system resource utilization in multiple ways.

  1. Run the following command in a terminal and leave it running.
     while (true) do find / -type f -exec sort {} \; >&/dev/null;done
    
  2. In a second terminal, try vmstat 3 and iostat 3 to see how much disk and cpu activity is generated by the search and sort going on in the other window.
    1. What is the maximum disk read speed you observed in KB/s?
    2. What is the maximum disk write speed you observed in KB/s?
    3. How busy was the CPU in percent?
    4. How many cores does your Linux machine have?
    5. What conclusion can you draw about the nature of the workload being handled by the machine?
    6. Use CTRL-C to terminate each of the iostat and vmstat commands, as well as the sort task running in the other terminal window when you complete this task.

Adding Storage Devices

The following steps will walk you through adding a new disk device to an existing system. WARNING: You can easily destroy your vm if you do not follow instructions carefully. It is advisable to create a snapshot of your VM before beginning this task. The only screenshot needed for this task is the output of Step 12.

  1. Shut down your VM.
    sudo poweroff
    
  2. Use the VMWare settings to add a new disk to your machine, 2GB is big enough.
  3. Boot your VM.
  4. Run
    lsblk
    

    to find the device name for your new disk device (probably sdb).

  5. Run
    sudo fdisk /dev/yourdevicename
    

    to create a single primary partition on the disk that is the size of the entire disk. Run

    lsblk
    

    to verify you now have a partition available on the disk.

  6. BE VERY CAREFUL WITH THIS STEP. Use mkfs to make a filesystem on your new partition.
    sudo mkfs /dev/yournewpartition
    
  7. Run
    lsblk --output NAME,UUID,FSTYPE,SIZE,MOUNTPOINT
    

    to see your new filesystem and get its UUID.

  8. Create a new empty directory named /backups.
    sudo mkdir /backups
    
  9. Add a line to your /etc/fstab to mount the new filesystem on the /backups directory. Use a format like the one for the root filesystem already in the fstab file.
    sudo vi /etc/fstab
    
  10. Run
    sudo mount /backups
    

    to mount your new filesystem.

  11. Run lsblk and df to review the available disk, including your new filesystem.
    lsblk
    df -h
    
  12. Run the following commands to demonstrate the task is completed, this is the stuff to capture a screenshot of for this task.
    cat /etc/fstab
    lsblk
    df -h
    

Results Submission

For each task, take a screenshot showing your command and as much of the output as is showing in your terminal window. These screenshots must be put together into a single PDF file for submission. Questions which ask for you to describe or explain something should have their answers in the PDF file next to any screenshots that apply to them. Submit only one PDF file.