Changes

Jump to: navigation, search

OPS235 Lab 5

320 bytes removed, 17:37, 23 June 2016
no edit summary
=== Part 1: Hard Disk Space Utilities===
Another essential duty of a Linux system administrator is to anticipate problems and take preventative measures to avoid computer system problems <u>before</u> that occur. An example could be to periodically monitor hard disk space for potential low availability in order to make adjustments before it impacts on system performance.
Therefore, we are going to learn in this section how to monitor disk space activity to help take corrective action before problems can occur.
# Issue the command: <b><code><span style="color:#3366CC;font-size:1.2em;">df -h</span></code></b>
# Note the disk space usage for the '''/''' and '''/home''' partitions.
# If a partition is running out of available space, the Linux System Administrator can reallocate space among partitions or add another disk and grow the file system (like you did in a previous investigation). The administrator also can investigate the cause of low disk space. Two examples immediately come to mind: excessive use of space from users, and potential penetration from hackers.# To investigate excessive disk usage by regular users, you can obtain a total amount of disk usage for that user by issuing the command:<br><b><code><span style="color:#3366CC;font-size:1.2em;">du -hsa .</span></code></b># To provided a more detailed list of usage (file-by-file), issue the command:<br><b><code><span style="color:#3366CC;font-size:1.2em;">du -ha . | more</span></code></b>
# If there is a recurring space usage problem with regular users, the Linux system administrator can impose quotas (caps on disk usage). This method is not taught in this course.
# The methods to monitor potential penetration to a Linux system are too numerous, and are taught in other courses (for example: SEC520). One method of monitoring potential penetration is use the command:<br><b>find -P / -size +100000k</b>
#Give execute permissions and run this shell script. This script is supposed to notify the root user by email if there are any potential partition size issues.
#Issue the follow command: <b><code><span style="color:#3366CC;font-size:1.2em;">mail</span></code></b>. Check to see if there are any mail messages. If there are mail messages, they do not relate to this shell script execution. Remove all mail messages by typing d immediately followed by a mail message number range (eg. to remove all 5 messages, type '''d1-5''' and then press '''ENTER''' and enter '''q''' to exit the mail application).
#Edit the monitor-disk-space.bash shell script, and set the '''ALERT''' value from 90 to '''4030''', save your editing session, and re-run this shell script.
#Run the '''mail''' command. Do you have a mail message? Enter the mail message number to view the message. If there is a message, what is the purpose of this message?
# Exit from the mail command.
=INVESTIGATION 2: MANAGING HARD DISK SPACE USING LVM=
Monitoring and ensuring adequate space for a Linux file-system is considered to be a critical task for any system administrator. An application called '''LVM''' is a very useful tool for Linux system administrators to easily manage file systems - , in some cases, even when the computer system is running!
'''LVM''' ('''Logical Volume Management''') is used to manage hard disk drives / partitions for Linux and Unix systems. LVM provides more flexibility than just partitioning hard disks. '''Volume Groups''' are areas used to define '''Physical Volumes''' (i.e. hard disks, disk partitions, or other forms of storage devices). '''Logical Volumes''' are then used to relate directories (mount points) to a specific physical volume or for a "range" or "span" of physical volumes.
# Make certain that you are logged in as '''root'''.
#Issue the command: <b><code><span style="color:#3366CC;font-size:1.2em;">ls /dev/vd*</span></code></b><br><br>'''NOTE:''' If nothing displays, issue the command: '''ls /dev/sd*''' and use that device pathname '''/dev/sda''' instead.<br><br>
# Issue the following command to install the '''ssm''' command: <br><b><code><span style="color:#3366CC;font-size:1.2em;">yum install system-storage-manager</span></code></b>
# Issue the command: <b><code><span style="color:#3366CC;font-size:1.2em;">ssm list</span></code></b>. Take a few moments to note the volume group, physical volume and logical volume sections of the command output.
# Compare this output from the ssm command with these other lvm commands: <b><code><span style="color:#3366CC;font-size:1.2em;">lvs</span></code></b>, <b><code><span style="color:#3366CC;font-size:1.2em;">pvs</span></code></b>, and <b><code><span style="color:#3366CC;font-size:1.2em;">vgs</span></code></b>. Which method do you prefer to use?
13,420
edits

Navigation menu