Centos attached hard disk vps

Source: Internet
Author: User
Tags centos server vps
After logging on to the Centos server remotely through SSH, the following operation is performed to remind you that the mounting operation will clear the data. make sure that the mounting disk has no data or you have not used the first step: list unmounted disk commands: fdisk-l prompt: if the device name of the data disk cannot be confirmed, use the df command to confirm the name of the system disk to exclude the error disk. Step 2: format the hard disk to be unmounted/dev/

Log on to the Centos server remotely using SSH and perform the following operations:
Reminder: data is cleared during the mounting Operation. make sure the mounting disk has no data or is not in use.

Step 1: list unmounted disksCommand: fdisk-l
Tip: If the device name of the data disk cannot be confirmed, use the df command to confirm the name of the system disk, so as to exclude the error disk from being attached.

Step 2: format the hard diskTake the unmounted/dev/sdb command as an example: fdisk/dev/sdb

Note: manually type at the arrow annotation area

Step 3: Create a partitionCommand: mkfs. ext4/dev/sdb1

Step 4: Mount a partitionCommand: mkdir/data
Mount/dev/sdb1/data # mount the sdb hard disk to/data

Step 5: write information to fstab to enable automatic mounting.
Command for automatic mounting upon startup: echo "/dev/sdb1/data ext4 defaults 0 0 0">/etc/fstab
Run the cet/etc/fstab command.


After restart, run the df command to view the mounted space and path.

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.