Linux/Unix Systems Exam - CP 211

THE UNIVERSITY OF DODOMA
COLLEGE OF INFORMATICS AND VIRTUAL EDUCATION
DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING

UNDERGRADUATE UNIVERSITY EXAMINATIONS
FIRST SEMESTER 2019/2020

CS 214: UNIX/LINUX SYSTEMS ADMINISTRATION AND MANAGEMENT

Date: 17th February, 2020
Time Allocated: 3 Hours
Start: 15:30PM
End: 18:30PM


Instructions:

  1. This question paper consists of six questions.
  2. Each question carries twenty marks.
  3. Answer any five questions.
  4. All University of Dodoma examination regulations apply.

Question One

Choose the most correct answer (2 Marks Each)

i. One of the following features describe an open source software correctly
A. Free to download
B. Available in the internet
C. Users modify and share source code under same license
D. You can use and modify source code without license

ii. How do you find out information about your identity, including the names of the groups you are in?
A. echo $UI
B. id
C. cat /etc/passwd
D. cat /etc/groups

iii. How do you see hidden files in your home directory?
A. ls -h
B. ls -la
C. ls -hn
D. ls -R

iv. How would you display running httpd process?
A. ps -C httpd
B. ps -d httpd
C. ps -r httpd
D. ps -D httpd

v. How would you find out what your current login shell is?
A. cat /etc/shell
B. cat /etc/current/shell
C. ps | grep sshd
D. echo $$$HELL

vi. How would you turn on the sticky bit on the directory /tmp?
A. chmod u+s /tmp
B. chmod +st /tmp
C. chmod a+s /tmp
D. chmod o+t /temp

vii. Which of the following differentiate UNIX from Linux OS?
A. Multitasking
B. Licensing scheme
C. Multi-user
D. GNU

viii. What symbol is used to show that ACLs have been set on a file?
A. +
B. @
C. $
D. >

ix. Which signal number corresponds with the SIGSTOP signal?
A. 1
B. 19
C. 9
D. 18

x. What is the use of sticky bit in Linux?
A. Improve performance
B. Prevent accidental deletion
C. Set delete permission to all users
D. Isolate user files for each user


Question Two

Match item in LIST A with the corresponding correct item in LIST B. Write the letter of the correct item in LIST B against the corresponding number in LIST A. (2 Marks Each)

LIST ALIST B
i. fdisk -1A. Adjust process priority
ii. inodeB. Output of a command is an input to another command
iii. /binC. Parent-child process relationship
iv. /etcD. Is a parent process
v. ZombieE. Display drive partitions and size
vi. TopF. Shows the top command
vii. NiceG. Store files metadata
viii. pstree -GH. Shows the directory tree
ix. pipingI. Belong to defunctional state
x. redirectionJ. Sent the output to STDOUT
K. Can display busy processes
L. Adjust process parent
M. User configuration directory
N. System configuration files
O. Directory for root files
P. Show logical volume size
Q. Output of a command not sent to default output device
R. Displays G directory
T. Stores executable files

Question Three

(a) Briefly describe how can one add a user with a username= user1 without using useradd command. (10 Marks)

(b) Name any 3 files which are automatically created inside any user’s home directory when a user is added. (5 Marks)

(c) How can you give a normal user all the root level privileges? (2.5 Marks)

(d) Write short Name any 3 groups of which root is a member by default. (2.5 Marks)


Question Four

(a) What happens when you mount two file systems on the same mount point? (2 Marks)

(b) Is it possible to have free storage space but still cannot add any new data in filesystem? Why? (3 Marks)

(c) An ext4 filesystem was created on a USB memory stick, attached to /dev/sda. Figure 1 shows part of the contents of superblock.

FieldValue
Inode count:971290
Block count:3908091
Reserved block count:188404
Free blocks:3804437
Free inodes:97269
First block:0
Block size:4096
Fragment size:4096
Reserved GDT blocks:954
Blocks per group:32768
Fragments per group:22768
Inodes per group:8144
Inode blocks per group:
First block group size:16
Filesystem created:Wed Aug 23 11:20:00 2017
Last mount time:n/a
Last write time:Wed Aug 23 11:20:00 2017
Mount count:0
Maximum mount count:-1
Last checked:Wed Aug 23 11:20:00 2017
Check interval:0 (times)
Lifetime writes:132 MB
Reserved blocks uid:0 (user root)
Reserved blocks gid:0 (group root)
First inodes:11
Inode size:256

Figure 1

From Figure 1:

i. What command was used to dump the content of superblock? (1 Mark)
ii. Calculate the size of the USB memory stick. (2 Marks)
iii. Defining what block group is, and calculate the number of block groups the filesystem has. (3 Marks)
iv. Defining what inode is, and calculate the maximum number of inodes in a block group. (3 Marks)
v. Calculate the size of inode table in each block group. (3 Marks)
vi. If the filesystem has sparse_super feature, indicate which blocks contain the redundant copies of the superblock. (3 Marks)


Question Five

(a) Explain process management system calls. (5 Marks)

(b) With the aid of an example briefly describe cron job. (5 Marks)

(c) Write commands to perform the following: (10 Marks)

Create a user named CS214; create a file named HIS; create folder named CSE and IST, add three files in CSE namely: CS, CIS, and SE, setuid permission of HIS, setgid of folder CSE, and set sticky bit of folder IST.


Question Six

(a) What is the difference between? (1 Mark Each)

i. RAID 0+1 and RAID 1+0.
ii. RAID 5 and RAID 6.

(b) Write a command to build a RAID 5 array from three whole-disk partitions (/dev/sdb1, /dev/sdc1, /dev/sdd1). (2 Marks)

(c) What command is used to create an ext2 filesystem with block size of 1KB? (2 Marks)

(d) A Linux box was configured with an ext2 filesystem. Filesystem has to be changed to ext3. If you were the system administrator, what command(s) would you use to convert an ext2 filesystem to ext3? (3 Marks)

(e) Most filesystems create a lost+found directory at the root of each filesystem. What is the purpose of the mentioned directory? (2 Marks)

(f) Show how you can make mounts of two partitions, 250MB partition on /home/small and 500MB partition on /home/big, permanent. (2 Marks)

(g) Most filesystem implementations define seven types of files. The first character of the ls output encodes the file type. List all seven types of files with their corresponding symbols encoded by ls command, command used to create the file type and command used to remove the file, in tabular format as shown in table 1. (7 Marks)


END OF EXAMINATION PAPER