Unit 2 - Disks and boot Flashcards
What is a partition and why would we use them?
- A partition is a chunk of the hard disk.
- We may use them to decrease chance of corrupting data.
How do we display the partitions of a hard drive?
sfdisk -l /dev/sda
What are the minimum partitions?
/ - Main directory tree such as OS files
boot/ - Used to store boot files
swap - Used as virtual memory space
What are the optional partitions?
/home - Used to store user files
/var - Used to store system config files that can change.
Why is it dangerous to resize partitions?
As most partitions together use 100% of the disk.
Resizing can cause other partitions to be decreased and subsequently cause data loss.
This also damages the partition table.
What are some features of LVM regarding partitions?
- It is capable of creating a partition using more then one physical hard drive disk.
What command is used to show logical volumes of partitions?
lvdisplay
What command is used to create a LV partition?
lvcreate -L -n
What command is used to reduce an LV partition?
lvreduce
What command is used to extend a partition size by adding more physical space?
vgextend
How do you find the id and file type of partitions?
blkid
How to see the disk space that is free?
df -h
How to see space being used by a disk space?
du -h
What command do you use to start a service?
systemctl start
What command do you use to make a service start every-time you boot?
systemctl enable
What is the difference between systemctl restart and reload?
Restart does Stop and Start
Reload starts a new service with the new config and once it is operating with no errors it stops the old service using the old config to ensure minimal downtime.
Explain what init.d is and how its runlevels work?
Init.d is used to run commands used for booting and setting up.
It consists of 7 run levels.
Each runlevel has a softlink to a script which controls a service.
What is the syntax of an init.d softlink filename? And how does priority work?
S/K
- The higher the priority means it starts first.
How does SystemD approach running system scripts?
It creates a tree of dependency for all the scripts that need to be run.
How does XINETD work?
Instead of running all services it runs a socket which listens for messages.
It then runs a service that corresponds to that can deal with the message.