vault backup: 2025-05-05 16:12:23
This commit is contained in:
parent
a598cca70d
commit
464477c358
22
.obsidian/workspace.json
vendored
22
.obsidian/workspace.json
vendored
@ -198,26 +198,27 @@
|
||||
"omnisearch:Omnisearch": false
|
||||
}
|
||||
},
|
||||
"active": "565b9e04e8704d81",
|
||||
"active": "56bef0584922cba9",
|
||||
"lastOpenFiles": [
|
||||
"Operating Systems/assets/Pasted image 20250505144352.png",
|
||||
"Operating Systems/assets/Pasted image 20250505161031.png",
|
||||
"Operating Systems/Inter-Process Communication.md",
|
||||
"Operating Systems/File Systems Management.md",
|
||||
"Operating Systems/Memory Management.md",
|
||||
"Operating Systems/assets/Pasted image 20250505042548.png",
|
||||
"Operating Systems/Virtual Memory.md",
|
||||
"Operating Systems/Overview.md",
|
||||
"Operating Systems/Scheduling.md",
|
||||
"Operating Systems/Processes and Threads.md",
|
||||
"Operating Systems/Virtual Memory.md",
|
||||
"Operating Systems/assets/Pasted image 20250505155546.png",
|
||||
"Operating Systems/File Systems Management.md",
|
||||
"Operating Systems/assets/Pasted image 20250505160518.png",
|
||||
"Untitled.md",
|
||||
"Operating Systems/assets/Pasted image 20250505154746.png",
|
||||
"Operating Systems/assets/Pasted image 20250505144352.png",
|
||||
"Operating Systems/assets/Pasted image 20250505042548.png",
|
||||
"Operating Systems/assets/Pasted image 20250505042419.png",
|
||||
"Operating Systems/assets/Pasted image 20250204103541.png",
|
||||
"Operating Systems/Overview.md",
|
||||
"Operating Systems/assets/Pasted image 20250502183523.png",
|
||||
"Operating Systems/assets/Pasted image 20250502183221.png",
|
||||
"Operating Systems/assets/Pasted image 20250502183310.png",
|
||||
"Operating Systems/assets/Pasted image 20250502183242.png",
|
||||
"Operating Systems/assets/Pasted image 20250502183152.png",
|
||||
"Operating Systems/assets/Pasted image 20250502183002.png",
|
||||
"Operating Systems/assets/Pasted image 20250502182934.png",
|
||||
"README.md",
|
||||
"Untitled.canvas",
|
||||
"Discrete Structures/Midterm/attempt 2.md",
|
||||
@ -237,7 +238,6 @@
|
||||
"Languages & Machines/Introduction.md",
|
||||
"Functional Programming/Proofs.md",
|
||||
"Functional Programming/Recursion.md",
|
||||
"Functional Programming/Lists.md",
|
||||
"Languages & Machines/assets",
|
||||
"Languages & Machines",
|
||||
"Extracurricular/Misc/Proposed Routine Plan.canvas",
|
||||
|
@ -29,7 +29,17 @@ Files are mapped by the OS onto physical nonvolatile devices
|
||||
- Size
|
||||
- Protection (permissions)
|
||||
- Datetime and user id
|
||||
All of these are stored in **i-nodes**.
|
||||
|
||||
|
||||
### INodes
|
||||
- Size in biytes
|
||||
- Access permissions
|
||||
- Type
|
||||
- Creation and last access datetime
|
||||
- Owner ID
|
||||
- Group ID
|
||||
- Hard link count
|
||||
### Logical Definition
|
||||
- Named collection of related information
|
||||
- Files may have free form (text files) or can be rigidly formatted[^1]
|
||||
@ -92,6 +102,12 @@ Users have different directories. In Linux -> `/home/user` is separate, allowing
|
||||
### Acyclic-Graph
|
||||
Have shared subdirectories and files. Symlinks achieve this.
|
||||
|
||||
### Structure
|
||||
In Linux, it is a table (a file) which stores:
|
||||
- File name
|
||||
- Inode
|
||||
|
||||
|
||||
## Symlinks
|
||||
**Hard** vs **Soft**. Hard is a literal copy of the file but keep the same inode info, while soft is just a pointer.
|
||||
|
||||
@ -106,6 +122,26 @@ Disk/partition can be used **raw** (no file system) or can be **formatted**. The
|
||||
> 
|
||||
|
||||
|
||||
### Layout
|
||||

|
||||
|
||||
|
||||
- **Boot block**
|
||||
- Contains initial bootstrap program to load the OS
|
||||
- Typically the first sector reads another program from the next few sectors
|
||||
- **Super block** - state of the file system
|
||||
- Type -> ext3,ext4,FAT, etc.
|
||||
- Size -> Number of blocks
|
||||
- Block size
|
||||
- Block group information -> number of block groups in file system
|
||||
- Free block count
|
||||
- Free inode count
|
||||
- Inode size
|
||||
- FS mount info
|
||||
- Journal info
|
||||
|
||||
### Free space management
|
||||
Unix uses a bitmap to show free disk blocks. Zero=free, one=in use
|
||||
## Access lists and groups
|
||||
Read, write and execute.
|
||||
Three classes of users on Linux
|
||||
@ -114,6 +150,90 @@ Three classes of users on Linux
|
||||
3. Public -> 1 (X)
|
||||
|
||||
|
||||
## Blocks
|
||||
The IDs of data blocks are stored in [INodes](File%20Systems%20Management.md#INodes), the IDs of the first 12 blocks are stored in direct reference fields.
|
||||
|
||||

|
||||
|
||||
|
||||
|
||||
### Allocation
|
||||
- Contiguous -> Stored in a single block
|
||||
- Linked Allocation -> blocks contain a pointer to the next one (slower access)
|
||||
- Indexed -> Each file has an index block that stores pointers to all its data blocks
|
||||
|
||||
|
||||
### Groups
|
||||
Subdivision of the entire disk or partition
|
||||
Has:
|
||||
- A block bitmap
|
||||
- An inode bitmap
|
||||
- An inode table holding the actual inodes
|
||||
|
||||
> [!INFO]
|
||||
> Default block group size in ext4 is 128MB
|
||||
|
||||
## Journaling
|
||||
Ensure the integrity of the file system by keeping track of changes before they are actually applied to the main file system
|
||||
|
||||
Phases:
|
||||
- Write-ahead logging -> before any changes are made to the file system
|
||||
- Commit -> shit actually happens
|
||||
- Crash recovery -> we can replay the journal to apply any uncommitted changes
|
||||
|
||||
Types:
|
||||
- Write-Ahead Logging (WAL) -> logs changes before they are applied to the file system
|
||||
- Metadata journaling -> only metadata is logged. Metadata is restored to a consistent state if crash.
|
||||
- Full journaling -> both
|
||||
|
||||
|
||||
## Example: EXT4
|
||||
- Journaling
|
||||
- Larger file and volume sizes
|
||||
- Extents -> range of contiguous blocks, reduces fragmentation
|
||||
- Multiblock allocator -> multiple blocks at once
|
||||
- `fsck`, optimized file system check
|
||||
- Pre-allocation
|
||||
- Checksums -> ensure integrity
|
||||
|
||||
## Example: Windows FS
|
||||
### FAT(32)
|
||||
File allocation table.
|
||||
|
||||
No hard links :C. Directory contains:
|
||||
- File name -> can be up to 8 characters and extension up to 3
|
||||
- Attributes (one byte)
|
||||

|
||||
|
||||
- File size -> four byte field for filesize in bytes. Max. 4GB
|
||||
- ID of first block (4 byte)
|
||||
- File size
|
||||
|
||||
Obviously this is trash since it cannot be used with disk of very large capacities. Windows introduced clustering 4,8,16 blocks together.
|
||||
|
||||
The table itself is a list of blocks where many links are created and stored. Each entry is 4 bytes. List of empty blocks is also stored.
|
||||
|
||||

|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#### Free blocks list
|
||||
Stores a value for each cluster which can indicate:
|
||||
- `0x00000000` -> Free cluster
|
||||
- Next cluster number -> Cluster is allocated and points to the next one
|
||||
- `0xFFFFFFF8` - `0xFFFFFFFF` -> EOF
|
||||
- `0xFFFFFFF7` -> bad cluster
|
||||
|
||||
To find a free block we just need to search for the first available cluster. We keep the last allocated cluster, optimizing search time.
|
||||
### NTFS
|
||||
New Technologies File System
|
||||
|
||||
|
||||
|
||||
|
||||
---
|
||||
|
BIN
Operating Systems/assets/Pasted image 20250505154746.png
Normal file
BIN
Operating Systems/assets/Pasted image 20250505154746.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 65 KiB |
BIN
Operating Systems/assets/Pasted image 20250505155546.png
Normal file
BIN
Operating Systems/assets/Pasted image 20250505155546.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 9.1 KiB |
BIN
Operating Systems/assets/Pasted image 20250505160518.png
Normal file
BIN
Operating Systems/assets/Pasted image 20250505160518.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 68 KiB |
BIN
Operating Systems/assets/Pasted image 20250505161031.png
Normal file
BIN
Operating Systems/assets/Pasted image 20250505161031.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 23 KiB |
Loading…
x
Reference in New Issue
Block a user