Changes

Jump to: navigation, search

OPS245 Lab 5

164 bytes added, 16:41, 7 February 2021
m
Part 3: Manually & Automatically Mount Partitions: - Moving away from using root for everything.
# Perform this part in your '''centos2''' VM.
# Issue the following command to create a mount-point (directory to connect /dev/dva3 partition to):<br><b><code><span style="color:#3366CC;font-size:1.2em;">sudo mkdir /archive</span></code></b># Issue the following command to mount the partition:<br><b><code><span style="color:#3366CC;font-size:1.2em;">sudo mount -t ext4 /dev/centos_centos2/archive /archive</span></code></b>
# Use the '''ls''' command to view the contents of the /archive directory. What do you see?
# Issue the '''mount''' command (without arguments) to confirm it has been mounted.
# Unmount the '''/archive''' directory by issuing the following commmand: <b><code><span style="color:#3366CC;font-size:1.2em;">sudo umount /archive</span></code></b># Issue the '''mount''' command (without arguments) to confirm it has been mountedunmounted.
<ol><li value="8">View the contents of the file-system table '''/etc/fstab''' by issuing the following command:<br><b><code><span style="color:#3366CC;font-size:1.2em;">cat /etc/fstab</span></code></b></li>
<li>Issue the following command use <b><code><span style="color:#3366CC;font-size:1.2em;">sudo vi /etc/fstab</span></code></b> to add an entry to automatically mount the /archive directory upon bootup:<br><b><code><span style="color:#3366CC;font-size:1.2em;">sudo echo "/dev/centos_centos2/archive /archive ext4 defaults 1 2" >> /etc/fstab</span></code></b>::Note: do not alter any of the lines that are already in that file.</li><li>'''Reboot''' your centos2 VM so see if Issue the /archive directory is automatically mounted.command <brb><brcode>'''Note<span style="color:''' You could have also issued the command#3366CC;font-size: '''1.2em;">sudo mount -a''' to <u/span></code>automatically</ub> mount to see if the file-systems contained entry in the '''/etc/fstab''' file without booting the VM (good for testing works correctly. If there are any errors you must correct them before trying a reboot)rebooting your machine.<br/li><brli>Reboot the machine and make sure the '''/archive''' directory is automatically mounted when the machine boots.</li>
</ol>
932
edits

Navigation menu