Unit 2 - Disks and boot Flashcards

1
Q

What is a partition and why would we use them?

A
  • A partition is a chunk of the hard disk.

- We may use them to decrease chance of corrupting data.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

How do we display the partitions of a hard drive?

A

sfdisk -l /dev/sda

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What are the minimum partitions?

A

/ - Main directory tree such as OS files

boot/ - Used to store boot files

swap - Used as virtual memory space

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What are the optional partitions?

A

/home - Used to store user files

/var - Used to store system config files that can change.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Why is it dangerous to resize partitions?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What are some features of LVM regarding partitions?

A
  • It is capable of creating a partition using more then one physical hard drive disk.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What command is used to show logical volumes of partitions?

A

lvdisplay

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What command is used to create a LV partition?

A

lvcreate -L -n

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What command is used to reduce an LV partition?

A

lvreduce

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What command is used to extend a partition size by adding more physical space?

A

vgextend

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

How do you find the id and file type of partitions?

A

blkid

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

How to see the disk space that is free?

A

df -h

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

How to see space being used by a disk space?

A

du -h

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What command do you use to start a service?

A

systemctl start

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What command do you use to make a service start every-time you boot?

A

systemctl enable

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What is the difference between systemctl restart and reload?

A

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.

17
Q

Explain what init.d is and how its runlevels work?

A

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.

18
Q

What is the syntax of an init.d softlink filename? And how does priority work?

A

S/K

  • The higher the priority means it starts first.
19
Q

How does SystemD approach running system scripts?

A

It creates a tree of dependency for all the scripts that need to be run.

20
Q

How does XINETD work?

A

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.