ECM 1413 File Management Flashcards

1
Q

Definition of a file

A

a named collection of related information that is recorded on secondary storage (non-volatile memory).

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

How do we determine the type of a file

A

File extensions help the operating system determine how to interpret the file (.txt, .exe, .docx)
Magic numbers (a sequence of bytes at the beginning of a file) also determine file type

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

Metadata (file attributes) include:

A

the name of the file
the identifier of the file
The type of file
the location of the file on a storage device
the size of the file (size on disk: sometimes the file will take more space than required)
the protection mode of the file, giving permissions
the times that the file was created/accessed/modified

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

2 distinctive features of the Linux file system:

A

1 an everything is a file approach
2 files represented by a tree-like inode (index node) pointer structure

metadata on Linux is stored on inode files

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

Six types of files in Linux

A

Regular files
Directories
Special files (Character [transfers data character by character or byte by byte] or Block [transfers data k-bytes by k-bytes])
Pipes (Chains commands, an output becomes an input for another operation)
Links (hard)
Symbolic links (soft)

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

Hard Links

A

point to an file via its inode directly
If the file is moved/deleted, the link will still work
A hard link is another name for an existing file

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

Soft links

A

pointer to a filename
If the file is moved/deleted, the link will not work

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

In Linux, file allocation on disk is done in fixed-sized blocks, with each block typically being 4096 bytes (4KB)
How can we keep track of where blocks for a file are located?

A

A file is broken down into chunks that fit into blocks
- Smaller than the block -> internal fragmentation
○ Internal fragmentation: Space in a block that is empty and unused
- Larger files span multiple blocks

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

The inode pointer structure

A

The inode keeps track of where different blocks are stored using pointers
Direct - directly refers to data on the disk
Single - Refers to another pointer that refers to blocks; used to store larger files
Double - Larger than single
Triple - Larger than double.

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

How we implement these abstract file management systems:

A

1 Magnetic disks
2 Solid state disks

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

How do magnetic (/hard) disks operate

A

A magnetic disk has a number of spinning circular platters, over which hover some heads attached to a movable arm. The magnetic disk is read/written by having the head sense/change the magnetism of a sector.
At a bit level
magnetism in one direction represent a one
magnetism in the other direction represents a zero

Each platter is divided into circular tracks
Each track is divided into sectors
The set of tracks across different platters at a given arm position make up a cylinder
Each sector has a fixed amount of data (traditionally 512 bytes, became 4KB); This is the smallest unit that you can transfer to or from a disk

A magnetic disk is read/written by moving the arms in/out to the required cylinder
All heads/arms move together
The platters rotate; the rotation speed is related to the data transfer rate

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

Solid state disk contents and operations

A

A solid-state disk has no moving parts and instead stores data using flash memory.
A solid-state disk has
a controller (an embedded processor)
buffer memory (volatile memory)
flash memory
- Is divided into pages that are grouped into blocks

A typical solid-state disk might have 4 kB pages and a 512 kB block size.
In this case, each block consists of 128 pages.

The act of erasing flash memory requires a high amount of voltage, and can therefore only be done on block level.
Overwriting requires an erase operation, and is therefore slower than reading or writing to an empty drive.

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

How is SSD read

A

1 copying a flash memory page into the buffer
2 reading data from the page in the buffer

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

How is SSD overwritten

A

1 copying a memory block into the buffer
2 erasing the block in the flash memory
3 modifying the block in the buffer
4 writing the block from the buffer to the flash memory

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

Pros and cons of SSD

A

+Solid-state disks are faster than magnetic disks
+Solid-state disks are more reliable than magnetic disks
+Solid-state disks are more power-efficient than magnetic disks
-Solid-state disks deteriorate with every write process
-Solid-state disks are more expensive than magnetic disks

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

Dynamic Wear-levelling

A

New data is written to the least-recently-used block
Thereby, we avoid wearing out certain blocks by writing to the same block again and again
Remaining problem: “cold” data is not moved

17
Q

Static Wear-Levelling

A

Static wear-levelling does the same thing as dynamic wear-levelling, and in addition
Periodically moves existing data to the least-recently-used block
Thereby, we avoid wearing out certain blocks while blocks with cold data is never moved

18
Q

Why is wear-levelling needed?

A

A block will fail once it reaches a critical number of writes
Thanks to wear-levelling, we spread the writes evenly among the blocks