Premise: an 80 GB hard drive added to the server. [The hard disk can only be divided into 15 partitions, including the primary partition] fdisk/dev/hdaCommand (mforhelp): p [view the current partition of the hard disk] Command (mforhelp ): n [create a Partition] Commandactione & nb
Premise: an 80 GB hard drive added to the server. [The hard disk can only be divided into 15 partitions, including the primary partition]
Fdisk/dev/hda
Command (m for help): p [view the current partition of the hard disk]
Command (m for help): n [new Partition]
Command action
E extended
P primary partition (1-4)
P [input p indicates creating a primary partition. a primary partition contains only four extended partitions.]
Partition number (1-4): 1
First cylinder (1-155007, default 1): press the Enter key to indicate that the default start from 1 column
Using default value 1
Last cylinder or + size or + sizeM or + sizeK (1-155007, default 155007 ):
+ 20G [+ 20G indicates that the partition is planned to be 20G. if it is 200 M, write it to + M]
Here we only divide one primary partition. Next we need to divide an extended partition (to divide the logical partition)
Command (m for help): n
Command action
E extended
P primary partition (1-4)
E [create an extended partition]
Partition number (1-4): 2 [because a primary Partition is marked as 1
Show partitions can only start from 2]
First cylinder (38754-155007, default 38754 ):
Using default value 38754
Last cylinder or + size or + sizeM or + sizeK (38754-155007, default
155007): press enter to divide all the remaining space into extended partitions. if you need to specify the size, for example, 30 GB, + 30 GB
Using default value 155007
Command (m for help): n
Command action
L logical (5 or over)
P primary partition (1-4)
L [create a logical partition. the logical partition sequence number starts from 5 because 1-4 is used by the primary partition and extended partition]
First cylinder (38754-155007, default 38754): [press enter to start from 38754 magnetic column]
Using default value 38754
Last cylinder or + size or + sizeM or + sizeK (38754-155007, default
155007): + 10 GB [specify the size of the Logical Partition], and so on.
Finally, Command (m for help): w press enter to release and save the write. OK
[Root @ FILESERVER-15FLOOR ~] # Fdisk-l/dev/hda
Disk/dev/hda: 79.9 GB, 79998918144 bytes
16 heads, 63 sectors/track, 155007 cylinders
Units = cylinders of 1008*512 = 516096 bytes
Device Boot Start End Blocks Id System
/Dev/hda1 1 38753 19531480 + 83 Linux
/Dev/hda2 38754 155007 58592016 5 Extended
/Dev/hda5 38754 18130 9765976 + 83 Linux
Because the hda1-hda4 can only be used by the primary partition or extended partition, even if only hda1 and hda2 are available, the logical partition sequence number can only start with 5]
Finally, you must format the partition using # mkfs. ext3 to mount and use the partition.
# Mkfs. ext3/dev/hda1
# Mkfs. ext3/dev/hda5
# Mount/dev/hda1/comanpy