OPS235 Lab 3 Braille

From CDOT Wiki
Jump to: navigation, search


Stop (medium size).png
Braille Only
If you are not using a braille reader, please use OPS235 Lab 3 instead of this lab.
Note.png
htp
Wherever this document says "htp", it should be changed to "http". This was done in order to avoid reported problems with some braille readers.

Investigation 1: Adding a physical volume

  1. Stop the VM "fedora1".
  2. Dump the XML for the virtual machine 'fedora1' into a file: virsh dumpxml fedora1 >fedora1.xml
  3. Examine the file to determine the structure.
  4. Add another virtual disk to the XML configuration file. Use the filename /var/lib/libvirt/images/fedora1-1.img.
  5. Redefine the VM using the XML configuration file: virsh define fedora1.xml
  6. Create the tile /var/lib/libvirt/images/fedora1-1.img as an empty file with a size of 10G: dd if=/dev/zero of=/var/lib/libvirt/images/fedora1-1.img bs=1G count=10
  7. Start the VM.
  8. You should now have a new disk, /dev/vdb
  9. Use fdisk to create a single primary partition that fills all of the new disk.
  10. Use pvcreate to format the new partition as a physical volume: pvcreate /dev/vdb1
  11. Use vgextend to add the new PV to your volume group: vgextend InsertNameOfYourVGhere /dev/vdb1
  12. Use lvextend to extend the size of the root filesystem by 5G: lvextend InsertNameOfYourVGhere/InsertNameOfYourLVhere --size +5G -r
    • Note that the -r resizes the filesystem withing the LV and is critically important!
  13. Confirm that the LV has been resized.
  14. Record notes about this investigation in your lab book.

Investigation 2: Creating, Growing, and Shrinking a Logical Volume

  1. On the VM 'fedora1', perform steps 1-11 from investigation 1 to add additional space to the volume group.
  2. Use lvcreate to create a new logical volume, 5 GB in size, called "data".
  3. Use mkfs to format that logical volume with an ext4 filesystem.
  4. Create a mountpoint named /archive
  5. Edit /etc/fstab so that the logical volume "data" is mounted on /archive each time the system is booted. The line will look like this: /dev/vg_fedora3/data /archive ext4 defaults 1 2"
  6. Note the meaning of each field in the <code>/etc/fstab file:
    1. Device node name
    2. Mountpoint
    3. Filesystem type (can be "auto")
    4. Mount options (can be "defaults")
    5. Whether the filesystem contains data that should be backed up (0 for no, 1 for yes) - this is used by the "dump" backup program (and some others).
    6. The order in which the filesystem should be checked at boot (1 for the root filesystem, 2 for all other filesystems which are to be checked, and 0 if the filesystem should not be checked).
  7. Test the /etc/fstab file: mount -a # If any errors are reported, fix them before proceeding, or your system may not be able to boot!
  8. Reboot the system to confirm that the /archive filesystem is mounted automatically.
  9. Verify the size of the /archive filesystem using: df -h # Record the size.
  10. Copy the contents of the /etc directory to /archive using cp -R
  11. Shrink the size of the LV and filesystem to 1G using these commands:
    • umount devicename
    • fsck -f devicename
    • lvreduce vgname/lvname -r --size -1G # The -r is critically important!
    • mount devicename
  12. Note the function of each command, above.
  13. Verify the size of the /archive filesystem using: df -h # The size should have been reduced by 1 GB.
  14. Grow the /archive LV and filesystem by 3 GB while mounted using lvextend with the -r option.
  15. Verify that the filesystem grew.
  16. Unmount /archive, delete the lv, and remove the corresponding entry from /etc/fstab

Record notes about this investigation in your lab book.

Software Package Management

Investigation 3: How do you query the RPM database?

RPM maintains a database of installed software. This information is very useful to system administrators. In Lab 3, you queried that database using RPM with the -q argument. When you query the RPM database, you can separately specify:

  • Which packages you want information about, using a select-option
  • What information you want about those packages, using a query-option

Perform the following steps:

  1. Using information from the man page for rpm, fill in this information:
Option Meaning Is this a select-option or a query-option?
-a Select all packages select-option
-l
-p filename' Select this uninstalled package
-i Show the package license, packager, URL, description, and other general information.
-f filename
packagename Select just this package select-option

Answer the Investigation 3 observations / table contents in your lab log book.


Investigation 4: How do you install and remove software with RPM?

  1. Change to the directory on your Installation DVD containing the file: lynx-2.8.7-7.fc16.x86_64.rpm
  2. Execute this command: rpm -i lynx-2.8.7-7.fc16.x86_64.rpm
  3. Issue an RPM query to check that lynx is installed.
  4. Issue this command: rpm -e lynx
  5. Issue an RPM query to verify that lynx is no longer installed.
  6. Issue this command: rpm -i BackupPC-3.2.1-6.fc16.x86_64.rpm and note the result

Answer the Investigation 4 observations / questions in your lab log book.

Investigation 4: How do you install and remove software with yum?

Note.png
Internet Connection
In order for yum to work you require a connection to the Internet. Establish this connection by using the browser to log into SeneNET
  1. Change to your home directory.
  1. Issue the command: yum install BackupPC and answer y to the question about installation.
    1. Where did yum get the BackupPC software?
    2. Why could yum install BackupPC when rpm couldn't?
  2. Issue an RPM query to verify that BackupPC is installed.
  3. Issue the command: yum remove BackupPC
  4. Issue an RPM query to verify that BackupPC is no longer installed.
  5. Install nled using yum.
  6. Issue this command: yum info cups
  • Based on the result, do you think that cups is a useful package for your system? If not, try removing it.
  1. Unused and unneeded software can present a security risk and ties up disk space needlessly. Find at least 4 other packages that you're not using on your system, and remove them. Be careful to ensure that removing those packages does not also remove other software that you do need.

Answer the Investigation 5 observations / questions in your lab log book.


Completing the lab

When you have successfully completed this lab, make a new backup of your virtual machines. Remember to backup the additional image files you created!


Preparing for the Quizzes

  1. Describe the steps to switch between text-based and graphical consoles on your f16host system.
  2. List the steps required to swap sizes between lv_root and lv_home logical volumes on your f16host system.
  3. What is a VG? PV? LV?
  4. What commands are used to determine VG / PV / LV information?
  5. What does yum do that rpm does not?
  6. List the steps to install a package via rpm command.
  7. List the steps to determine detailed information regarding an install package.
  8. List the steps to remove a package via rpm command.
  9. List the steps to install a package using the yum command.
  10. List the steps to remove a package using the yum command.
  11. What is the total size of the "main" VG on your system?
  12. How do you create a LV?
  13. How do you delete an LV?
  14. How would you increase the size of the root filesystem by 50 MB?