Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

C330 Lesson 5 Slides

Download as pdf or txt
Download as pdf or txt
You are on page 1of 51

Official (Closed) \ Sensitive Normal

Build a Secure and Efficient


Linux Infrastructure

Linux Administration and Virtualisation


Official (Closed) \ Sensitive Normal

LPP Academic Week 5 - Block I


Access Linux File Systems
Official (Closed) \ Sensitive Normal

Block Devices (recap from C227)

• Block devices are non-volatile mass storage devices.

• A block device is a file the provides low-level access


to storage devices

• Examples of storage devices are SSDs, SD cards,


Virtual devices, hard disks, CD-ROMs, floppy disks,
USB
Official (Closed) \ Sensitive Normal

Disk Partitions (recap from C227)

• Disk drives are divided into partitions.


• We can allocate all the space in a disk into a single partition or
create a few partitions within a single disk.
• We can format partitions with varying block sizes, depending
on the usage, e.g. if your data is in a large number of small files
(less than 1k) and your partition uses 4k sized blocks, you are
wasting 3k for every file.
Official (Closed) \ Sensitive Normal

The /dev directory

⚫ In a Linux System, the /dev directory contains block devices


attached to the system and virtual devices provided by the kernel

⚫ Devices in the /dev/ directory and subdirectories are defined as


either character (providing only a serial stream of input and output,
for example, mouse or keyboard) or block(accessible randomly, for
example, a hard drive or a diskette drive).

File Description
/dev/hda The master device on the primary IDE channel.

/dev/hdb The slave device on the primary IDE channel.


/dev/tty0 The first virtual console.
/dev/pts/1 The pseudo terminal 1
/dev/sda The first device on the primary SCSI or SATA channel.

/dev/lp0 The first parallel port.


/dev/ttyS0 Serial port.
Official (Closed) \ Sensitive Normal

Partitioning Scheme (recap from C227)


• In Linux there are two types of partitioning schemes:
• Master Boot Record (MBR) MBR • GUID Partition Table (GPT) disks support
disks support maximum 4 primary up to 128 partitions and keeps a backup of
partitions. the partition table at the end of the disk.

• Information about hard disk and • It can be used as a storage volume on all
partition table is stored in MBR, which x64-based platforms
is the first sector of the hard disk.
• It uses Unified Extensible Firmware
• Typically, the /boot partition which Interface (UEFI) and GPT is the standard
contains the Linux Kernel is in a for laying out partition tables on physical
primary partition. disks

• Uses 32-bits for storing logical block • Uses 64-bits for storing logical block
addresses addresses

https://en.wikipedia.org/wiki/Master_boot_record https://en.wikipedia.org/wiki/GUID_Partition_Table
Official (Closed) \ Sensitive Normal

Limitations in MBR Partitioning

• Limitations of MBR
• the maximum number of
partitions is four
• Disk partitions are
limited to 2TB

How to overcome it?


• one of the primary partitions
can be an extended partition.
• This extends the limit to at
most 15 logical partitions in
total on a SCSI disk
Official (Closed) \ Sensitive Normal

Extended Partitions
⚫ An extended partition is a partition that can be divided into logical drives
⚫ Partitions created within extended partitions are called logical partitions
⚫ Extended partitions are not formatted with file systems, but logical
partitions are formatted with file systems
Official (Closed) \ Sensitive Normal

Comparison of MBR and GPT partitions

• Partition names usually follow the disk names

• /dev/vdb1 for the first partition in first virtual disk,


• /dev/vdb2 for the second partition in first virtual
disk.
Official (Closed) \ Sensitive Normal

File Systems (Recap from C227 module)


• File System, is a method and data structure used by operating system
to control how the data is stored and retrieved in block devices and
partitions.
• A file system indexes all the data information on a storage devices
such as the size of the files, attributes, location and hierarch in the
directory.
• It specifies the path to a file via the structure of the directories with a
format

