Changes

Jump to: navigation, search

OPS245 Lab 2

63 bytes added, 02:00, 25 January 2021
Part 1: Backing Up Virtual Machines
# Use the command <b><code><span style="color:#3366CC;font-size:1.2em;">sudo -i</span></code></b> and enter your password if prompted. You are now root until you use the command <b><code><span style="color:#3366CC;font-size:1.2em;">exit</span></code></b> to return to your normal user account.
# Change to the images directory by issuing the following command: <b><code><span style="color:#3366CC;font-size:1.2em;"> cd /var/lib/libvirt/images/</span></code></b>. Note that you did not need to use sudo, as you are already using elevated permissions.
# Make a compressed backup of your '''centos1.qcow2''', '''centos2.qcow2''', and '''centos3.qcow2''' files to your regular user's home directory by issuing each command (- one at a time(create '''backups''' directory before running these commands):<br><b><code><span style="color:#3366CC;font-size:1.2em;">gzip < centos1.qcow2 > ~YourRegularUsername/backups/centos1.qcow2.gz</span></code></b><br><b><code><span style="color:#3366CC;font-size:1.2em;">gzip < centos2.qcow2 > ~YourRegularUsername/backups/centos2.qcow2.gz</span></code></b><br><b><code><span style="color:#3366CC;font-size:1.2em;">gzip < centos3.qcow2 > ~YourRegularUsername/backups/centos3.qcow2.gz</span></code></b><ul>'''NOTE:''' Make certain to use the redirection signs "<" and ">" properly in the command!</ul>
{{Admon/important |Please be patient|It may look like the command prompt is stuck but it could take a while for gzip to compress an entire operating system. '''NOTE:''' Do NOT press '''&lt;ctrl&gt;c''' to cancel this process. If you do, your archive will become incomplete and your recovery will be corrupt.}}
<ol><li value="57"> Compare the size of the compressed and original files (hint: use '''ls -lh'''). If file is very large (like 15GB), you didn't compress it and you need to remove that file and perform the previous step until you get it right!</li>
<li>Once you are sure you have all three VMs backed up, use the <b><code><span style="color:#3366CC;font-size:1.2em;">exit</span></code></b> command to revert back to your normal user.</li>
<li> Start the '''''centos3''''' VM.</li>
572
edits

Navigation menu