First, install the hard drive to the physical machine. Slightly
Second, check whether the hard disk is installed correctly.
Use the "fdisk-l" command to view the hard drive code.
You can see that I have added a new hard drive ID as SDB.
Third, partition the hard disk.
1, when the hard drive is less than or equal to 2T, you can use Fdisk.
[[Email protected] ~] #fdisk/dev/sdb
1. Check the help.
Input: M
2. Create a new partition.
Input: N
3. Creating Logical partitions
Input: P
4. Enter the partition number and specify the partition size
Follow the prompts and the carriage return indicates default.
5. Delete a partition
Input: D
6. Modify the type of partition
Input: T
Select the partition number, and then list: l
7. Check the partition (the partition operation is not performed at this time)
Command (M for help): P
8. Save and exit
Command (M for help): W
2, when the hard disk is greater than 2T, with parted command.
[[Email protected] ~] #parted/DEV/SDB (partition the 3T hard drive with the part command)
Mklabel GPT (3TB can be in a partition with GPT format)
Unit TB (set to TB)
Mkpart Primary 0 3 (set to a primary partition, size 3TB, start is 0, end is 3)
Print (Displays the partition size of the setting)
Quit (quit parted program)
Four, format the partition.
[[Email protected] ~] #mkfs. ext4/dev/sdb1
Mount the hard drive to a folder.
1, manual mount.
Create a new folder: MKDIR/OPT/SDB1
Mount: MOUNT/DEV/SDB1/OPT/SDB1
2. Automatically mount the boot.
Input: Vi/etc/fstab
In the end, add:
/DEV/SDB1/HOME/SDB1 EXT4 Defaults 1 1
1.5 add more than 2T of hard disk under Linux mount operation under Linux