This is the 19th day of my participation in the Genwen Challenge

Equipment management

In Linux, devices are represented by files. Each device is abstracted as a device file, which provides a consistent file interface for applications and facilitates communication between applications and the operating system. Device files are stored in the /dev directory, usually several thousand of them, and Linux automatically creates them during installation, regardless of the actual device.

Disk devices

The naming of Linux system disks follows certain rules.

The first two letters indicate the type of device where the partition resides:

  • Hd: IDE hard disk
  • Sd: SCSI hard disk (USB disk, removable hard disk, etc.)

The third letter indicates which device the partition is on

  • Hda: The first IDE hard disk
  • Sda: indicates the first SCSI hard disk
  • SDB: indicates the second SCSI disk

Numbers indicate the order of partitions:

  • Hda1: Partition 1 of the first IDE hard disk
  • Sdb2: indicates the second partition of the second SCSI disk

View information about hard disks and partitions

fdisk -l
lsblk
Copy the code

Type of the mounted file system

You can mount ext, FAT, NTFS, Extended File System (EXT2), ext3, MINIX, MSDOS, and SYSV

  1. The first file system for Linux was Minix (file names cannot exceed 14 characters and file sizes cannot exceed 64MB)
  2. Ext: Designed in 1992, it was the first file system designed specifically for Linux, with file sizes up to 2GB, 255-character file names and poor performance
  3. Ext2: Designed in 1993 to improve performance
  4. Ext3: Uses Journaling File System technology (a separate journal File that tracks changes to disk contents), currently used by various Linux distributions

VFS

Linux introduced the Ext File System with one major improvement: it separated the File System from the operating System and System services, and used an interface layer between them, the Virtual File System (VFS).

Linux systems can support multiple file systems, and to do so, you must use a unified interface, known as the virtual file system (VFS). VFS hides the implementation details of different file systems so that all file systems look the same from the outside.

The VFS is not an actual file system: it exists only in memory, is created when the system starts up and dies when it shuts down

VFS functions include:

  • Record the types of file systems available
  • Associate the device with the corresponding file system
  • Handles general file-oriented operations
  • When it comes to operations on file systems, map them to the relevant physical file systems