Changes

Jump to: navigation, search

OPS245 Lab 1

105 bytes added, 22:15, 22 January 2021
Part 1: Using VMware Workstation Pro to Create a New Virtual Machine (VM)
[[Image:Format_ExFAT.png|thumb|right|250px|'''Format drive window''' in order to format your new SSD as '''exFAT''' ('''Windows''')]]
{{Admon/caution|If you are using an external drive: FORMAT YOUR External SSD AS exFAT|'''You ''must'' format your external drive as exFAT.'''<br>By default, most external drives will be formatted for NTFS. <u>'''NTFS-formatted drives will cause issues in this course!'''</u> When you plug your drive in, open My Computer, right-click on the new drive, and select ''Format...''.<br />If you are storing the vmdk file on your machine's internal storage, this is not necessary.}}
{{Admon/important|Confirm External SSD Device is Recognized as a Drive in Windows Explorer|It is essential that your Windows machine recognizes your SSD device with a drive letter on your Windows machine. You may experience problems if you are using the Kingston SSD. If so, then run '''diskmgmt.msc''' in order to create a volume and format your disk1.}}
{{Admon/caution|ATTENTION| PRIOR to proceeding, you MUST perform the following step <u>BEFORE</u> starting your Host VM in order to allow your Host VM to run correctly!!!<br>Students that do not follow these procedures exactly will run in to problems when trying to perform lab2 !!! You have been warned!!!.}}
<br><br>
# <ol><li value="27">Make certain that your Host VM is <u>'''NOT'''</u> powered on before proceeding!</li># <li>In the right-hand window (below "c7host"), and below ''"Power on this virtual machine"'', click the link called '''Edit virtual machine settings'''.</li># <li><span style="background-color:yellow">In this setup dialog box, click the '''options''' tab and then click the '''Advanced''' option at the bottom of the list. On the right-hand side, under ''Firmware Type'', '''select the radio button for UEFI'''. Then click on the '''Hardware''' tab, and then select the '''CD/DVD (IDE)''' device and select in the right-side select the radio button for the '''use ISO Image file'''. Click the '''Browse''' button and specify the path of your downloaded CentOS 7 Full install DVD (most likely file is contained in your Downloads folder). Click '''Processors''', and click the check-box to <u>enable</u> '''Virtual Intel VT-X/EPT or AMD-V/RVI'''. When finished, click on the '''OK''' button</span>.</li># <li>You will return to your c7host VM. Click '''Power on this virtual machine''' icon near the top to boot your c7host VM to start your c7host VM, and proceed to Part 2.</li></ol>
===Part 2: Install CentOS on your Newly-Created VM ===
<br>
echo "SYSTEM REPORT" > /root/report.txt<br>
echo "Date: $(date +'%A %B %d, %Y (%HI:%M:%p)')" >> /root/report.txt<br>
echo >> /root/report.txt<br>
</code>
<br>
<ol><li value="813">Save and run the bash shell script (remember to use sudo to run it as root). View the contents of the file called '''report.txt''' that was generated (I hope you are using the up arrow key to issue previously issued commands in order to save time!). Notice how the redirection symbol &gt; is used at the beginning of the report, and then the other redirection symbol &gt;&gt; is used to help "grow" the report with the other content.</li><li>The only remaining content of the report would be the system information. We can use a shell scripting trick called "command substitution" $( .. ) in order place results from an command to be used by another command (like echo). Re-edit the shell script and add the following code at the bottom of the shell script file:</li></ol>
<br>
<code style="color:#3366CC;font-family:courier;font-size:.9em;font-weight:bold;">
</code>
<br>
<ol><li value="1015">Save, run the script, and view the ''report.txt'' contents (are you using tip that was given to save time?).</li><li>Edit the shell script and include output from the <b><code><span style="color:#3366CC;font-size:1.2em;">ps aux</span></code></b> and <b><code><span style="color:#3366CC;font-size:1.2em;">ip address show</span></code></b> commands (with appropriate titles). Remember to redirect that output to add to the bottom of the file!</li><li>Save, run and confirm that the shell script is working correctly.</li><li>What would be the use of keeping this shell script as a Linux system administrator?</li></ol><ol><li value="1419">Here are some more "complex" Bash Shell scripts, that perform the same task. Although you are not required to understand some of these other tricks, it is recommended that you view the contents of the scripts and save them for future consideration or examples.</li><li>The <b><code>wget</code></b> command can be used to quickly download files from the Internet. Issue the following command:<br><b><code><span style="pointer-events: none;cursor: default;color:#3366CC;font-size:1.2em;">wget https://ict.senecacollege.ca/~ops235peter.callaghan/ops245/labs/text-report.bash</span></code></b></li><li>Verify that the file '''text-report.bash''' was downloaded to your current directory.</li><li>Assign read and execute permissions for this file by issuing the command: <b><code><span style="color:#3366CC;font-size:1.2em;">chmod u+rx text-report.bash</span></code></b></li><li>Run this Bash Shell script by issuing the command: <b><code><span style="color:#3366CC;font-size:1.2em;">./text-report.bash</span></code></b></li><li>Check to see if it created a report in your current directory. What is the purpose of the report?</li><li>Use the <b>vi</b> text editor to view the contents of the file <b>text-report.bash</b>. Can you understand how this script works?<br><br></li><li>Use the <b><code>wget</code></b> command to download, study, and run the following shell scripts on-line:<br><b><code><span style=" pointer-events:none;cursor:default;color:#3366CC;font-size:1.2em;">https://ict.senecacollege.ca/~ops235/labs/report.bash<br>&nbsp;https://ict.senecacollege.ca/~ops235/labs/report3.bash</span></code></b><br><br></li><li>Try to understand what these Bash Shell scripts do.</li><li>You have completed lab1. Proceed to Completing The Lab, and follow the instructions for "lab sign-off".</li></ol>
'''Answer Investigation 3 observations (all parts and questions) in your lab log book.'''

Navigation menu