Basic knowledge
centos7 mount new hard disk
1. Use the command to view the current disk information
#fdisk -l //View disk information
2. Check the disk format
# df -T /
Three, fdisk sdb to partition, enter p to view the new hard disk partition, as shown in the figure:
5. Use the m command to view the internal commands of the fdisk command; the n command creates a new partition; the d command deletes an existing partition; the p command displays the partition list; the t command modifies the type ID number of the partition; the l command displays the partition ID number list; the a command specifies the boot partition; the w command saves the modification to the partition table to make it work.
We are creating new partitions here, so enter n then e is the extended partition, p is the primary partition, we enter p
For the next block number, enter 1, and finally select the size, Last cylinder or +size or +sizeM or +sizeK (1-60801, default 60801):+500GB //We enter this to mean that the partition size is 500G
Finally, enter w to save, as shown in the figure:
6. Format the disk mkfs -t ext3 /dev/sdb1 command to format sdb1
Seven, mount the hard disk
After formatting, we can mount the partition. We first create a directory called data and then mount /dev/sdb1 to the /data directory. The command is as follows
mkdir /data
mount -t ext4 /dev/vdb1/data
Finally, use the df -h command to view and modify /etc/fstab for automatic loading. As shown in the figure:
# /dev/vdb1 /mnt ext4 defaults 0 0
Then save x to exit.
———————————————
Copyright statement: This article is an original article by the CSDN blogger "Operation and Maintenance Junior Brother", and follows the CC 4.0 BY-SA copyright agreement. Please attach the original source link and this statement for reprinting.
Original link: https://blog.csdn.net/u013919633/article/details/79016201