Add new hard drive and partition format under CentOS

Source: Internet
Author: User

CentOS Add a new hard disk and format the partition

1, first use fdisk -l to see the current state of the disk situation

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/6F/5C/wKiom1WaFZORzDTYAAKC1H_GwiY354.jpg "title=" 1.png " alt= "Wkiom1wafzorzdtyaakc1h_gwiy354.jpg"/>

above the red identification line can be seen, I added a new hard disk /dev/sdb, size 350G, unformatted format state.

2, use FDISK/DEV/SDB to partition operation.

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/6F/5C/wKiom1WaFbzwr8FYAAFfFy_C6T8404.jpg "title=" 2.png " alt= "Wkiom1wafbzwr8fyaafffy_c6t8404.jpg"/>

input N means creating a new partition

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/6F/5C/wKiom1WaFcyhCh7rAABLwnfy-bQ478.jpg "title=" 3.png " alt= "Wkiom1wafcyhch7raablwnfy-bq478.jpg"/>

P indicates the creation of a raw partition

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/6F/5C/wKiom1WaFf7SdWTqAABE_ZhOUWs265.jpg "title=" 4.png " alt= "Wkiom1waff7sdwtqaabe_zhouws265.jpg"/>

1 indicates that this partition number is 1.

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/6F/5C/wKiom1WaFiaRWCUSAAAeQkbirTI382.jpg "title=" 5.png " alt= "Wkiom1wafiarwcusaaaeqkbirti382.jpg"/>

1 means the default starting cylinder number is used . if you want to divide multiple areas, first calculate how big, then enter the number

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/6F/5C/wKiom1WaFmTCvFBrAAAkEDHyR0w022.jpg "title=" 6.png " alt= "Wkiom1wafmtcvfbraaakedhyr0w022.jpg"/>

Enter : carriage return indicates the use of the default end cylinder number . that is, this partition uses the entire hard disk space

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/6F/5C/wKiom1WaFnWijNSrAABbDIkMXE0474.jpg "title=" 7.png " alt= "Wkiom1wafnwijnsraabbdikmxe0474.jpg"/>

w// Save partition

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/6F/5A/wKioL1WaGFOgMebxAACRxYtw2q4644.jpg "title=" 8.png " alt= "Wkiol1wagfogmebxaacrxytw2q4644.jpg"/>

3. Check the current partition status again:

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/6F/5C/wKiom1WaFqWibWVZAALXqa7ACR0629.jpg "title=" 9.png " alt= "Wkiom1wafqwibwvzaalxqa7acr0629.jpg"/>

as you can see, a new partition has come out of a /dev/sdb1 . The next step is to format it and then use

4. with MKFS.EXT4 formatting a new partition

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/6F/5A/wKioL1WaGJjDIVADAAKMa1npmU4160.jpg "title=" 10.png "alt=" Wkiol1wagjjdivadaakma1npmu4160.jpg "/>

5, mount the use.

[email protected] ~]# mkdir-p/data2// creates a new mount point.

[email protected] ~]# MOUNT/DEV/SDB1/DATA2// Mount.

[Email protected] ~]# df–h

File System  capacity is used available used % mount point

Filesystem Size used Avail use% mounted on

/dev/sda3 26G 7.9G 17G 33%/

Tmpfs 939M 0 939M 0%/dev/shm

/DEV/SDA1 190M 47M 134M 26%/boot

/DEV/SDA4 40G 22G 16G 59%/data/mysql

/DEV/SDB1 345G 67M 327G 1%/data2

6. Auto mount on boot

Set up a new hard drive auto Mount
Add the mount information for the new hard disk in the Vi/etc/fstab. Add the following line :
/dev/sdb1/data2 EXT4 Defaults 1 2(if there is a partition that is 1 3, etc. )

this way , the system automatically mounts the/dev/sdb1 to /data2 after each boot


This article is from the "Behind" blog, make sure to keep this source http://merrycheng.blog.51cto.com/5331300/1671280

Add new hard drive and partition format under CentOS

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.