If you can see this check that

  • Javascript is enabled

Essential Unix Administration

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. Remember admin command need sudo.

To reset all the check buttons from a previous attempt click here

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: Ready
 
SUDO working UNTESTED
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: Ready
 
SUDO working UNTESTED
PV NAME UNTESTED
VG NAME UNTESTED

Use lvdisplay 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: Ready
 
SUDO working UNTESTED
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 path to the device name which this link is pointing to?

Absolute device name:

Tests: Ready
 
SUDO working UNTESTED
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: Ready
 
SUDO working UNTESTED
Absolute devname UNTESTED

In order to mount this filesystem at boot time we need to refer to it in the mount table. We could use the /dev/mapper location directly, but that can be messy. Best to refer to it using the partition/device UUID.

USe blkid to find the UUID for the /dev/mapper device identified above.

UUID:

Tests: Ready
 
SUDO working UNTESTED
UUID correct 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: Ready
 
Mount directory UNTESTED

Recall that you discovered the absolute 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: Ready
 
SUDO working UNTESTED
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 which has a name which sounds like it has something to do with swap space.

Enter a number:

Tests: Ready
 
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: Ready
 
process id of rsyslogd UNTESTED

Kill rsyslogd using the kill command. Note it will come back to life almost immediately with a different process id, but you only need to kill it once to complete this question.

Tests: Ready
 
killed syslogd 1+ times 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: Ready
 
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: Ready
 
Env file for rsyslog UNTESTED

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

Tests: Ready
 
new rsyslogd UNTESTED
active UNTESTED

Question 3 Control a service

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

Tests: Ready
 
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: Ready
 
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: Ready
 
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: Ready
 
Service still running UNTESTED
Main PID first child UNTESTED

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

Tests: Ready
 
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: Ready
 
Enabled services UNTESTED

How many enabled units are socket units?

Enter a number:

Tests: Ready
 
Enabled services UNTESTED

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

Tests: Ready
 
Does not run at boot UNTESTED

Centos 7 introPaths | BasicShell | Search
Centos 7 tutorials:intro1 | intro2 | wildcard | permission | pipe | vi | essential | admin | net | SELinux1 | SELinux2 | fwall | DNS | diag | Apache1 | Apache2 | log | Mail
Alma 10 introPaths | BasicShell | Search
Alma 10 tutorials:intro1 | intro2 | wildcard | permission | pipe | vi | essential | admin | net | SELinux1 | SELinux2 | fwall | DNS | diag | Apache1 | Apache2 | log | Mail
Caine 10.0Essentials | Basic | Search | Acquisition | SysIntro | grep | MBR | GPT | FAT | NTFS | FRMeta | FRTools | Browser | Mock Exam
Caine 13.0Essentials | Basic | Search | Acquisition | SysIntro | grep | MBR | GPT | FAT | NTFS | FRMeta | FRTools | Browser | Registry | Mock Exam
Kali 2020-41a | 1b | 1c | 2 | 3 | 4a | 4b | 5 | 6 | 7 | 8a | 8b | 9 | 10
Kali 2024-41a | 1b | 1c | 2 | 3 | 4a | 4b | 5 | 6 | 7 | 8a | 8b | 9 | 10
UsefulPrivacy Policy | Terms and Conditions

Linuxzoo created by Gordon Russell.
@ Copyright 2004-2026 Edinburgh Napier University