OS File Systems

Windows FAT, NTFS, exFAT

macOS HFS, APFS, HFS+

Linux xfs, ext2, ext3, ext4, JFS, Brrfs


Official (Closed) \ Sensitive Normal

Types of Linux File Systems


• Linux allows to create different partition types, and each partition must be
formatted based on the file system they will use.
• The following is a brief description of the different file systems available,
and how they can be utilized.

Linux File Systems Description

Extents File System (XFS) Default file system for RHEL, highly scalable, high performance
and 64-bit journaling file system that supports very large file and
file system on a single host
Extended File System (ext4) For managing local file files. Improved read/write performance
compared to ext2 and ext3.
Extensible File Allocation Table Supported for removable media
(exFAT) (from RHEL 9 only)
Global File System 2 (GFS 2) Used in enterprise server cluster, shared disks to manage
concurrent multi-node access
SWAP Swap partitions are used to support virtual memory. In other
words, data is written to a swap partition when there is not
enough RAM to store the data your system is processing.
Official (Closed) \ Sensitive Normal

Command Line Tools for Block Devices


Lecturer Demonstration

⚫ blkid – command line utility that displays information about


available block devices such as UUID, file system, etc.,

[student@C330-RH9-01 ~]$ blkid


/dev/mapper/rhel_c330-swap: UUID="7c0adaae-9729-41bc-8439-
cdec24436b5f" TYPE="swap"
/dev/sr0: BLOCK_SIZE="2048" UUID="2022-04-19-20-42-48-00"
LABEL="RHEL-9-0-0-BaseOS-x86_64" TYPE="iso9660"
PTUUID="3a60e52f" PTTYPE="dos"
/dev/mapper/rhel_c330-root: UUID="987ffe28-fcc8-4020-be05-
4479bfe4b4c0" BLOCK_SIZE="512" TYPE="xfs"
/dev/sda2: UUID="6f69b8a5-3ad8-4cb8-99eb-740f9df704ee"
BLOCK_SIZE="512" TYPE="xfs" PARTUUID="fee8dc8e-a7fe-4fb4-bce4-
05ce20bfcc31"
/dev/sda3: UUID="TdueaW-ZT9Z-DMW3-le1V-XDhj-iM0J-SIZBY8"
TYPE="LVM2_member" PARTUUID="f6186576-cd49-4b48-9941-
7eaa0184a916"
/dev/sda1: UUID="847B-E2F8" BLOCK_SIZE="512" TYPE="vfat"
PARTLABEL="EFI System Partition" PARTUUID="6b8ab8c0-390f-461a-
87f4-77fd76f08c61"
Official (Closed) \ Sensitive Normal

Command Line Tools for Block Devices


Lecturer Demonstration

⚫ lsblk – lists information about all available or the specified block devices.

Do you notice the


difference of –fp
options?
Official (Closed) \ Sensitive Normal

Checking Disk Space and Usage


Lecturer Demonstration

• The command df (Disk Free) is used get an overview of local and remote file system devices and
the amount of free space available
• df command file system disk space usage only on mounted file systems and file systems in RAM
• -h option to display the output in human readable format
• -H option to display size in system units to Files

• The command du (Disk Usage) are used get an


overview of local and remote file system devices
and the amount of free space available
• -h option to display the output in human
readable format
• -s option only reports single directory
summary
• -H option to display in system units
Official (Closed) \ Sensitive Normal

Mount Points
• Mount points are used to access the file systems on a storage device.
• Each mount point will correspond to a partition and is mounted as a
directory on the file system.
• We need to assign mount points to each of the partitions to make up the
file system.
• The mount command allows the root user to manually mount a file
system
• Mount points are listed in /etc/fstab, which is a plain text
configuration file that contains information about the major file systems on
a computer

Source: LPIC 101 – Mounting and Unmounting Filesystems on Linux


