Changes

Jump to: navigation, search

OPS235 Lab 5 - CentOS7

1,542 bytes added, 07:59, 2 May 2015
no edit summary
<li>Let's see what happens when we copy data over to '''lv_archive''', and then '''reduce the size of lv_archive'''. Complete the following steps below:
<ol type="a">
<li>Issue the following command:<b><code><span style="color:#3366CC;font-size:1.2em;">cp -R /etc/* /archive </span></code></b> </li>
<li>Shrink the size of '''lv_archive''' to '''1 GB'''. What happens?</li>
<li>If you could not shrink the size of '''lv_archive''', what do you think is the cause for the problem?</li>
===Part 2: Obtaining System Information with Managing LVM Via Command Line===
xLet's say that you have run out of disk space on your '''centos3''' VM, you need more space on the root file-system, perhaps to host more webpages or a larger database or new software. What are your options? Getting a replacement hard-drive would probably require re-installation of the operating system and backup/restore of the data.
Because we're using LVM we can avoid this problem. We can '''add a new hard-drive''' (which will serve as a physical volume) to the volume group, and extend the root logical volume to make use of the new available space.
'''Perform the following operations to increase the size of lv_root in centos3:'''  # xPerform this Part in your '''centos3''' VM.<ol> <li value="2">Run the following commands and make note of the output:</li> <code>ls /dev/vd* pvs vgs lvs df -h</code> <li>Open the centos3 virtual machine console</li> <li>Go to the hardware details view</li> <li>Click "Add Hardware" and add a new storage device of 2GBs, make sure it's a VirtIO disk.</li> <li>Go back to the console view</li> <li>Run the same ls command (performed in step 1), what's changed?</li> <li>Now we'll make the new device as a physical volume, add it to the volume group, and extend lv_root:</li> <code>pvcreate /dev/vdb  vgextend vg_centos3 /dev/vdb  lvextend -L +2G -r vg_centos3/lv_root</code> <li>Now rerun the ls/pvs/vgs/lvs/df commands. What has changed and what caused those changes?</li> <li>Among the changes, note that your root filesystem is now 2GB bigger - and you have not even rebooted your machine!</li></ol>
13,420
edits

Navigation menu