Hard disk Partitioning
- Divide a large hard drive into small logical partitions
Partition type Primary partition
Extended partition
- There can be at most one
- Primary partition + extended partition up to 4
- Features of Extended partitioning
- An extended partition cannot be formatted or holds data, but can be used to store logical partitions
Formatting
That is, logical formatting (advanced formatting), to write to the file system on the hard disk
Writes specific data to a specific area of the disk based on a user-specified file system, and draws a partition that contains disk space for file allocation tables, table of contents tables, etc. for file management
- File systems that Windows can recognize: FAT16, FAT32, NTFS
- Linux recognized file system: EXT2, EXT3, EXT4 (centos6.3,4kb space, if a file larger than 4Kb, such as 6Kb, then will occupy 2 units)
Objective:
- Writing to the file system on the hard disk
- Divide the hard disk into chunks of equal size (block) according to the rules of the file system
- Set up a list of I nodes, find the file by the I node number to find the location of the file, take out the data
Disk Grooming:
- The data blocks that hold the same file are allocated as much as possible to benefit the reading of the data
Hardware Device file name
Define a device file name for each partition
- IDE hard drive:/dev/hd[a-d]
- Scsi/sata/usb hard drive:/dev/sd[a-p]
- Optical drive:/dev/csrom or/dev/sr0
- Floppy:/dev/fd[0-1]
- Mouse:/dev/mouse
Partition Device file name
- Add a number directly to the hardware device file name
/dev/sda1
Indicates SATA, SCSI hard Drive interface
- Attention
- Logical partitions in an extended partition can only start at 5, and 1-4 can be left to primary and logical partitions
Mount
- A mount in Windows is called an "allocation letter", and the process of assigning a drive letter to a partition in Linux is called mounting, and the drive letter is called a mount point in Linux
- You must specify a mount point for the partition before you normally use the partition, and the mount point must be an empty directory
Must be partitioned
- Linux will empty directory name as a drive letter, in theory any directory can be used as a drive letter, but some do not
- Must be partitioned
/
Root partition
swap
partition, or swap partition (virtual memory), typically twice times the size of memory, not exceeding 2GB
Recommended partitioning
/boot
boot partition, 200MB
- Allow
/boot
folder partitioning to ensure Linux starts normally
Using partitions
- Partition-format-to-partition device file name--write mount point (hanging letter)
File system Structure
Linux----Hard disk partitioning