Hard disk partition 2-4 partition device file name and mount
1. Partitioning: Dividing a large hard drive into small logical partitions
(The number of logical partitions in Linux is 5, 1, 2, 3, 4 can only be used for primary partition or extended partition)
2. Format: Write to file system (see below for work steps)
3. Partition device file name: Define the device file name for each partition
(interface representation method) A: first interface hard disk; 1: First Partition
/DEV/HDA1 (IDE hard drive Interface)
/DEV/SDA1 (SCSI hard Drive interface: Server transport interface, SATA hard drive interface)
4. Mount: Assign a mount point to each partition (the process of attaching a directory as a mount point and a partition becomes mounted)
(drive letter is the concept of windows;) Linux not called drive letter, called Mount point)
Note: The required partitions:
/(Root partition)
Swap (Swap partition or region memory, which can be understood as virtual memory, and replace memory when real memory is insufficient)
Note: Within 4G of memory, swap partition size is twice times memory, larger than 4g,swap partition as large as memory, no more than 2 GB in experimental environment
Recommended partitions:
/boot (boot partition, separate boot partition for boot, not too big 200MB OK)
2-6 Linux System Installation
1. Primary partition: There can be up to 4, determined by the hard disk structure. Sector has 64 bytes for storing partition information, 16 bytes per message, 4
512 bytes (sector size)-446 bytes (record boot information) =64 (partition representation) [each 16 bytes represents a partition]
2. Extended partition: Up to one, cannot write data, can only contain logical partition. Remove 1 primary partitions as expansion partitions with up to 3 primary partitions
3. File system:
Linux identification EXT2,EXT3,EXT4
Windows recognition Ntfs,fat16,fat32, etc.
4. Formatting: The fundamental purpose of formatting is to write to the file system
Format to do the work:
(1) A partition of the hard disk into a number of equal size 4KB (can be changed) data block (block), the file corresponding to the data stored in the block (not continuous storage)
(2) Another partition list that records the ID number (I node) of the file, the modification time, the permissions, and the number of blocks that the data is saved in (to find the data Block node)
Note: The basic purpose of formatting is to write to the file system, the empty data is only the accompanying effect (when partitioned into blocks, the contents of the content must be taken out first, that is, the data is emptied)
Hard links and soft links 3-5 link commands
Partitioning and hard links [diagram] (to be added)
Soft links and their differences from hard links [diagram] (to be added)
Create soft links, hard links, and compare [illustrations] (to be added)
Hard-Link feature: (one file multiple different access points, delete one as long as the other access points still exist, the file also exists)
1. Have the same I node and storage block block, can be seen as the same file
2. Can be identified by the I node (I node is the same, can be judged as a hard link)
3. Cannot span partitions
4. Cannot use for directory
Soft link Features: (less restrictive, more flexible) [recommended]
1. Windows-like shortcuts
2. The soft link has its own I node and block blocks (but the data block only saves the source file name and I node number, and there is no actual file data)
3.IRWXRWXRWX (i + 3 rwx) I: That is, soft link (Note: Soft link file permissions to see the original file permissions)
4. Modify any file and the other changes
5. Delete the original file, soft link cannot be used
Link directory or build link file: ln (link)
ln-s [Original file] [target file]
Option:-S creates a soft link (the default is hard link without the-s)
Hard disk partitioning with hard soft links