Format the New Hard Disk in CentOS and set automatic mounting upon startup

Source: Internet
Author: User

Format the New Hard Disk in CentOS and set automatic mounting upon startup

A new hard disk is added to the server, and only one sdb device can be seen under/dev.

As a result, you need to partition, create a file system, and set automatic mounting upon startup. The procedure is as follows:

1. Create a partition

Partition using the parted command:

[Plain] view plaincopy
  1. # Parted/dev/sdb
  2. (Parted) mktablegpt
  3. (Parted) mkpartdata1024KiB-1
  4. (Partedprint)
The parameter after parted is the device name. The three parameters of the mkpart command are the partition name (starting at will), the start address, and the end address (-1 indicates the end of the block device). The space in front may be used to store partition information, if you do not leave it, you will receive a warning. Print to view the partition result 2. format the partition

After the partition is created, the/dev/sdb1 partition appears. Use the mkfs command to format the partition:

[Plain] view plaincopy
  1. # Mkfs/dev/sdb1ext4
3. Set boot mounting

Modify the/etc/fstab file and add a line at the end:

[Plain] view plaincopy
  1. /Dev/sdb1/dataext4defaults00

Each field is a partition, a mount point, a file format, and a mount parameter. The last two generally use 0.

[Please specify the source for reference at http://blog.csdn.net/bhq2010/article/details/9238997]

Restart to check whether the configuration is successful.

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.