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