After remote SSH login to CentOS or Debian and Ubuntu series Linux servers, do the following:
Reminder: The mount operation will clear the data, please confirm that the mount disk has no data or is not used.
1.
Step 1: List all disks Command: ll /dev/disk/by-path
2.
Tip: If you are unable to confirm the data disk device name, use the df command to confirm the name of the system disk, thus eliminating the situation of the wrong disk.
Step 2: Format the hard disk Command: fdisk /dev/sdb
Note: the arrow in the figure continues to be manually typed
Step 3: Create a partition Command: mkfs.ext4 /dev/sdb1
Step 4: Mount the partition
Command: mkdir /www
Command: mount /dev/sdb1 /www
Mount sdb as a /www
Step 5: Write the information to fstab and let the system start automount.
command:
Echo "/dev/sdb1 /www ext4 defaults 0 0" >> /etc/fstab
Finally enter
Command: df -h
Check to see if the hard drive is mounted.
In addition to the above methods.
You can also use the pagoda to automatically mount the data disk method:
If the Pagoda fails to mount or prompt a non-LINUX partition before the one-click command is mounted.
Can use formatting commands
Mkfs.ext4 /dev/sdb
Enter y to confirm during command execution.
After the completion, you can execute the following commands.
Centos/Fedora:
-
Yum install wget -y && wget -O auto_disk.sh http://download.bt.cn/tools/auto_disk.sh && bash auto_disk.sh
Ubuntu:
-
Wget -O auto_disk.sh http://download.bt.cn/tools/auto_disk.sh && sudo bash auto_disk.sh
Debian:
-
Wget -O auto_disk.sh http://download.bt.cn/tools/auto_disk.sh && bash auto_disk.sh