If you can see this check that

next section prev section up prev page next page

Essential Admin


Essential Unix Administration

User:
Password:

We look at some of the commands that the User Administrator needs. In this tutorial you will encounter a number of Linux commands that you may not have seen before, use the man command on your system to find out more about any Linux command that you are unsure of.

Question 1: Partitions and LVM

Use sfdisk with block units and find out the partitions which exist in /dev/sda. How many blocks are in the first partition?

Enter a number:

Tests - not attempted
Block size UNTESTED

Use the pvdisplay command of LVM to discover what physical volume (i.e. which partition) is being managed by LVM. What is the partition being used (PV Name) and what is the volume group name (VG Name)?

PV Name:
VG Name:

Tests - not attempted
PV NAME UNTESTED
VG NAME UNTESTED

Use vgdisplay to discover information about the VG Name found in the previous question. What is the first LV Path which is using the volume group discovered in the previous question?

LV Path:

Tests - not attempted
VG NAME UNTESTED

Using the path discovered in the previous question, look at this path in the /dev directory using a long listing ls command. Assuming this is in fact a soft link, what is the ABSOLUTE device name which this link is pointing to?

Absolute device name:

Tests - not attempted
Absolute devname UNTESTED

For mounting this logical volume, the current method is NOT to use the volume name, or even the device it points to. Instead the device mapper is used, which can support different layers (such as encryption on top of something else). This can be found in /dev/mapper.

Look in /dev/mapper, and find the soft link which points to the device file identified in the previous question. What is the relative name of this link? So if the link was /dev/mapper/gordon, the answer wanted here is "gordon".

Mapper link name:

Tests - not attempted
Absolute devname UNTESTED

Look in the fstab mount table. Find the line which mounts this partition via the mapper device. Where is this partition mounted?

Mount directory:

Tests - not attempted
Mount directory UNTESTED

One can also mount things using the filesystem block id (which is the UUID shown in fstab). What block id could you use instead of the mapper mount in this case? It is in a format like ffffff-ffff-fffff-fffff-ffffffffff.

block id for mapper filesystem:

Tests - not attempted
Block id UNTESTED

Recall that you discovered the device file in /dev which the LVM mapper entry was soft linked to. What was the major and minor number of this device?

Major number:
Minor number:

Tests - not attempted
Device major number UNTESTED
Device minor number UNTESTED

Somewhere in the /proc filesystem there is a file which tells you how much swap space has been allocated to the computer. Find that file and then find out how big in bytes the swap space is. Hint: the information that you require is located within the /proc directory within a file .

Enter a number:

Tests - not attempted
Swap space UNTESTED

Question 2: Processes and Services

What is the process id of rsyslogd? Hint: remember the 'ps aux' command?

Enter a number:

Tests - not attempted
process id of rsyslogd UNTESTED

Kill rsyslogd using the kill command.

Tests - not attempted
kill syslogd UNTESTED

Using systemctl, get the status of the rsyslog service. What is the full path to the systemd configuration file which controls the rsyslog serice?

Systemd file:

Tests - not attempted
Systemd config file for rsyslog UNTESTED

Look at this configuration file. Find the line which configures the environmental variables of rsyslog (EnvironmentFile). Ignoring the "=" or the "=-" if it exists, what is the environment file for this service?

Config file:

Tests - not attempted
Env file for rsyslog UNTESTED

Restart the rsyslogd services using systemctl. Confirm it is running using the status option.

Tests - not attempted
restart rsyslogd UNTESTED

Question 3: Control a service

Start the database. This is called mariadb. This may take a few seconds.

Tests - not attempted
Start a service UNTESTED

Using systemctl, discover the process id (PID) for the main process. Note, mariadb has many processes, so make sure you select the Main PID.

Main PID:

Tests - not attempted
Service still running UNTESTED
Main PID UNTESTED

What user is the owner of this process? Use the "ps" command with the appropriate flags.

Main PID owner:

Tests - not attempted
Service still running UNTESTED
Main PID owner UNTESTED

If the main pid is the parent of the database, what is the PID of the first child of this parent pid? So if you have the process name for this PID, then pstree might help here.

PID of First Child:

Tests - not attempted
Service still running UNTESTED
Main PID first child UNTESTED

Set the mariadb to run next time you boot your virtual machine.

Tests - not attempted
Runs at boot UNTESTED

Systemctl has an option "list-unit-files", which says which things are enabled for running at boot. How many units are enabled?

Enter a number:

Tests - not attempted
Enabled services UNTESTED

How many enabled units are socket units?

Enter a number:

Tests - not attempted
Enabled services UNTESTED

Now set the mariadb so that it DOES NOT run next time you boot your virtual machine.

Tests - not attempted
Does not run at boot UNTESTED


Linux tutorials: intro1 intro2 wildcard permission pipe vi essential admin net fwall DNS diag Apache1 Apache2
Caine 6.0: Essentials | Basic | Search | SysIntro | 5a | 5b | 5c | 6 | 7 | 8a | 8b | WebBrowserA | WebBrowserB | Registry | Browser
Digital Investigation: Editing | Email | Logs | Strength
Kali: 1a | 1b | 1c | 2 | 3 | 4a | 4b | 5 | 6 | 7a | 8a | 8b | 9 | 10 |
Useful: Quiz | Forums | Privacy Policy | Terms and Conditions
Site Links:XMLZoo ActiveSQL ProgZoo SQLZoo

Copyright @ 2004-2014 Gordon Russell. All rights reserved.