Official (Closed) \ Sensitive Normal

Mount Points : /etc/fstab


• fstab = file system table
• Configuration of the file system hierarchy
• Used by mount, fsck, and other commands
• The mount -a command can be used to mount all file systems listed
in /etc/fstab to confirm that all volumes are mountable after adding
entries in /etc/fstab

Lecturer Demonstration
Official (Closed) \ Sensitive Normal

fstab Entries
#device mount_point filesystem mount_options dump fsck

Example:
/dev/sr0 /media/cdrom iso9660 rw,noauto,user 0 0

1st column: corresponds to the physical device or partition. It can be referred either by physical device or by
UUID e.g. /dev/sda1 or UUID= 13152fae-d25a-4d78-b318-74397eb08184

2nd column: shows the mount point on which the physical device or partition is mounted

3rd column: shows the filesystem type with which each device or partition is formatted. E.g. ext2, etx3, ext4,
swap, ntfs, auto, ISO 9660, smbfs, hfs, etc.,

4th column: shows the mount options associated with the file system.

5th column: used to determine whether the dump command will back up the filesystem. It has two options:0 (do
not dump- used for most partitions) and 1(dump – used for root partitions)

6th column: It is used by fsck program to determine the order in which the computer checks the filesystem
when it boots. It has three options: 0 (do not check), 1(check first, only root partition should have this setting)
and 2 (check after root partition has been checked)

https://www.howtogeek.com/howto/38125/htg-explains-what-is-the-linux-fstab-and-how-does-it-work/
Official (Closed) \ Sensitive Normal

Mounting File Systems Manually

• There are two common ways to specify the file system on a disk
partition to the mount command:
• With the name of the device file in /dev containing the file system.
mount /dev/vdb1 /mnt/data
• With the UUID written to the file system, a universally-unique identifier.
mount UUID=“f46ccd6d-4319-42e0-8d89-9eb041bc2da0” /misc
• To get the UUID, use the below command.
[root@c330-test-03 ~]# lsblk -fp /dev/sdb
NAME FSTYPE FSVER LABEL UUID FSAVAIL FSUSE% MOUNTPOINTS
/dev/sdb
└─/dev/sdb1 ext4 1.0 misc f46ccd6d-4319-42e0-8d89-9eb041bc2da0

The best way to mount is by using UUID. Sometimes we may need to


move storage files from one device to another and updating /etc/fstab is
too tedious. With UUI, the Linux Kernel automatically find and map
volumes to a storage device.
Official (Closed) \ Sensitive Normal

Lecturer Demonstration
Locate Files on the System
• A system administrator needs tools to search for mounted files that match
specific criteria on the file system.
• The two commands to search for files in the file-system hierarchy are locate
and find
• The locate command searches a pre-generated index for file names or file
paths and returns the results instantly. Before using locate command, it is
important to use updatedb command to force an immediate update
[root@C330-RH9-01 ~]# updatedb
[root@C330-RH9-01 ~]# locate -n 5 passwd
/etc/passwd
/etc/passwd-
/etc/pam.d/passwd
/etc/security/opasswd
/usr/bin/gpasswd
• The find command searches for files in real time by parsing the file-system
hierarchy.
[root@C330-RH9-01 ~]# find /etc/ -name pas*
/etc/pam.d/passwd
/etc/pam.d/password-auth
/etc/passwd-
/etc/passwd
/etc/authselect/password-auth
Official (Closed) \ Sensitive Normal

1. Identify any two block devices connected


from the below screenshot

2. What information is stored in /dev directory?


Official (Closed) \ Sensitive Normal

Based on the below screenshot, answer the


following questions

a. What is the block device name of the disk?


b. How many partitions are there? Identify their device block name
c. What is the partition scheme used?
d. What is the unit sector size?
e. In which partition /boot is stored?
f. How do you interpret “Start” and “End” of each device?
Official (Closed) \ Sensitive Normal

