1. First, check the number of hard disks on the machine:
$ Fdisk-l
Disk/dev/sdd: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 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: 0x00000000
Disk/dev/sdd doesn't contain a valid partition table
......
Disk/dev/sdh: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 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: 0xd54c485e
Device Boot Start End Blocks Id System
/Dev/sdh1 1 121601 976760001 83 Linux
I have a lot of disks on my server. According to the above information, the sdd hard disk is still mounted.
2. Hard Disk partitioning
$ Fdisk/dev/sdd
N-> p-> 1-> press ENTER
This indicates creating a primary partition with the size of the entire sdd disk.
Finally, run w to write data to the disk.
At this time, the disk has been partitioned, but there is no file system, and the disk is still unavailable
3. format the disk and write it to the file system.
$ Mkfs. ext4/dev/sdd1
Wait until command execution is complete
4. Mount the new hard disk to a node of the operating system.
$ Mkdir/mnt/sdd
$ Mount/dev/sdd1/mnt/sdd
5. Run the df command to view the disk information and check whether the new hard disk is mounted successfully.
$ Df
Filesystem 1K-blocks Used Available Use % Mounted on
/Dev/sda3 928204272 4191296 876862896 1%/
Tmpfs 32981876 12 32981864 1%/dev/shm
/Dev/sda1 198337 31960 156137 17%/boot
/Dev/sdh1 961432072 204436 912389636 1%/mnt/sdh
/Dev/sdd1 961432072 204436 912389636 1%/mnt/sdd
The above bold font is the new disk.