Evaluation 1 Stuff Flashcards
What is difference between hard link and soft link?
A hard link is a mirror or the original file, it updates the data when is created instead of copying. A soft link is basically a pointer, data is stored in the original file. The main difference is if original file is deleted or moved link will be broken.
Command to create symbolic or symlink or soft link?
*ln -s <source></source><target>
*ln -s /root/dir1 /root/link-dir1
*li</target>
You want to compress and achieve the /data file system. What command would you use to archive and compress / data in one shot?
Tar -cvfz <name> <source></source>
Tar -czvf tmp.tar.gz /tmp</name>
What daemon is responsible for the system log?
Rsyslogd daemon
Filesystem that was at 100% capacity, how would you find what was filling up that filesystem?
Du - sh
If users home directory is using 50B. User deletes a big file (25B) and checks but df -h still reports its size as 50GB. Why even though 25 GB file was deleted? What’s the issue?
System dont recognize the change , the delete file was open and being used at the time of deletion.
Type lsof command
Get the PID of the opened file
Kill -9 <PID></PID>
How can you go into single user mode and its purpose?
Init 1 or during boot stop the process and press “e” then add systemd.unit=emergency.target
Emergency mode basically for maintenance.
How can you change the root passwd in RHEL 7 if you forget it?
Reboot the server
Stop the grub menu by hitting any key
Press e to edit kernel cmdline entry
Go to the end of the line starting with Linux16 and type
Init=/bin/bash
Hit ctlr+×
Chroot/sysroot
#passwd and enter and new password
Touch/.autorelabel
Reboot -f
What are some of the run levels/targets?
0 = shutdown/emergency mode
1= single user
2= multi user w/no network
3= multi user w/network no /GUI
4= not used or undefined
5= multi user w/network and w/GUI
6= reboot
How can you go into single user mode and its purpose?
Init 1
Troubleshooting
Emergency mode
Which command will you use to change the run level?
Init
Systemctl set-default
Vi /etc/systemd/system/default.target
How can you perform a file system consistency check on a partition/hard drive?
First unmount disk umount command
Fsck /dev/sdb1
What is the advantage of yum over rpm?
Yum is easy to install and it will install the dependencies and the latest version.
Rmp doesn’t resolve dependencies and you have to do it separately and fo thru the dependency hell.
Commands to check OS release?kernel version? Uptime?
Cat /etc/redhat-release
uname -r
Uptime prints current time, how long system has been up, number of users online, load average. Number of processes over preceding 1,5,15min intervals
Major differences between RHEL 6 and RHEL 7?
RHEL 6. RHEL7
Bootloader grub. Grub 2
Kernel. 2.6. 3.10
Run level. Init. Systemd.target
Default system. Ext4. Xfs
File size. 16T. 500 T