CSE 411 Filesystems
File Types and Permissions
File Types: Regular files, directories, symbolic links, FIFOs, sockets, and device files (character/block special).
Permissions:
rwx(read, write, execute) permissions for owner, group, and others.Example:
-rw-r--r--shows a regular file with permissions.
Links
Hard Links: Cannot span filesystems; share the same inode.
Symbolic Links: Can link across filesystems; created with
ln -s.
Filesystem Structure
Directories: Common directories like
/etc,/home,/var,/usr, and/tmpserve specific purposes.Device Files:
Character Special: Raw device access (no buffering).
Block Special: Buffered access.
Fake Filesystems: Created at boot time, e.g.,
/proc.
Disks and Partitions
Disk Components: Platters, cylinders, tracks, sectors.
Partitions: Divided into cylinders, managed via tools like
fdiskorgdisk.Labels: GPT (modern, flexible) vs. MBR (legacy).
Filesystem Components
Superblock: Contains filesystem metadata (e.g., block size, free blocks, cylinder groups).
Inodes: Core of UNIX filesystems, tracking file attributes, locations, and permissions.
Cylinder Groups: Optimize file storage and include data blocks, inode blocks, and metadata.
Mounting and Filesystem Management
Mounting: Attach filesystems to directories; tracked in
/etc/fstab.Unmounting: Requires no active file use; done with
umount.Tools:
fsck: Check filesystem integrity.mkfs/newfs: Create new filesystems.df: Display disk usage.
Backups: Managed using
dump.
File Operations
Sparse Files: Allocate blocks only when data is written, saving space.
Directories: Special files storing file names and inode numbers.
Device Numbers
Major/Minor Device Numbers: Identify device drivers and modify behavior.