Centos attached hard disk

Source: Internet
Author: User

1. view the current hard disk usage:

[[Email protected] _ node1 ~] # DF-H

File System ???? Capacity in use available % mount point

/Dev/sda3 14g 2.4g 11g 19%/

Tmpfs 3.9g 0 3.9g 0%/dev/SHM

/Dev/sda1 504 m 43 m 436 m 9%/boot

2. Check the new hard disk?

??? # Fdisk-l?
?
??? The number of the newly added hard disk is/dev/SDB?

?

3. Hard Disk Partition?
??? 1) In fdisk mode?
??? #/Sbin/fdisk/dev/SDB?
??? 2) Input n to partition?
?
??? 3) Select the partition type?
?
??? There are two options :?
??? P: What is the maximum number of primary partitions in Linux?
??? E: in Linux, only one extended partition can be created. After the extended partition is created, it cannot be used directly. You also need to create a logical partition on the extended partition .?
Here I select P .?
??? 4) How many partitions are selected?
?
Can I select four partitions?
??? 5) set the cylinder. Can I select the default value here?
?

? 6) Input W, write to the partition table, and partition?
?

4. format the partition?

Format the new partition to ex43 file system?
??? 1) What if the primary partition is created?
??? # Mkfs-T ext4? /Dev/sdb1?

5 .?? Attach a hard disk?

??? 1) create a mount point?
??? Create a storage directory under the root directory?
??? # Mkdir/storage?
??? 2) Mount/dev/sdb1 to/storage?
??? # Mount/dev/sdb1? /Storage?

? 6. Set automatic mounting upon startup?
??? The newly created partition cannot be automatically mounted upon startup. It must be manually mounted every time the machine is restarted .?
??? Need to modify the/etc/fstab file to set automatic mounting upon startup?
??? # Vi/etc/fstab?
??? Add a line at the end of the file?
??? /Dev/sdb1/storage ext4 defaults 1 2?

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.