Franske CNT-2311 SP12 Labs: Difference between revisions
Jump to navigation
Jump to search
BenFranske (talk | contribs) |
BenFranske (talk | contribs) No edit summary |
||
Line 79: | Line 79: | ||
* Complete "Project 5-7" from the book | * Complete "Project 5-7" from the book | ||
** As you work through this project remember that instead of working on the third partition of the first hard disk (/dev/sda3) you will be working on the first partition on the second hard disk (/dev/sdb1). | ** As you work through this project remember that instead of working on the third partition of the first hard disk (/dev/sda3) you will be working on the first partition on the second hard disk (/dev/sdb1). | ||
=Chapter 6= | |||
* Complete "Project 6-1" from the book | |||
* Complete "Project 6-2" from the book | |||
** NOTE: Completing this project will completely erase your Fedora installation and re-install it. You will loose any data or customizations you have done to your virtual machine. If you would like to avoid this you can use the instructions from project 5-2 (above) to copy your edited ks.cfg file to a virtual floppy disk, load it into a new virtual machine, and install Fedora using the kickstart option ks=hd:fd0:/ks.cfg to load the ks.cfg file from your virtual floppy drive. | |||
** NOTE: In step 2 of this lab you edit your ks.cfg file to include settings about drive and partition sizes. Your virtual hard drive sizes may vary from the 30GB root partition and 4GB swap partition used in the book. Edit the sizes in your ks.cfg file to be appropriate for your virtual hard disk. | |||
* Complete "Project 6-3" from the book | |||
* Complete "Project 6-4" from the book | |||
** In addition to the instructions in the book compare the output from the commands run on your virtual machine with the output of the commands we saw in class on the laptop systems. |
Revision as of 06:01, 21 February 2012
Below is information about the labs you must complete in this class.
Chapter 2
- Complete "Project 2-2" Installing Fedora Core 13 from the book EXCEPT:
- Install to a new VirtualBox VM instead of directly onto the computer, set up the VM to use bridged networking
- Make the root partition 7GB and the swap partition 1GB
- Complete "Project 2-3" from the book
- Complete "Project 2-4" from the book
- Complete "Project 2-5" from the book
- Complete "Project 2-6" from the book
- Complete "Project 2-7" from the book
Chapter 3
- Complete "Project 3-1" from the book
- Complete "Project 3-2" from the book
- Complete "Project 3-3" from the book
- Complete "Project 3-4" from the book
- Complete "Project 3-5" from the book
- Complete "Project 3-6" from the book
- Complete "Project 3-7" from the book
Chapter 4
- Complete "Project 4-1" from the book
- Complete "Project 4-2" from the book
- Complete "Project 4-3" from the book
- Complete "Project 4-4" from the book
- Complete "Project 4-5" from the book
- Complete "Project 4-6" from the book
- Complete "Project 4-7" from the book
- Complete "Project 4-8" from the book
- Complete "Project 4-9" from the book
- Complete "Project 4-10" from the book
Chapter 5
In this chapter we will be working with a few special things related to hardware. You will need to modify your virtual machine to add some additional hard disks and there will be a few modifications to the labs (noted here) which you'll need to make things work well so be sure to read carefully.
- Complete "Project 5-1" from the book
- Complete "Project 5-2" from the book with the following modifications/notes:
- If you are using a VM do this with a virtual floppy disk, it will be much easier than a USB flash drive. If you are using a physical system with Fedora installed directly on the hardware it will be easier with a USB flash drive unless your system has a floppy drive and you have a disk handy. Note that if you follow the instructions for the USB flash drive you will be erasing all of the data on the USB flash drive!
- You will have to add a virtual floppy controller you your virtual machine (under the storage settings for the VM)
- You will have to add a virtual floppy drive (device) to the controller
- You will have to download a blank floppy disk image and "insert" it into your virtual floppy drive
- Complete "Project 5-3" from the book with the following modifications/notes:
- If you are using a VM you will need to make sure your VM has it's virtual CD/DVD drive connected to the host CD/DVD drive the same way as when you installed Fedora to begin with. You may optionally attach an ISO image to the virtual CD/DVD drive the same way as when you installed Ubuntu.
- Complete "Project 5-4" from the book with the following modifications/notes:
- If you are doing this project directly on hardware instead of in a VM there will be some special considerations depending on your specific installation. Please discuss with the instructor before attempting.
- When we installed our Fedora VMs we did not setup a virtual hard drive as big as the book requested so we do not have enough space on our virtual hard drive to make additional partitions. Instead you should add a second NEW (empty) virtual hard drive to your VM's SATA controller. You should actually make two as we'll need the other one later on. Make the new virtual hard drives EACH 15GB in size.
- As you work through this project remember that instead of working on the first hard disk (/dev/sda) you will be working on one of the new disks you created (/dev/sdb). Because that drive doesn't have any existing partitions when you are working on it you will need to create a new partition of 10GB as indicated in the book but it will be /dev/sdb1 instead of /dev/sda3.
- DO NOT Complete "Project 5-5" from the book! We will be doing something similar (instructions below) but will be utilizing the two new virtual hard drives we created instead of a fourth partition. Because this would require major modification to the lab I have re-written it below with new instructions:
- Switch to the command line terminal (tty2) by pressing Ctrl-Alt-F2 and log in to the terminal using the user name of root and password of secret.
- At the command prompt, type fdisk device_file and press Enter, where device_file is the device file for your second hard disk (/dev/sdb is you have SCSI or SATA disks, or /dev/hdb if you have PATA hard disks). At the fdisk prompt, type m and press Enter to view the various fdisk commands.
- At the fdisk prompt, type n and press Enter to create a new partition. Next, type p to select a primary partition and press Enter. When prompted for the partition number, type 2 and press Enter. When prompted for the start cylinder, observe the valid range within the brackets and press Enter to select the default (the first available cylinder). When prompted for the end cylinder, press Enter to select the default of the last available cylinder on your hard disk.
- At the fdisk prompt, type p and press Enter to view the partition table for your hard disk. How many partitions are present? What type of partition is /dev/sdb2 or /dev/hdb2?
- The partition we just created is going to be used for LVM so we should correctly set the partition type. At the fdisk prompt, type l and press Enter to view the supported partition types. Find the "Linux LVM" type. What is the partition code for it? At the fdisk prompt, type t and press Enter to change the partition type of a partition. Next, type 2 to change the type of the second partition. Enter the Hex code for the "Linux LVM" type (8e) and press Enter.
- At the fdisk prompt, type p and press Enter to view the partition table for your hard disk. What type of partition is now listed for /dev/sdb2 or /dev/hdb2?
- At the fdisk prompt, type w and press Enter to save the changes to the hard disk and exit the fdisk utility.
- At the command prompt, type pvcreate device_file and press Enter, where device_file is the device file for the second partition on your second hard disk (/dev/sdb2 if you have a SCSI or SATA disk, or /dev/hdb2 if you have a PATA disk). What does this command do?
- At the command prompt, type vgcreate vg00 device_file and press Enter, where device_file is the device file for the second partition on your second hard disk (/dev/sdb2 if you have a SCSI or SATA disk, or /dev/hdb2 if you have a PATA disk). What does this command do?
- At the command prompt, type lvcreate -L 3GB -n volume1 vg00 and press Enter to create a 3GB logical volume called volume1 from the vg00 volume group.
- At the command prompt, type lvcreate -L 2GB -n volume2 vg00 and press Enter to create a 2GB logical volume called volume2 from the vg00 volume group.
- At the command prompt, type mkfs.ext4 /dev/vg00/volume1 and press Enter to format the volume1 logical volume using the ext4 filesystem. Next, type mkfs.ext4 /dev/vg00/volume2 and press Enter to format the volume2 logical volume using the ext4 filesystem.
- At the command prompt, type mkdir /volume1 and press Enter to create a directory to use as a mount point for the volume1 logical volume. Next, type mkdir /volume2 and press Enter to create a directory to use as a mount point for the volume2 logical volume.
- At the command prompt, type mount -t ext4 /dev/vg00/volume1 /volume1 and press Enter to mount the volume1 logical volume to the /volume1 directory. Next, type mount -t ext4 /dev/vg00/volume2 /volume2 and press Enter to mount the volume2 logical volume to the /volume2 directory. When finished, type mount and press Enter to verify that both filesystems are mounted.
- At the command prompt, type ls -F /volume1 /volume2 and press Enter. Is there a lost+found directory underneath each directory? Why?
- At the command prompt, type vi /etc/fstab and press Enter. Add the following lines to the bottom of the file, as shown here, to ensure that the volume1 and volume2 logical volumes are mounted at boot time:
- /dev/vg00/volume1 /volume1 ext4 defaults 0 0
- /dev/vg00/volume2 /volume2 ext4 defaults 0 0
- Save your changes and quit the vi editor.
- At the command prompt, type reboot and press Enter. After your Linux system has been loaded, switch to a command-line terminal (tty2) by pressing Ctrl-Alt-F2 and log in to the terminal using the user name of root and password of secret.
- At the command prompt, type mount and press Enter. Are the two logical volumes mounted? Why?
- At the command prompt, type the following commands in turn (pressing Enter after each one) and review the information regarding your computer's physical and logical volumes: pvdisplay, pvscan, vgdisplay, vgscan, lvdisplay, lvscan.
- At the command prompt, type pvcreate device_file and press Enter, where device_file is the device file for your third hard disk (/dev/sdc if you have a SCSI or SATA disk, or /dev/hdc if you have a PATA disk). Instead of creating a physical volume from a single partition on a drive we have setup the entire (unpartitioned) drive as a physical volume.
- At the command prompt, type vgextend vg00 device_file and press Enter', where device_file is the device file for your third hard disk (/dev/sdc if you have a SCSI or SATA disk, or /dev/hdc if you have a PATA disk). Next, type vgdisplay and press Enter to verify that the size of vg00 has gone from about 5GB to about 20GB (the original 5GB on /dev/sdb2 plus the 15GB from /dev/sdc).
- We can now allocate some of this additional space to the two logical volumes we created or we could create additional logical volumes. At the command prompt, type lvextend -L +1GB /dev/vg00/volume1 and press Enter to add 1GB to the logical volume volume1. Next, type lvextend -L +4GB /dev/vg00/volume2 and press Enter to add 1GB to the logical volume volume1.
- At the command prompt, type lvdisplay and press Enter to verify the new sizes of the two logical volumes. Next, type df -h and note the sizes that are available for file storage on the two volumes.
- Even though our logical volumes are now 4GB and 6GB respectively that space is still not available for storage because the volumes were smaller when we formatted them. Luckily, ext4 supports resizing the filesystem even after data is on the volume and while the partition is in use (online). At the command prompt, type resize2fs /dev/vg00/volume1 and press Enter to increase the size of the filesystem up to the full size of the first volume. Next, type resize2fs /dev/vg00/volume2 and press Enter to increase the size of the filesystem up to the full size of the second volume.
- At the command prompt, type df -h and note the sizes that are available for file storage on the two volumes. We have completed adding additional storage to our two volumes from a second disk all while the volumes were mounted and available for use. Behold the power of LVM!
- Type exit and press Enter to log out of your shell.
- Complete "Project 5-6" from the book
- Complete "Project 5-7" from the book
- As you work through this project remember that instead of working on the third partition of the first hard disk (/dev/sda3) you will be working on the first partition on the second hard disk (/dev/sdb1).
Chapter 6
- Complete "Project 6-1" from the book
- Complete "Project 6-2" from the book
- NOTE: Completing this project will completely erase your Fedora installation and re-install it. You will loose any data or customizations you have done to your virtual machine. If you would like to avoid this you can use the instructions from project 5-2 (above) to copy your edited ks.cfg file to a virtual floppy disk, load it into a new virtual machine, and install Fedora using the kickstart option ks=hd:fd0:/ks.cfg to load the ks.cfg file from your virtual floppy drive.
- NOTE: In step 2 of this lab you edit your ks.cfg file to include settings about drive and partition sizes. Your virtual hard drive sizes may vary from the 30GB root partition and 4GB swap partition used in the book. Edit the sizes in your ks.cfg file to be appropriate for your virtual hard disk.
- Complete "Project 6-3" from the book
- Complete "Project 6-4" from the book
- In addition to the instructions in the book compare the output from the commands run on your virtual machine with the output of the commands we saw in class on the laptop systems.