Operating Systems 2017F Lecture 18: Difference between revisions
Line 26: | Line 26: | ||
* Type of filesystem <br> | * Type of filesystem <br> | ||
** What filesystem magic number is there <br> | ** What filesystem magic number is there <br> | ||
** file command to know file type <br> | |||
* Size of the filesystem <br> | * Size of the filesystem <br> | ||
* How the filesystem is organized <br> | * How the filesystem is organized <br> | ||
* Where can I find the rest of the metadata <br> | * Where can I find the rest of the metadata <br> | ||
He opened a .jpg as a binary file to show us the magic number in a file, first several bytes identify type of file. Kernel does not care about file extension. Userspace programs may care about the extension. | He opened a .jpg as a binary file to show us the magic number in a file, first several bytes identify type of file. Kernel does not care about file extension. Userspace programs may care about the extension.<br> | ||
<br> | |||
POSIX is a standard for UNIX <br> | |||
For POSIX filesystems <br> | |||
* File metadata is stored in INODES<br> | |||
* most have pre-reserved inodes <br> |
Revision as of 18:28, 16 November 2017
Additional Notes
Lec 18
- More on filesystems
- How can you recover a fs and how do you delete a file?
A filesystem is a:
- Persistent data structure
- Stored in fixed size blocks (at least 512 bytes in size)
- Maps hierarchical filenames to file contents
- Has metadata about files somehow
What's in a filesystem
- data blocks
- metadata blocks, you need someway to find the blocks
How do you organize metadata?
First identify basic characteristics of the filesystem
You need a "superblock" which is a "summary" block that tells you about everything else
Normally the superblock is the first block of the filesystem
In the superblock
- Type of filesystem
- What filesystem magic number is there
- file command to know file type
- What filesystem magic number is there
- Size of the filesystem
- How the filesystem is organized
- Where can I find the rest of the metadata
He opened a .jpg as a binary file to show us the magic number in a file, first several bytes identify type of file. Kernel does not care about file extension. Userspace programs may care about the extension.
POSIX is a standard for UNIX
For POSIX filesystems
- File metadata is stored in INODES
- most have pre-reserved inodes