Lecturer Demonstration Partitioning a new disk

• Steps in adding a new File Systems


1. Identify the device (2GB Hard Disk is already
attached to your virtual machine)
2. Back-up partition table (best practice)
3. Write a disk label to identify the partition scheme
used
4. Create Partitions
5. Update Kernel
6. Create file system
7. Label file system (optional)
8. Manual mounting (temporary)
Official (Closed) \ Sensitive Normal

Lecturer Demonstration 1. Identifying the device


• A new disk of size 2GB is already attached to your virtual
machine. You can verify this using one of the commands
( fdisk or lsblk or parted )
Official (Closed) \ Sensitive Normal

Lecturer Demonstration 2. Backup Partition Table


• Let's backup the partition table for first disk

[root@c330-test-03 ~]# sfdisk -d /dev/sda > /tmp/partition.sda

• Verify whether the file is created under /tmp directory

[root@c330-test-03 ~]# ls -l /tmp/partition.sda


-rw-r--r--. 1 root root 577 Nov 4 17:58 /tmp/partition.sda

• How to restore partition table after major mistake?

sfdisk /dev/sda < /tmp/partition.sda

For beginners, the best practice is to backup the partition table.


Incase if you accidently delete any files, can restore it from the
backup file
Official (Closed) \ Sensitive Normal

3. Writing the Partition Table


Lecturer Demonstration

• To partition a new disk, we need to write a disk label to it.


• The disk label indicates which partitioning (MBR/GPT) scheme to
use
• To write MBR disk label to a disk

[root@c330-test-03 ~]# parted /dev/sdb mklabel msdos


Warning: The existing disk label on /dev/sdb will be
destroyed and all data on this disk will be lost. Do
you want to continue? Yes/No?

• What should be used to write a GPT disk label? Do not demonstrate GPT

[root@c330-test-03 ~]# parted /dev/sdb mklabel gpt


Warning: The existing disk label on /dev/sdb will be
destroyed and all data on this disk will be lost. Do you
want to continue? Yes/No?

• A mistake with parted could lead to data loss


• The mklabel wipes the existing partition table
Official (Closed) \ Sensitive Normal

Lecturer Demonstration 4. Create Partition(s)


• To add a new primary partition to the disk /dev/sdb, of
size 128MB
[root@c330-test-03 ~]# parted /dev/sdb
GNU Parted 3.4
Using /dev/sdb
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) mkpart
Partition type? primary/extended? p
File system type? [ext2]? ext4
Start? 2048s
End? 128MB
(parted) p
Model: VMware Virtual disk (scsi)
Disk /dev/sdb: 2147MB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags:

Number Start End Size Type File system Flags


1 1049kB 128MB 127MB primary ext4 lba
(parted) q
Information: You may need to update /etc/fstab.

(OR)
[root@c330-test-01 ~]# parted /dev/sdb mkpart primary ext4 2048s 128MB
Official (Closed) \ Sensitive Normal

Getting help
Official (Closed) \ Sensitive Normal

Lecturer Demonstration 5. Update Kernel


• Run the udevadm settle command for the system to detect the new
partition and to create the associated device file under the /dev directory.

[root@c330-test-03 ~]# lsblk /dev/sdb


NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS
sdb 8:16 0 2G 0 disk
└─sdb1 8:17 0 121M 0 part

• Ensure that /proc/partitions is updated.


[root@c330-test-03 ~]# cat /proc/partitions
major minor #blocks name

8 0 31457280 sda
8 1 614400 sda1
8 2 1048576 sda2
8 3 29792256 sda3
8 16 2097152 sdb
8 17 123904 sdb1
11 0 8378368 sr0
253 0 27668480 dm-0
253 1 2121728 dm-1
Official (Closed) \ Sensitive Normal
Lecturer Demonstration

6 & 7. Create and Label File System


