-
Prevent data loss: If the system has only one partition, then this partition is damaged, and the user will lose all data.
-
Increase the efficiency of disk space usage: partitions can be formatted with different block sizes. If there are many 1K files, and the hard disk partition block size is 4K, then 3K space will be wasted for each file stored. At this time, we need to take the average of these file sizes to divide the block size.
-
Data explosion to the limit will not cause system hangs: Separating user data and system data can prevent user data from filling up the entire hard disk and causing system hangs.
Details of fdisk -l display information
Details of fdisk -l display information
[[email protected] ~]# fdisk -l
Disk /dev/sda: 10.7 GB, 10737418240 bytes
255 heads, 63 sectors/track, 1305 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00044938
Device Boot Start End Blocks Id System
/dev/sda1 * 1 638 5120000 83 Linux
Partition 1 does not end on cylinder boundary.
/dev/sda2 638 893 2048000 83 Linux
Partition 2 does not end on cylinder boundary.
/dev/sda3 893 1020 1024000 82 Linux swap / Solaris
Partition 3 does not end on cylinder boundary.
/dev/sda4 1020 1306 2292736 5 Extended
/dev/sda5 1021 1306 2291712 83 Linux
Analysis :
Disk /dev/sda: 10.7 GB, 10737418240 bytes
The block device name is /dev/sda, the size of this device is 10.7GB, this number is not very precise, my system is 10GB; 10737418240 bytes This is after converting into bytes size, namely: 10737418240/1024/1024/1024=10GB (Note: bytes=B, means "byte", bit=b, means "bit")
255 heads, 63 sectors/track, 1305 cylinders
255 heads: means The number of heads is 255
63 sectors/track: means that there are 63 sectors on each track
1305 cylinders: means that there are 1305 cylinders in total, and a cylinder is the smallest unit of a partition
Units = cylinders of 16065 * 512 = 8225280 bytes
16065=255*63 Because each head is on the same cylinder, 63 represents the number of sectors on each track, and the product of these two numbers represents the number of sectors on a cylinder; so 16065*512 means The size of a cylinder is 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
means that the size of a sector is 512 bytes
Summary : So size of one disk = size of one cylinder * total number of cylinders = number of heads * number of sectors on each track * size of one sector * total number of cylinders
That is : disk size=8225280*1305=10733990400bytes=9.99GB=255*63*512*1305
The above example shows that our disk has only 1305 cylinders, but 1306 cylinders appear in the partition information below, which is not necessary Care too much, the data displayed by linux will not be very accurate.