1. first use fdisk-l to check the disk status. The red lines above indicate that I have added a new hard disk/dev/sdb with a size of 350 GB, unpartitioned formatting status. 2. use Fdisk/dev/sdb for partitioning. Input N to create a partition p to create a original partition 1 to indicate that the partition number is
1. first use fdisk-l to check the disk status in the current state.
As shown in the red lines above, I added a new hard disk/dev/sdb, with a size of 350 GB and unpartitioned formatting status.
2. use Fdisk/dev/sdb for partitioning.
Input N to create a partition.
P indicates creating an original partition.
1 indicates that the partition number is 1.
1 indicates the use of the default start cylindrical number. if you want to divide multiple zones, first calculate the size of the column and then enter a number.
Enter: press enter to use the default ending cylinder number. that is, the partition uses the entire hard disk space.
W // Save the partition
3,View the status of the current partition again:
We can see that a new/dev/sdb1 partition has been created. In the next step, format it and then use
4,UseMkfs. ext4Format new partition
5. Mount and use.
[Root @ lan27 ~] # Mkdir-p/data2 //Create a mount point.
[Root @ lan27 ~] # Mount/dev/sdb1/data2 //Mount.
[Root @ lan27 ~] # Df-h
File system capacity used available % mount point
Filesystem Size Used Avail Use % Mounted on
/Dev/sda3 26G 7.9G 17G 33%/
Tmpfs 939 M 0 939 M 0%/dev/shm
/Dev/sda1 190 M 47 M 134 M 26%/boot
/Dev/sda4 40G 22G 16G 59%/data/mysql
/Dev/sdb1 345G 67 M 327G 1%/data2
6,Automatic mounting upon startup
Set automatic mounting for new hard disk boot
Add the mount information of the new hard disk in vi/etc/fstab. add the following line:
/Dev/sdb1/data2 ext4 defaults 1 2 (if another partition is 1 3, and so on)
In this way, after each boot, the system will automatically mount/dev/sdb1 to/data2