Posts

File Archiving and Compressing - RHCSA

Image
Why file archiving and compressing is important? Creating Backups  Transferring data across network is much easier. If we want to send data Over the network and Machine to Machine , Compress the file and send. What is an Archiving?  Archiving is the process of collecting files or directories into one location. We use tar command for it. tar stands for Tape Archiving. Options : c - Create an archive t - List the content of the archive x - Extend the archive  v - Verbose (print the file names when they are archiving or compressing) f - File name Remember that The file extension of the archived file should be .tar Examples: #mkdir data1 #mkdir data2 #mkdir data3 #tar cvf data-archive.tar data1 data2 data3 data1, data2, data3 files are archived. Archived file name is data-archived.tar  We cannot create same name archive files because they are overwriting without given any feedback. Hence use ls -l command. #tar cvf <archi...

Disk Management (1) - RHCSA

Image
Disk management is a main task for system administrator. So first identify what are the main hard disk types available in a system. SATA Hard Drives SCSI Hard Drives IDE Hard Drives Virtual Hard Disks    How Linux identify HDD ? They use prefixes named sd , hd , vd for identifying SATA / SCSI , IDE , Virtual Disks.  sd - SATA or SCSI hd - IDE vd - Virtual Disks EXAMPLE: If we use several SATA or SCSI disks in our system, system will identify them as sda , sdb , sdc and so on. If we use several IDE disks in our system, system will identify them as hda , hdb , hdc and so on. If we use several virtual disks in our system, system will identify them as vda , vdb , vdc and so on. For more clarification, Hard Disk Partitioning     There are many reasons to partition a hard disk. Security Easy to get backups Organization is easy  Speed   In hard disk partitioning, there are three (3)  types. Primary...

Security-Enhanced Linux (SELinux) - (3)

Image
So We are entering the last session of SELinux in RHCSA level. So before entering you have to remember followings. Installing a service yum install httpd systemctl enable httpd.service systemctl start httpd.service systemctl status httpd  rpm -qa | grep httpd SELinux mode sestatus vim /etc/sysconfig/selinux  reboot After installing httpd service, open firefox and type localhost. Then Welcome page will be loaded. Root directory is /var/www/html . In here you need to create a file named index.html. You can use touch or vim commands. For an example, cd /var/www/html vim index.html Then you will get a index.html file to edit. Reason for selecting /var/www/html file path because it was defined as the root directory in /etc/httpd/conf/httpd.conf path After you creating a index.html file save it and restart the httpd service. systemctl restart httpd.service --------------------------------------------------------------------------------------...

Interrupt the kernel to change the fstab - RHCSA

Image
What is fstab?  fstab is a file, used enter information about partitions with options. Such as if we want to persistently mount hard disk we add its uuid and file type to fstab. When boot-up process, fstab is read. fstab is in /etc/fstab  You can view it using vim text editor. vim /etc/fstab . Then you will receive following.   If there is an error, boot-up process will be stucked at some point. Then we need to enter the emergency mode.  First Create a partition. Use following steps. I am going too use vdb disk. cat /proc/partitions   fdisk /dev/vdb press n (or m for help) create 100M partition mkfs.ext4 /dev/vdb1 -->Format it using ext4.file system. blkid --> check whether block id is available mkdir /mountPoint ---> create a mount point echo | blkid | grep vdb1 >> /etc/fstab vim /etc/fstab and add uuid , file system , defaults , 0 0    press ESC and type :wq mount -a Reboot the system vim /etc/fstab...