blob: f9f83de40dfb5f6e1744a4d69397b215b1e7fe1e (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
|
---
title: WTF is Linux
author: Rémi Nicole <remi.nicole@smile.fr>
date: 2020-09-22
slide-level: 2
aspectratio: 169
theme: metropolis
colortheme: owl
beameroption: "show notes on second screen=right"
toc: true
highlightstyle: breezedark
lang: en-US
bibliography: ../bibliography.bib
---
# Before we get started
## Requirements for the practical works
- A GNU/Linux machine
- An SD card reader
- A partner (if you want to)
## The website
- In here: <https://git.esiee.fr/nicolere/wtf-is-linux-website>
- Please contribute! <https://git-send-email.io/>
- Learn Git: <https://git-scm.com/book/en/v2>
::: notes
- If you have already used Git before, try to use the send-email approach
- If not, you can use the pull request method
:::
## Where were we?
::: notes
- Some history of computer science
- Downloaded, configured and build a kernel
- Tried to boot a Linux system, without success
:::
# The file system
## Purpose
- Organize ones and zeroes into files and directories
- It is therefore a "format"
- We can ask the kernel to represent the files and directories somewhere
::: notes
- Storage devices (HDDs, SSDs) just store ones and zeroes
- Representing the files is what is called "mounting"
:::
## Storage devices
- HDDs, SSDs, Flash Memory, everything is different
- We don't care about their differences
- Thank you device drivers
## Well-known file systems
- FAT32
- ext4
- NTFS
::: notes
- FAT32 works everywhere but
- Fragmentation
- no files bigger than 4 GB
- no advanced features (FAT is quite old)
- ext4 is the de facto Linux file system
- NTFS is the standard Windows file system
:::
## Anatomy of a file system
- Need to store the content of files
- Need to store metadata
- File names
- File permissions
- Where the content is
- etc.
---
![FAT32 format [@mdpi:fat32]](../res/fat32.jpg){ width=70% }
---
![FAT32 table [@wikimedia:fat32_table]](../res/Fat32_structure.png){ height=70% }
## Partitions
- We need a way to store **several** file systems in a single hard drive
- This is quite similar to file systems
- But we store partitions instead of files
- We call the format a "partitioning scheme"
::: notes
- Similar in that:
- This is a format
- We need metadata
- And we need space for the partitions
:::
## Well-known partitioning scheme
- MBR
- GPT
## Anatomy of a partitioning scheme
![GPT format [@wikimedia:gpt]](../res/GUID-Partition-Table-Scheme.png){ height=80% }
## Block devices
- We need a way for the kernel to present us devices
- You can't directly present files
- We may not have a file system in a partition
- The kernel doesn't automatically where to "mount" the files
::: notes
- Philosophy of "everything is a file"
- Look at `/dev`
- `/dev/sda` is the first SCSI disk
- `/dev/sda1` is the first partition in the first SCSI disk
- Theses special files behave a lot like normal files
:::
## Mounting
- To the terminal!
::: notes
- Also talk about mount options
:::
## Special file system
- Common examples: `tmpfs`, `devtmpfs`, `sysfs` & `proc`
# Init
## Purpose
- We need a process launched by the kernel
- A process can launch other processes
- So let's make it 1
## Busybox
# References
|