• We need to create an ext4 file system, and assign it the label misc. Label is
optional, but it is good practice to label partitions for reference.

#mkfs.ext4 -L misc /dev/sdb1 (or) mkfs –t ext4 –L misc /dev/sdb1

Note: mkfs.ext4 creates the ext4 file system


[root@c330-test-03 ~]# mkfs -t ext4 -L misc /dev/sdb1
mke2fs 1.46.5 (30-Dec-2021)
Discarding device blocks: done
Creating filesystem with 123904 1k blocks and 30976 inodes
Filesystem UUID: f46ccd6d-4319-42e0-8d89-9eb041bc2da0
Superblock backups stored on blocks:
8193, 24577, 40961, 57345, 73729

Allocating group tables: done


Writing inode tables: done
Creating journal (4096 blocks): done
Writing superblocks and filesystem accounting information: done

• We are able to see the disk labels.


[root@c330-test-03 ~]# blkid -s LABEL
/dev/sr0: LABEL="RHEL-9-0-0-BaseOS-x86_64"
/dev/sdb1: LABEL="misc"
• To find or locate the file system with the specified label
[root@c330-test-03 ~]# findfs LABEL=misc
/dev/sdb1
Official (Closed) \ Sensitive Normal

Lecturer Demonstration 8. Manually Mount


• Mount the file system
# mkdir /misc (create the mount point)
# mount LABEL=misc /misc or # mount /dev/sdb1 /misc
• To check if the file system has been mounted use: mount | grep
sdb1 (or) df - h
Official (Closed) \ Sensitive Normal
Lecturer Demonstration

Accessing the mounted directory


• We have successfully mounted /dev/sdb1 on
/misc.
• Make sure /dev/sdb1 is mounted before
accessing the mounted directory
• To access /dev/sdb1, change to /misc directory
and try to create new files.
Official (Closed) \ Sensitive Normal

Lecturer Demonstration
Unmounting partitions
• To unmount file systems, the umount command expects the mount point
as argument.
• Unmounting is not possible if the file system is in use

• The lsof command lists all open files and process accessing the
mounted directory

• Follow the steps to unmount /dev/sdb1 and verify whether it is


unmounted successfully.
Official (Closed) \ Sensitive Normal

Lecturer Demonstration Delete partitions


• Specify the disk that contains the partition to be removed
• Identify the partition number to be deleted
• Delete the partition
• Once deleted, update the system by running udevadm settle command

If the partition is not deleted, reboot the system and delete the partition.
Official (Closed) \ Sensitive Normal

Activity
LPP Academic Week 5 Worksheet Q7
a) Create a new ext4 partition of 256MB and mount on /mnt/<yourname>
b) Test whether you can access the mount point by creating a new file
c330_<yourname>.txt
c) Create another ext4 partitions of 512MB and mount on
/mnt/<student_id>
d) Access your mount point by copying the files /etc/passwd and
/etc/group to mount point. Verify whether the files are copied.
e) Show the output to your lecturer before unmounting and deleting
partitions.
f) Unmount the partitions.
g) Delete the partitions created.

Replace <yourname> and <student_id> with your name and student


id.
Official (Closed) \ Sensitive Normal

LPP Academic Week 5


Block II
Mounting Persistent File System
Official (Closed) \ Sensitive Normal

Persistent Mounting

1. Attach new hard disk of size 2B


2. Back-up partition table (best practice)
3. Write a disk label to identify the partition
scheme used
4. Create 2 Partitions (1 primary partition of
size 256MB and one logical partition of
size 512MB using the newly added hard
disk.)
5. Update Kernel Lecturer Demonstration
6. Create file system
7. Persistent mounting (permanent)
Official (Closed) \ Sensitive Normal
Lecturer Demonstration
Attach New Storage Device

• Before adding a storage device,


decide what type of storage
device interface to be used.
Commonly used devices are
SCSI, SATA and NMVe

• Steps to add new hard


