
The struct inode_operations *iop in the inode structure provides us with a list of inode operations. Although each file has a corresponding inode node, the system will only create a corresponding inode data structure for it in memory when needed, and the established inode structure will form a linked list, which we can get by traversing the linked list For the file nodes we need, VFS also constructs cache and hash table for allocated inodes to improve system performance. It only exists in the memory and can be accessed through the inode cache. The static information in the inode structure is taken from the file system on the physical device and filled in by the function specified by the file system. It is the most basic unit of Linux management file system, and it is also a bridge for file system to connect any subdirectories and files. you need to briefly describe the inode in the memory and the inode on the disk: VFS inode includes file access permissions, owner, group, size, generation time, access time, and last modification time And other information. Where it is easy to cause confusion, I will call the inode structure in the memory VFS inode, and the file system is represented by EXT2, and Ext2 inode is represented by the inode on the disk. The open function can directly open the hard disk, so if we can skip the file system and store the data directly on the hard disk, but we need to define the data layout.Ħ: df command df to view related information in the file system. It means to copy count bs data from the/dev/had hard disk to disk.mbr. Such as: dd if=/dev/hda of=disk.mbr bs=512 count=1 Its function is to copy a file with blocks of specified size and perform specified conversions while copying. As shown below:ĭd is a very useful command under Linux/UNIX. etc/fstab records the list of file systems that are automatically mounted when linux boots. Boot Record ID, the boot area mark occupies two bytes (0x1FE and 0x1FF), for a legal boot area, it is equal to 0xAA55, which is a sign to judge whether the boot area is legal. The main partition table is divided into four partition entries, each of 16 bytes, which records the information of each primary partition separately (so there can be up to four main partitions). DPT is the main partition table occupies 64 Bytes (0x1BE to 0x1FD), record the basic partition information of the disk. MBR, also known as the master boot record, occupies the first 446 bytes (0 to 0x1BD) of the Boot Sector, and stores the system master boot program (it is responsible for loading and running the system boot program from the active partition). why is it like this? As shown:īoot Sector is also the first sector of the hard disk, which consists of three parts: MBR (Master Boot Record), DPT (Disk Partition Table) and Boot Record ID. The partition of a hard disk is divided into primary partition (3 primary partitions and one extended partition) and logical partition, and the number of primary partitions is up to four. For example, hda1 represents the first partition on the hard disk device hda.Ģ: For a hard disk, you need to partition it first, and then format the corresponding file system on the partitionįormat the file system (ext3 as an example): mkfs.ext3 partition By analogy, the partitions are named with the device name plus a number. By analogy, SCSI interface devices are named after sd, the first device is sda, and the second is sdb.

Under Linux, IDE devices are named after hd, the first IDE device is hda, and the second is hdb.

As mentioned earlier, LVM is a logical layer added between the disk partition and the file system to shield the lower layer disk partition layout for the file system, provide an abstract volume, and establish a file system on the volume.ġ: See all hard disks of this machine, including unformatted

LVM is a logical layer built on hard disks and partitions to improve the flexibility of disk partition management Sex. It is a mechanism for managing disk partitions in the Linux environment. LVM is the abbreviation of Logical Volume Manager.
