Changes

Jump to: navigation, search

OPS235 Lab 3 - Fedora17

1,465 bytes removed, 17:03, 18 September 2012
Investigation 4: Adjusting Sizes of lv_root and lv_home
{{Admon/note|VM Backups and Recovery|Most of these investigations will take place in your virtual machines. If you make a significant mistake, your virtual machine may not boot. Remember that you created backups of your virtual machines in Lab 2, and you can restore them if something goes wrong.<br /><br />'''Remember: if you did not create backups for all of your VMs, then you don't have any restoration points to fall-back to!'''|}}
== Investigation 4: Adjusting Sizes Extend the size of lv_root and lv_home ==
=== Why Readjust sizes of lv_root and lv_home? ===Perform this investigation in fedora3.
If Let's say that you refer to the LV sizes have run out of disk space on your '''f16host'''computer (fedora3), you may notice that need more space on the size of '''lv_root''' (your root system) is quite small compared filesystem, perhaps to the size of '''lv_home'''host more webpages or a larger database or new software. The Virtual Machines that you have created What are stored in your options? Getting a replacement harddrive would probably require reinstallation of the directory pathname <code>/var/lib/libvirt/images/<operating system and backup/code>, and since you are required to make backups and create future VMs (assignments), you will run out restore of space!the data.
On the other hand, you may notice Because we're using LVM though - we can avoid that lv_home is extremely large. ThereforeWe can add a new harddrive (which will serve as a physical volume) to the volume group, we are going and extend the root logical volume to make use LVM management tools to redistribute those logical volume sizesof the new available space.
{{Admon/caution|LV resize is Required!|You '''MUST''' perform the following steps in order to re size lv_home and lv_root logical volumes. Failure to perform this operation will likely cause the user to run out of space in <code>/var/lib/libvirt/images/</code> directory used to hold future Virtual Machine installations (e.g. assignments).}}  '''Perform the following operations to redistribute increase the sizes size of lv_root and lv_home in f16hostfedora3:'''
<u>'''<font>Steps:</font>'''</u>
 
# Make certain you are in your '''f16host''' system.
 
{{Admon/note|Resizing Logical Volumes While Still in Use|There is a problem when trying to resize lv_home while users are currently logged in. Please note and record the following procedure to resize these volumes. You should research these commands and gain an appreciation of why you are performing these sequence of commands.|}}
 
<ol>
<li value="2">'''Log-off all users on the GUI'''. You won't be able to complete this procedure if any users other than "root" are logged in. <br />OR You can go into Runlevel 1 by using the command "init 1" (without the quotes) in the terminal.</li>
<li>Press the keyboard combination '''Ctrl-Alt-F2''' to a switch to a text-based Virtual Terminal. If you are having trouble connecting to a text-based terminal, try the '''Ctrl'''-'''Alt''' keys with another '''function''' key.</li>
<li>Log into your root account (eg. '''username: ''root'' password: ''admin password''''')</li>
<li>Enter the following Linux commands:</li>
</ol>
:: <code>umount /home</code>
:: <code>lvreduce -L 20G -r vg_f16host/lv_home</code>
:: <code>lvextend -l +100%FREE -r vg_f16host/lv_root</code>
:: <code>mount -a</code>
:: <code>logout</code>
 
{{Admon/note|System error messages|You may experience "random" system error messages while you are performing this procedure. You can ignore these messages, but make certain that the above commands have been completed (i.e. "don't panic and press ctrl-c"). You can issue the '''lvs''' command to confirm that lv_root now has more space...|}}
<ol>
<li value="6">Press Run the keyboard combination '''Ctrlfollowing commands and make note of the output:</li> <code>ls /dev/vd* pvs vgs lvs df -Alt-F1''' h</code> <li>Open the fedora3 virtual machine console</li> <li>Go to return to GUI (or similar key-combination with other function key). the hardware details view</li> <li>Log into your accountClick "Add Hardware" and add a new storage device of 2GBs, make sure it's a VirtIO disk.</li> <li>Open a terminal.Go back to the console view</li> <li>Issue Run the same ls command now, what's changed?</li> <li>Now we''vgs'''ll make the new device as a physical volume, '''pvs'''add it to the volume group, and '''extend lv_root:</li> <code>pvcreate /dev/vdb vgextend vg_fedora3 /dev/vdb lvextend -l +100%FREE -r vg_fedora3/lv_root</code> <li>Now rerun the ls/pvs/vgs/lvs''' /df commands to verify new volume information for your f16host.What has changed and what caused those changes?</li> <li>Proceed to Investigation #2.Among the changes, note that your root filesystem is now 2GB bigger - and you have not even rebooted your machine!</li>
</ol>

Navigation menu