disk of size 2GB using 1 3
SCSI
• Refer to the video
4

2
5
Official (Closed) \ Sensitive Normal
Lecturer Demonstration

Attach New Storage Device

7
8
6

9 10

To be completed by students using local VM and show your work


to lecturer before proceeding to next step
Official (Closed) \ Sensitive Normal

Creating Primary and Logical Partitions


Watch the video to create 2 partitions of size 256MB and 512MB respectively using sdb
and sdc

First Partition - Primary (to be completed by students)


1. use sdb
2. create a primary partition of size 256MB using primary partition
3. mount point /mnt/primary_mount
4. manual mount

Second Partition - Logical (to be completed by students)


1. use sdc
2. create a logical partition of size 512MB using extended partition

Refer to the video to create two partitions

Week 5 Creating Primary and Logical Partition.mp4


Official (Closed) \ Sensitive Normal

Persistent Mounting by appending


/etc/fstab file
Lecturer Demonstration

• We need to protect the fstab (chattr +a sets append only for the file. It
turns immutable bit on so even though root is not able to delete /overwrite the file)
# chattr +a /etc/fstab

• mtab contains currently mounted media, we’ll just copy what’s needed and append it
into fstab

Refer to the video for manual and persistent mounting

Best practice is to protect /etc/fstab entries using chattr command


Official (Closed) \ Sensitive Normal

Verifying /etc/fstab entries


Lecturer Demonstration

• The/etc/fstab last line contains the entries of the first


partition mounted.

• To find the UUID for /dev/sdb1use blkid command


Official (Closed) \ Sensitive Normal

Persistently Mounting File Systems


Lecturer Demonstration
• Whenever /etc/fstab is modified, run the below command or reboot
the server for system to register the new configuration

• Use lsblk –fs command to scan the block devices connected


Official (Closed) \ Sensitive Normal

Persistent Mounting by editing /etc/fstab


file (Mounting 2 nd partition)
Lecturer Demonstration

• Unprotect the fstab (use lsattr to see extended attributes on


files. )
# chattr -a /etc/fstab

• Edit /etc/fstab file to include the last line to mount /dev/sdc1


#
# /etc/fstab
# Created by anaconda on Thu Oct 20 06:18:51 2022
#
# Accessible filesystems, by reference, are maintained under '/dev/disk/'.
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info.
#
# After editing this file, run 'systemctl daemon-reload' to update systemd
# units generated from this file.
#
/dev/mapper/rhel_c330-root / xfs defaults 0 0
UUID=6f69b8a5-3ad8-4cb8-99eb-740f9df704ee /boot xfs defaults 0
0
UUID=847B-E2F8 /boot/efi vfat umask=0077,shortname=winnt 0 2
/dev/mapper/rhel_c330-swap none swap defaults 0 0
UUID=2022-04-19-20-42-48-00 /media/disc iso9660 ro,user,auto 0 0

/dev/sdb1 /mnt/primary_mount ext4 rw,seclabel,relatime 0 0


/dev/sdc5 /mnt/logical_mount ext4 defaults 0 0
Official (Closed) \ Sensitive Normal

Verify the mounted partitions


Lecturer Demonstration

• Use either df –h command of mount with grep commands to verify


the partitions mounted
[root@C330-RH9-01 ~]# df -h
Filesystem Size Used Avail Use% Mounted on
devtmpfs 844M 0 844M 0% /dev
tmpfs 875M 0 875M 0% /dev/shm
tmpfs 350M 9.4M 341M 3% /run
/dev/mapper/rhel_c330-root 27G 4.0G 23G 16% /
/dev/sr0 8.0G 8.0G 0 100% /media/disc
/dev/sda2 1014M 254M 761M 25% /boot
/dev/sda1 599M 7.0M 592M 2% /boot/efi
tmpfs 175M 92K 175M 1% /run/user/0
/dev/sdb1 115M 14K 106M 1% /mnt/primary_mount
/dev/sdc5 488M 24K 452M 1% /mnt/logical_mount

