Open main menu

CDOT Wiki β

Changes

OPS235 Lab 4 - Fedora17

4,149 bytes removed, 22:39, 23 September 2012
no edit summary
{{Admon/note|Do not Shut-Down VMs Until Instructed|You will be running all 3 VMs eventually when performing this tutorial, Leave all VMs running until you are instructed to shut them down at the end of this lab.|}}
== Investigation 1: How to Add a PV to an existing VG (Graphical Method) ==
'''Perform this investigation on the VM named ''<u>fedora1</u>''.'''
 
In this investigation we will be adding an additional '''2 GB''' virtual disk to our ''<u>'''fedora1'''</u>'' system, and use it as an additional physical volume...
 
# Start <code>'''virt-manager'''</code>.
# Shutdown ''fedora1'' if it is running.
# Open the console window for '''''fedora1'''''.
# Select the menu option '''View'''>'''Details'''.
# Click '''''Add Hardware''''' button at the bottom left-hand corner.
# Make certain to remain in the default section called "Storage".
# Make the following selections in this "Storage" dialog box:
 
[[Image:lab4_inv_1.png|thumb|right|400px|Suggested settings in the '''Storage''' dialog box to create a '''virtual Hard Disk'''.]]
 
::* Under '''Create a disk image on the Computer's Hard Drive''', change the size to '''2 GB'''.
::* Do not click on the '''Select Managed or Other Existing Storage''' radio button. Since no file pathname is provided, then the system will assign a name in the directory. You<code>/var/lib/libvirt/images/</code>. <!-- CHANGED THIS LINE TO HAVE THE SYSTEM CREATE THE NEW STORAGE FOR THE USER - 2012-02-10 CTyler -->
::* Select Device Type: '''Virtio Disk'''
::* Select Storage Format: '''raw'''
::* Click '''FINISH''' to proceed.
 
<ol>
<li value="8">Boot the system. You should now have both <code>/dev/vda</code> and <code>/dev/vdb</code>.</li>
<li>Record the size of the volume group and the amount of free space (Hint: use a command that you learned in a previous lab).</li>
<li>Use the system-config-lvm tool to add the new virtual disk to the volume group, then extend the size of the root partition using the newly-added space</li>
<!-- ### SECTION BELOW CHANGED TO LINE ABOVE 2012-02-10 CTyler BECAUSE THE INSTRUCTIONS BELOW ARE NOT
GRAPHICAL, AND THE TITLE OF THIS SECTION INDICATES THE USE OF THE GRAPHICAL TOOLS! -->
<!--
<li>Refer to the following tutorial to use the <code>fdisk</code> command: [http://tldp.org/HOWTO/Partition/fdisk_partitioning.html Partitioning with fdisk]</li>
<li>Use the <code>fdisk</code> command to create a primary partition for <code>/dev/vdb</code> with a single partition (number 1) that fills the whole disk.</li>
<li>Check the messages printed when <code>fdisk</code> exits -- you may need to reboot the system in order for the new partition table to take effect.</li>
<li>Run this command to format the physical volume: <code>pvcreate /dev/''vdb1''</code></li>
<li>Add the new physical volume to the existing volume group: <code>vgextend ''nameOfVolumeGroup'' /dev/vdb1</code></li>
<li>Verify that the volume group is larger and has more free space.</li>
-->
</ol>
 
'''Answer the Investigation 1 observations / questions in your lab log book.'''
== Investigation 2: How to Add a PV to an existing VG (Command Line Method) == '''The investigation relate to ''<u>fedora3</u>''.''' # Check and record the current state of your storage (use <code>df -h, lvs, vgs, pvs</code>).# Make reference to the following command line resource for assistance: [[Logical Volume Management]]#*'''(Hint:''' First view section on '''Adding a Physical Volume'''. Also, write down the commands first and check prior to issuing them in sequence. This is not looking for the commands necessary to add a physical volume to the virtual machine. It is based on the assumption that the virtual machine already has the physical disk added to the machine via virsh or virt-manager.) # Perform the same operations on ''fedora3'' that you did in the Investigation 1 on ''fedora1'':#* Add a virtual disk to the system.#* Partition the disk (use <code>fdisk</code> - refer to the manpages for details as necessary).#* Make the new partition a physical volume (<code>pvcreate</code>).#* Add the PV to the existing volume group (<code>vgextend</code>).#* Confirm that the VG is now larger (<code>pvs, vgs</code>).#* Extend the root filesystem using the new space (<code>lvextend</code>).#* Confirm that you were successful (<code>lvs, df -h</code>).<!--# You are going to only write in your Lab4 Log-book the Linux commands to perform the same operation that you did graphically in Investigation #1.# You are NOT required to issue these commands on your Fedora3 VM, and it will NOT work since there is no extra room on the VM to create a virtual hard disk -->
'''Perform this investigation on the VM named ''<u>fedora2</u>''.'''
'''Answer the Investigation 2 observations / questions in your lab log book.'''