CentOs6 partitioning & formatting & mounting new hard disk/dev/sdb

Source: Internet
Author: User

First, partition/dev/sdb:
 
[Root@111cn.net/] # fdisk/dev/sdb # enter this device
 
Command (m for help): p # View partitions
 
/Dev/sdb1 1 500 4016218 + 83 Linux
/Dev/sdb2 501 1000 4016250 83 Linux
/Dev/sdb3 1001 1305 2449912 + 5 Extend
 
Command (m for help): d # delete a partition
 
Partition number (1-4): 1 # delete three partitions in sequence and re-Partition
 
Command (m for help): n # Create a partition
 
Command action
E extended # extended partition
P primary partition (1-4) # indicates the primary partition
 
Input: p
 
Partition number (1-4): 1 # set a primary Partition
 
First cylinder (1-1305, default 1): Press enter
 
Last cylinder or + size or + sizeM or + sizeK (1-1305, default 1305): Press enter
 
Partition number (1-4): 1
First cylinder (1-1305, default 1 ):
Using default value 1
Last cylinder or + size or + sizeM or + sizeK (1-1305, default 1305 ):
Using default value 1305
Command (m for help): p
 
Disk/dev/sdb: 10.7 GB, 10737418240 bytes
255 heads, 63 sectors/track, 1305 cylinders
Units = cylinders of 16065*512 = 8225280 bytes
 
Device Boot Start End Blocks Id System
/Dev/sdb1 1 1305 10482381 83 Linux
 
Command (m for help): w # save the partition. Don't forget it.
 
[Root@111cn.net/] # yum install e4fsprogs # install the ext4 user-mode tool;
 
[Root@111cn.net/] # mkfs. ext4-E lazy_itable_init = 1/dev/sdb1 # format the sdb1 partition to the ext4 file system;
 
[Root@111cn.net/] # mkdir/web # Create a directory;
 
[Root@111cn.net/] # echo "/dev/sdb1/web ext4 defaults, noatime, nodiratime 0 0">/etc/fstab # modify the system configuration file;
 
[Root@111cn.net/] # mount-a # mount disk;
 
[Root@111cn.net/] # df-lh # View disk information
 
Filesystem Size Used Avail Use % Mounted on
/Dev/sda2 13G 2.1G 11G 17%/
Tmpfs 513 M 0 513 M 0%/dev/shm
/Dev/sdb1 9.9G 151 M 9.2G 2%/web

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.