[root@C330-RH9-01 ~]# mount | grep sdb /etc/fstab


/dev/sdb1 /mnt/primary_mount ext4 rw,seclabel,relatime 0 0

[root@C330-RH9-01 ~]# mount | grep sdc /etc/fstab


/dev/sdc5 /mnt/logical_mount ext4 defaults 0 0
Official (Closed) \ Sensitive Normal

Accessing the mounted directory


• We have successfully mounted both primary and logical
partitions
• Access the primary partition by copying the contents of
/var/log/messages file and access the logical partition by
creating a new file.
[root@C330-RH9-01 ~]# cd /mnt/primary_mount
[root@C330-RH9-01 primary_mount]# cp /var/log/messages .
[root@C330-RH9-01 primary_mount]# ls -l
total 448
drwx------. 2 root root 12288 Nov 5 20:49 lost+found
-rw-------. 1 root root 442435 Nov 5 21:25 messages
-rw-r--r--. 1 root root 2984 Nov 5 21:24 passwd
[root@C330-RH9-01 primary_mount]# cd
[root@C330-RH9-01 ~]# cd /mnt/logical_mount
[root@C330-RH9-01 logical_mount]# ls
lost+found
[root@C330-RH9-01 logical_mount]# touch test.sh
[root@C330-RH9-01 logical_mount]# ls -l
total 16
drwx------. 2 root root 16384 Nov 5 20:49 lost+found
-rw-r--r--. 1 root root 0 Nov 5 21:25 test.sh
Official (Closed) \ Sensitive Normal

Unmount primary and logical partitions


• The following commands will unmount both partitions

[root@C330-RH9-01 ~]# umount /dev/sdb1


[root@C330-RH9-01 ~]# umount /dev/sdc5

[root@C330-RH9-01 ~]# cd /mnt/primary_mount


[root@C330-RH9-01 primary_mount]# ls -l
total 0
[root@C330-RH9-01 primary_mount]# cd /mnt/logical_mount
[root@C330-RH9-01 logical_mount]# ls -l
total 0
[root@C330-RH9-01 logical_mount]#

• What happened to the directory contents mounted on primary and


secondary partitions?
Class Discussion
Official (Closed) \ Sensitive Normal

Activity
LPP Academic Week 5 Worksheet Q8
a) Attach a new hard disk of size 3GB
b) Create a new ext4 partition of 1GB and manually mount on /mnt/<student_name>
c) Test whether you can access the mount point by creating a new file soi_c330.txt
d) Copy all files greater than 10 MB from / to soi_c330.txt which is created in
/mnt/<student_name> (Hint: use find command). Verify whether the files are
copied to soi_c330.txt
e) Create another ext4 partition of 512MB and mount persistently on
/mnt/<student_ID> (Hint: edit or append /etc/fstab)
f) Before you proceed to next step, verify the entry created in /etc/fstab file using
UUID.
g) Access your mount point by copying the files /var/log/messages to mount point
/mnt/<student_ID>
h) Verify whether the files are copied to /mnt/<student_ID>

Replace <yourname> and <student_id> with your name and student id.
Official (Closed) \ Sensitive Normal

Lesson Plan – 2 Larger Lesson Packages (LLP)


