HW 5 - CS 480 M01 Fall 2022
CS 480 M01 Fall 2022 - Homework Assignment #5
Due: Check Canvas please
Assignment:
Points: 105 points total (plus 10 more points for an extra credit)
Each exercise below is to be implemented on your cs480 virtual host.
Every question asked needs to be answered in your assignment report.
For every exercise describe in sufficient detail the whole process and explain what you did to accomplish the task.
Make sure that you list and discuss all important steps made, commands used together with their options, and problems encountered.
- 13 pts: Repositories and Updates
Configure SW Repositories and Install Updates
- use zypper to check / list the configured repositories (showing repositories with their URIs and priorities) , and
remove and add repositories as needed to have them configured as follows (make sure that all names, aliases, and
other options are set exactly as shown in the examples below):
couple of zypper list/remove/add/modify repository commands to accomplish this ...
#|Alias |Name |Enabled|GPG Check|Refresh|Priority|Type |URI |Service
-+-----------+----------------------+-------+---------+-------+--------+------+--------------------------------------------------------------+-------
1|leap154full|openSUSE-Leap15.4-Full| Yes |( p) Yes | Yes | 99 | NONE |nfs://lbc/csvm3_other/opensuse/distribution/leap/15.4/oss |
2|updatesOSS |Leap 15.4 Updates OS | Yes |( p) Yes | Yes | 99 | NONE |nfs://lbc/csvm3_other/opensuse/opensuse-updates/leap/15.4/oss |
or (if refresh was already done and local repo caches built)
#|Alias |Name |Enabled|GPG Check|Refresh|Priority|Type |URI |Service
-+-----------+----------------------+-------+---------+-------+--------+------+--------------------------------------------------------------+-------
1|leap154full|openSUSE-Leap15.4-Full| Yes |(r ) Yes | Yes | 99 |rpm-md|nfs://lbc/csvm3_other/opensuse/distribution/leap/15.4/oss |
2|updatesOSS |Leap 15.4 Updates OS | Yes |(r ) Yes | Yes | 99 |rpm-md|nfs://lbc/csvm3_other/opensuse/opensuse-updates/leap/15.4/oss |
- List the available updates.
Note that zypper should refresh / check for new updates automatically - don't forget the relevant option when adding the repository in the step above.
# zypper list_available_updates_command
Loading repository data...
Reading installed packages...
S | Repository | Name | Current Version | Available Version | Arch
--+----------------------+-----------------------+--------------------+----------------------+-------
v | Leap 15.4 Updates OS | openSUSE-release | 15.4-lp154.153.1 | 15.4-lp154.166.1 | x86_64
v | Leap 15.4 Updates OS | openSUSE-release-dvd | 15.4-lp154.153.1 | 15.4-lp154.166.1 | x86_64
v | Leap 15.4 Updates OS | openSUSE-signkey-cert | 20210302-lp154.1.2 | 20220613-lp154.2.3.1 | x86_64
- Install the updates. (This step should install ~4 updates and will be done quickly.)
- Check if the reboot is needed and reboot the host if needed.
- List the available updates again, check configured repositories, and ...
- Remove the repo-sle-debug-update repository , and ...
- Replace the other 3 http://download.opensuse.org/ repositories with the ones at lbc.
Once done and refreshed your repositories should be configured as follows:
#|Alias |Name |Enabled|GPG Check|Refresh|Priority|Type |URI | Service
-+-------------------------------+--------------------------------------------------+-------+---------+-------+--------+------+--------------------------------------------------------------------------+--------
1|leap154full |openSUSE-Leap15.4-Full | Yes |(r ) Yes | Yes | 99 |rpm-md|nfs://lbc/csvm3_other/opensuse/distribution/leap/15.4/oss |
2|repo-backports-debug-update-lbc|Updates debuginfo packages from openSUSE Backports| Yes |(r ) Yes | Yes | 99 |rpm-md|nfs://lbc/csvm3_other/opensuse/opensuse-updates/leap/15.4/backports_debug/|
3|repo-backports-update-lbc |Updates of openSUSE Backports | Yes |(r ) Yes | Yes | 99 |rpm-md|nfs://lbc/csvm3_other/opensuse/opensuse-updates/leap/15.4/backports/ |
4|repo-sle-update-lbc |Updates from SUSE Linux Enterprise 15 | Yes |(r ) Yes | Yes | 99 |rpm-md|nfs://lbc/csvm3_other/opensuse/opensuse-updates/leap/15.4/sle |
5|updatesOSS |Leap 15.4 Updates OS | Yes |(r ) Yes | Yes | 99 |rpm-md|nfs://lbc/csvm3_other/opensuse/opensuse-updates/leap/15.4/oss |
- List the available updates again.
# zypper list_available_updates_command
Loading repository data...
Reading installed packages...
S | Repository | Name | Current Version | Available Version | Arch
--+---------------------------------------+-----------------------------+----------------------------------------+------------------------------------------+-------
v | Updates from SUSE Linux Enterprise 15 | aaa_base | 84.87+git20180409.04c9dae-3.57.1 | 84.87+git20180409.04c9dae-150200.8.3.1 | x86_64
v | Updates from SUSE Linux Enterprise 15 | aaa_base-extras | 84.87+git20180409.04c9dae-3.57.1 | 84.87+git20180409.04c9dae-150200.8.3.1 | x86_64
v | Updates from SUSE Linux Enterprise 15 | audit | 3.0.6-150400.2.4 | 3.0.6-150400.4.3.1 | x86_64
v | Updates from SUSE Linux Enterprise 15 | augeas | 1.12.0-150400.1.5 | 1.12.0-150400.3.3.6 | x86_64
v | Updates from SUSE Linux Enterprise 15 | augeas-lenses | 1.12.0-150400.1.5 | 1.12.0-150400.3.3.6 | x86_64
... ~250 more lines ...
- Install the updates. (This step should install ~260 updates and will take couple of minutes to finish.)
- Check if the reboot is needed and reboot the host if necessary.
In you report list all commands that you ran to accomplish the tasks above.
- 4 points: lshw, udisksctl, and kernel sources Check if lshw and udisksctl are already installed on your system. If they are not installed yet then install them using zypper.
Use zypper to also install kernel-source and kernel-devel packages (plus all packages that these two depend on).
- 20 points : Read all man pages listed below (from sections 1 , 5, or 8; try the commands, look into the files, ... while reading) and in a short paragraph (3-5 lines per man page in your words - do not just copy parts of the man page) describe what is each of them for. Also, for the commands choose an extra option (not the help nor version options) and in few more lines describe situations in which you would use the selected option. In case of the commands with long man pages and many options choose at least two extra options and describe situations in which you would use them.
- df
- du
- fdisk
- fsck
- lsblk
- lshw
- mke2fs [-j] - try it on /extra/sep_fs
- mkfs
- mkfs.ext4
- mount - try it on /extra/sep_fs
- parted
- partprobe
- tune2fs
- udisksctl
- umount - try it on /extra/sep_fs
- 8 pts: rsyslog
- Investigate the default rsyslog configuration on your system :
Describe in detail what files are used to configure it, what is being logged through rsyslog and how.
What would you change, why ?
- Implement one of your suggestions : modify the config file(s) and make sure that it works as expected.
(it may be a good idea to back up the original file(s) first:
cp -p /etc/somefile.conf /etc/somefile.conf.orig)
- 6 pts: systemd journal
Modify configuration of your system to
- Keep old journal entries after reboots.
- Keep at most 100 messages per minute produced by a service.
(If a service generated 10,000 messages in a minute then for every minute only the first 100 are
kept and the rest is dropped / not logged).
- 14 points : Disk Partitioning
Three new 10GB disks were added to your virtual machine.
Partition (gpt not dos) one of these disks (sdb is assumed below) and create new file systems as needed and as outlined below.
Using only the commands listed above (under the man pages exercise) create two new partitions
(you may NOT use
yast/yast2
nor gdisk
nor gparted
).
The first is to be 4GB large (new sdb1) and it will have EXT4 file system.
The other partition (sdb2) will occupy the rest of the disk and will have EXT2 file system.
Mount the partitions under /extra/cs480 (4GB) and /extra/lab5.
Some of the steps needed for this exercise (not necessarily in this order) may be:
- 10 points : LVM Use second new disk (sdc below) that was attached to your virtual machine and
- Initialize LVM physical volume on it (/dev/sdc)
- Create new LVM volume group CS480VG
- Create two logical volumes in CS480VG named cs480vol1 and cs480vol2 both 2 GiB large
- Create EXT4 filesystems on both cs480vol1 and cs480vol2, and mount them under /extra/cs480vol1 and /extra/cs480vol2
- Make sure that both cs480vol1 and cs480vol2 will be mounted the same after the next reboot as well.
- Run
datevgdisplay -v CS480VGdf -hl
and send the output into /root/lab5task7.txt file.
Submit the file as part of your tar.bz file.
- 10 points : Grow / maximize cs480vol2 Use the last new disk (sdd perhaps) and
- Initialize LVM physical volume on it (/dev/sdd)
- Add /dev/sdd to CS480VG
- Add all CS480VG available space into /cs480vol2 (while leaving cs480vol1 as is).
- Make sure that the filesystem is resized and mounted as well (the size should be close to 18GiB)
- Run
datevgdisplay -v CS480VGdf -hl
and send the output into /root/lab5task8.txt file. Submit the file as part of your tar.bz file.
- Describe the steps and the whole process in your report. Discuss the choices you made.
- Extracredit 10 points : Superblock
- What is superblock and what is it used for?
- Find / look up the definition of the ext4 superblock structure in the kernel header files on your virtual cs480 computer
and
- Count the number of fields in the ext4_super_block structure. How many are there?
- Choose 10 fields in the ext4_super_block structure and discuss what each of the fields represents.
You will need to have kernel sources installed already - one of the tasks/exercises above.
Kernel source files will be installed in /usr/src/linux
. Search the header files to find the needed C structure.
Submitted files, overall quality, length, and feedback:
- 5 points : Submit all relevant files you modified during the lab (into the /home/CS480/yourcsloginname directory as part of the tar.bz2 file) . Exactly two files need to be submitted: One file being your report in PDF is to be submitted on Canvas. The other file is the tar.bz2 file containing everything else and it gets submitted into /home/CS480 (Pack the files together using tar and bzip2, and copy them using scp from your computer into your cs account )
- 10 points : Submit your report as a PDF document through learn.nmsu.edu and all supporting documents, programs, and execution transcripts as part of the tar.bz2 file in your directory under /home/CS480. The report has to contain answers to all questions above, and for the practical problems on your computer describe in detail choices you made, difficulties you encountered, and how did you deal with them.
- 5 points : Feedback:In the last paragraph of your report estimate how much time you spent on this assignment. Describe what was hard, easy, interesting, boring or confusing.
Please remember the submission requirements:
Two files need to be submitted for every assignment :
- The first file is your typed report .
It has to be submitted through http://learn.nmsu.edu as one file / document and it has to be in the PDF format.
No other format will be accepted. The name of the file has to contain your name and assignment/lab number separated by "_" (If your name is John Smith then the name of the document submitted for this assignment needs to be John_Smith_HW05.pdf).
- The second file to be submitted into your directory under /home/CS480 directory has to be a tar.bz2 file that contains all other files related to the assignment.
It will contain all relevant files that you modified for the assignment. Everything that was done to finish the lab, modify your system, write, run and verify submitted programs and scripts used needs to be included in the submitted tar.bz2 file. That includes all your system configuration files modified for the lab/assignment as well as programs and scripts written (including complete source code, supporting shell scripts, test data input files, ...). The name of the tar.bz2 file has to contain your CS login name and the lab number separated by "_" (if your cs login name was jsmith then the file's name for this assignment will be jsmith_Lab05.tar.bz2 ). The files submitted as part of the tar.bz2 file have to be exact copies as found on your cs480 lab system.
If you want to correct or add something to already submitted assignment than you need to do so before the deadline and resubmit the whole report again and also resubmit your new tar.bz2 file .
Please remember that late submissions are penalized 20% / day and NO submissions that are late 3 or more days will be accepted. You can be late at most 2 days to receive any points.