How to mount a data disk on a Linux system?

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

150406062887901.jpg

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

150406063148113.jpg

Note: the arrow in the figure continues to be manually typed

 

Step 3: Create a partition Command: mkfs.ext4 /dev/sdb1

 

150406063148111.jpg

Step 4: Mount the partition   

     

Command: mkdir /www

Command: mount /dev/sdb1 /www

 

Mount sdb as a /www

150406063148112.jpg

Step 5: Write the information to fstab and let the system start automount.

 

command:  

Echo "/dev/sdb1 /www ext4 defaults 0 0" >> /etc/fstab

 

 

150406063148114.jpg

 

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:

  1. Yum install wget -y && wget -O auto_disk.sh http://download.bt.cn/tools/auto_disk.sh && bash auto_disk.sh

 


Ubuntu:

  1. Wget -O auto_disk.sh http://download.bt.cn/tools/auto_disk.sh && sudo bash auto_disk.sh

 


Debian:

  1. Wget -O auto_disk.sh http://download.bt.cn/tools/auto_disk.sh && bash auto_disk.sh

 

  • 765 Users Found This Useful
Was this answer helpful?

Related Articles

How to choose the cloud server?

★ Choose the right cloud server configuration based on your actual business needs: Understand...

How do I connect to my cloud server? (including linux and windows)

First of all to distinguish between linux and windows, including ubuntu, centos, debian are...

linux system data disk merged into the system disk

 Check it out, the current command: df -h [[email protected] ~]# df -h Filesystem...

Linux cloud server data disk expansion tutorial guide

This tutorial belongs to the data disk expansion [non-system disk] default directory /dev/sdb...

About the automatic synchronization of cloud server time, and the problem that time cannot be modified.

Recently, there have been user feedback, cloud server time cannot be modified. The solution is...