Centos6.2 mount a new hard disk, partition, format, and mount

Source: Internet
Author: User

1. First, check the number of hard disks on the machine:

$ Fdisk-l

Disk/dev/sdd: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders
Units = cylinders of 16065*512 = 8225280 bytes
Sector size (logical/physical): 512 bytes/512 bytes
I/O size (minimum/optimal): 512 bytes/512 bytes
Disk identifier: 0x00000000


Disk/dev/sdd doesn't contain a valid partition table

......

Disk/dev/sdh: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders
Units = cylinders of 16065*512 = 8225280 bytes
Sector size (logical/physical): 512 bytes/512 bytes
I/O size (minimum/optimal): 512 bytes/512 bytes
Disk identifier: 0xd54c485e


Device Boot Start End Blocks Id System
/Dev/sdh1 1 121601 976760001 83 Linux

I have a lot of disks on my server. According to the above information, the sdd hard disk is still mounted.

2. Hard Disk partitioning

$ Fdisk/dev/sdd

N-> p-> 1-> press ENTER

This indicates creating a primary partition with the size of the entire sdd disk.

Finally, run w to write data to the disk.

At this time, the disk has been partitioned, but there is no file system, and the disk is still unavailable

3. format the disk and write it to the file system.

$ Mkfs. ext4/dev/sdd1

Wait until command execution is complete

4. Mount the new hard disk to a node of the operating system.

$ Mkdir/mnt/sdd

$ Mount/dev/sdd1/mnt/sdd


5. Run the df command to view the disk information and check whether the new hard disk is mounted successfully.

$ Df

Filesystem 1K-blocks Used Available Use % Mounted on
/Dev/sda3 928204272 4191296 876862896 1%/
Tmpfs 32981876 12 32981864 1%/dev/shm
/Dev/sda1 198337 31960 156137 17%/boot
/Dev/sdh1 961432072 204436 912389636 1%/mnt/sdh
/Dev/sdd1 961432072 204436 912389636 1%/mnt/sdd

The above bold font is the new disk.

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.