Disk Abstraction & HDD Theory Flashcards

1
Q

How are discs seen by a OS?

A

Disks can be seen by a OS as a collection of data blocks that can be read or written independently

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

How the management of the discs blocks are done

A

Each block is characterized by a unique numerical address called LBA (logical block address)

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

How does an operational system access the disk?

A

The OS groups blocks into clusters to simplify the access to the disk. Clusters are the minimal unit that a OS can read from or write to

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

What are the contents inside clusters

A

The disc can contain several types of clusters. Clusters could contain file data, which are the actual contents of the files, and meta data, which is the information requires to support the file system (it could be file names, directory structures, file size, or file type,…)

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

How does a reading and writing procedure occurs?

A

In a reading, first we need to access the meta data to locate its blocks. Then we access the blocks to read its content.

In a writing, otherwise, we access the Meta data to locate free space in order to be able to write the data in the assigned blocks

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

What are the impacts of the fact that the OS can only access clusters on the disks sizes, and how does this relation impact on the waste of space?

A

Since the file system can only access clusters, the occupation of space on a desk for a file is always a multiple of the cluster size

These multiplicity could cause some clusters to not be fully filled with data. What represents a waste of space which is called internal fragmentation.

Example:

filesize=27byte
cluster size = 8 byte

actual size on the disk
a = ceil(27 / 8) * 8 = ceil(3.375)*8 = 4 *8 = 32 byte

Wasteddiskspace=32–27=5byte

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

How does a deletion happens in a disk?

A

This procedure just requires an update in the metadata to say that the blocks where the file was stored are no longer in used by the OS.

Deleting a file never actually deletes the data on the disk, when the new file will be written on the same clusters, the old data will be replaced by the new one

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

What happens when there is not enough space to story file contiguously

A

In this case, the file is split into smaller chunks that are inserted into the free clusters spread over the disk.

The efect of splitting a file into non-contiguous clusters is called external fragmentation

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

What is a hard disk drive and how data is read from it?

A

It consists of one or more rigid rotating discs with magnetic heads, arranged on a moving actuator arm to read and write data to the surfaces.

Data is read in a random accesses manner, meaning individual blocks of data can be stored or retrieved in any order rather than sequentially.

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

What are the four types of delay in a HDD?

A

The rotational delay, which is the time to rotate the desired sector to the read head, and is related to the revolution per minute of the drive motor

The seek delay, which is the time to move the read head to a different track

The transfer time which is the time to read or write bites

And the controller overhead, which is the overhead for the request management

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

How is the seek time calculated?

A

It is calculated considering a linear dependency with the distance. The result is: a third of the maximum seek time

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

What is the transfer time?

A

It is the final phase of the I/O, and considers the time to either read from or right to the surface. It also includes the time for the head to pass on the sectors.

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

read/write of a sector of 512 Byte = 0.5 KB

data transfer rate: 50 MB/sec

rotation speed: 10000 RPM (round per minute)

mean seek time: 6ms

overhead controller: 0.2ms

A

mean latency: (60s/min)x1000/(2x10000 rpm) = 3.0ms (time for 1⁄2 round)

transfer time: (0.5KB)x1000 / (50x1024KB/s) = 0.01ms

Mean I/O service time = 6ms + 3ms + 0.01ms + 0.2ms = 9.21ms

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

How does data locality influences on the mean I/O service time calculation?

A

The original calculation considers only the very pessimistic case where sectors are fragmented on the disk in the worst possible way, in which each access to a sector requires to pay rotational agency and see time

In many circumstances, this is not the case, files are larger than one block, and they are stored in a contiguous way

Therefore, data locality reduces the rational and seek agencies

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

How can we measure the data locality of a disk?

A

We can measure the data locality of a disk as the percentage of blocks that do not need seek or rotational latency to be found

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

Calculate the average time for read/write a sector of 512 Byte = 0.5 KB

CONSIDERING A DATA LOCALITY = 75%

rotation speed: 10000 RPM (round per minute)

data transfer rate: 50 MB/sec

mean seek time: 6ms

overhead controller: 0.2ms

A

T=(1–l)*(Ts+Trl)+Tc+Tt

mean time of one I/O op.= (0.25 ́ (6+3)) + 0.01 + 0.2 = 2.46 ms

17
Q

What is the key idea of disk scheduling

A

If there is a queue of requests to the disk, they can be re-ordered to improve performance

18
Q

How does a first come, first serve (FCFS) disk scheduler works?

A

It respects the order of the queue when making the accesses

19
Q

How does a shortest seek time first (SSTF) scheduler works?

A

The idea is to minimize seek time by always selecting the block with the shortest seek time

So based on the position of the head and the positions of the requests in the queue, it chooses the closest one to the head

20
Q

What is the problem of SSTF scheduler

A

It is prone to starvation

21
Q

How does a SCAN scheduler works

A

They head sweeps across the disc servicing request in order

22
Q

How does a C – SCAN scheduler works

A

Service requests in one direction (circular SCAN).

Based on the position of the head, it services the closest request position in one of the directions

23
Q

How does a C – LOOK scheduler works

A

It is a C – SCAN variant that peaks at the upcoming addresses in the queue (head only goals as far as the last request)