2. Content
Physically, what is a HD like?
The HD for the OS
Why do I need a FS?
FS structure in Windows
FS structure in Unix
Other FS
Journalling
3. Physically, what is a HD like?
Little exercise
(Floppy)
2 heads
80 cylinders
18 sectors
512 bytes/sector
4. The HD for the OS
MBR – Master Boot Record
Bootloader
Partition table
Partitions* (limited to 4 primary)
File System: many, not only for HDs
Clusters/Blocks (performance)
Driver to transform physical address to logical
5. Why do I need a FS?
To set a structure for the data (files,
directories...)
Metadata (name, modification date, owner...)
Set a permissions system
Data integrity (damaged sectors)
Links
The clusters in which a file is saved (they might
not be contiguous)
...
6. FS structure in Windows
Boot Record – contains information about the different
areas
FAT – File Allocation Table
One entry for each block in the data area
Boot
Record
FAT
Optional
Duplicate
FAT
Data Blocks
The FAT family FS
7. FS structure in Unix
Superblock*: stores the size, number of files, free space,
index of the next free inode...
i-node list: holds one entry for each file or directory where
to save metadata, inode type, locking and modification
flags...
Data blocks: keeps the data of the files pointed by the
inodes.
Superblock i-node list Data blocks
The Ext family FS
8. FS structure in Unix
The Ext family FS
Buffer cache
Syncer
13 entries per inode
The first 10 direct
11º indirect simple
12º indirect double
13º indirect triple
If the block size is 1KB
Files of 16TB
9. Other FS
Special FS
Swap
ProcFS / SysFS
DevFS
TmpFS
UnionFS
In Unix everything is a file
10. Journalling
Avoid corruption
Write log before commit
Before journalling
Guessing work with “fsck”
For ext3, two ways of mounting the partition
Async: uses journalling and it's faster
Sync: old system without journalling, makes
changes straight to the disk
11. Journalling
Ordered (default)
Only log of Metadata
Data written to the disc before writing the log
Writeback
Only log of Metadata
Data written to the disc after or before writing the log
Journal
Log of Metadata and Data
First write the log then the disc
Slower but the most secure