<-------------------------LLP1----------------------><---------------------LLP2---------------------->
WK 1 WK 2 W W WK WK 6 WK 7 WK 8 WK 9 WK WK WK 12 WK 13
K3 K4 5 10 11
LO 1,2 LO 3-5 LO LO LO LO 11,14 LO 15 LO 16-18 LO 19- LO LO WK 8 to LO 28,30
6-7 8 9,10, Release 21 24, 22,23 12
Release E- 12,1 Individual Practica Individual 25, ,26,2 Lessons Past ESE
Individual Learning 3 Submissi l submission E- 29 7 Review paper
submission 1(complet on 1 Revisio 2 Learnin practice
1 e 2 x RH (SDL – n and g2 Complete
Labs for 20%) Practice (complet Lab Individual
attendanc e 2x activities Submissio
e) Team RH Labs n 2 (SDL
Activity & 1 Hour for 40 mins 20%)
PDT/PPT Practica attendan Practical
Submissi l Test ce) & Theory Team
on 1 (CoL (AKS Quiz Submissio
20%) 60%) (AKS n 2 (CoL
60%) 20%)

Red Hat Labs for individual submissions

Mode of Quiz Impact of LOA on the date Week 6 RH124:Section 5.7:Lab: Create, View and Edit Text Files (E-Learn)
of Quiz RH124: Section 15.2: Lab: Manage Files from the Command Line (E-Learn)
RH124: Section 15.3: Lab: Manage Users and Groups, Permissions, and Processes
Practical Paper The student is eligible to RH134: Section 7.5: Lab: Manage Basic Storage
Quiz (week 7, take a make-up Week RH124: Section 15.5: Lab: Manage Networks (E-Learn)
12) 13 RH134: Section 14.2: Lab: Fix Boot Issues and Maintain Servers (E-Learn)
RH134: Section 4.7: Lab: Archive and Transfer Files
RH134: Section 14.5: Lab: Run Containers
Official (Closed) \ Sensitive Normal

Submissions for Academic Week 6


a. Individual submission folder in LEO 2.0 by 23:59 of your lesson day, uploaded in word document
• Complete the following Red Hat labs.
➢ RH124:Section 5.7:Lab: Create, View and Edit Text Files (E-Learn)
➢ RH124: Section 15.2: Lab: Manage Files from the Command Line (E-Learn)
➢ RH124: Section 15.3: Lab: Manage Users and Groups, Permissions, and Processes
➢ RH134: Section 7.5: Lab: Manage Basic Storage
Once you have completed, capture the screenshot of your lab completion together with your Red Hat login ID. Save all
screenshots in a word document and submit to individual submission folder in LEO 2.0 by 23:59 of your lesson day.
• Refer to the sample screen shot submitted in week 2. Make sure that all tasks are completed in the lab and the lab grade
should be “PASS”.

b. Team submission folder in LEO 2.0 by 23:59 of your lesson day, uploaded in Power Point slides.
• Include the following in your presentation slides.
• Include the CLI or scripts the shows the creation of users/groups and files/directories. Take necessary screenshots and
include in your presentation slides.
• Partial solution to the Problem Statement and clearly indicate if any assumptions made.
• Maximum numbers of slides are 20 (not more than 2 slides per team member)
• One slide on the challenges faced.
Member Individual Contribution within
• Include one slide for member contribution. Refer to the below:
Name the team to the solution(s) for
Example:
the problem statement
Member 1 50%
Member 2 30%
Member 3 15%
Member 4 5% 49
Member 5 0%
Official (Closed) \ Sensitive Normal

What have you learned?


• Manage users and groups permissions for accessing files & folders in
a Linux system.
• Implement storage access and management in a Linux system.
• Identify the storage devices for a file/directory
• Describe the need for virtual memory (swap space) to
supplement physical memory
• Explain the need for logical volumes and identify the Logical
Volume Management (LVM) components
• Create and manage storage devices, partitions and file
systems using CLI
• Create and manage virtual memory using swap files or
partitions using CLI
• Create and manage logical volumes containing file system
using CLI
• Demonstrate the different ways of partitioning and managing
volumes using CLI, for a given scenario
• Manage system resources to implement performance monitoring,
task scheduling, and log analysis for troubleshooting in a Linux
system.
• Manage software packages and services in a Linux system.
Official (Closed) \ Sensitive Normal

“PRACTICE makes
PERFECT”

You might also like