Linux Disk Management
The following commands are involved:
Fdisk-l View Current Disk usage
Fdisk/dev/sdb Partitioning
MKFS.EXT4/DEV/SDB1 formatting to a partition
Mkdir/data Creating a Mount Directory
Mount/dev/sdb1/data to mount the newly partitioned partition to the/data directory
Vi/etc/fstab mount the information in the Unload configuration file, boot up the Mount information
/dev/sdb1/data EXT4 Defaults 1 2
Mount-a
Df-h
Experiment
One or one centos6.5 machine with only one piece of 20G hard drive, now need to give new hanging on a 25G hard drive
1, disk information, the hard drive has been mounted on the machine, through the command fdisk-l can see
650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M02/8B/2C/wKioL1hGd6eBgNxOAAB2dmMoT4I032.png "title=" 1.png " alt= "Wkiol1hgd6ebgnxoaab2dmmot4i032.png"/>
2, FDISK/DEV/SDB to the disk partition 10G space out
650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M00/8B/2F/wKiom1hGeFyh9sBeAACdb6gnYzs043.png "title=" 2.png " alt= "Wkiom1hgefyh9sbeaacdb6gnyzs043.png"/>
3. Format and mount the/DEV/SDB1 to/data
650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M01/8B/2C/wKioL1hGeROQpHMyAABhRwtcZ30809.png "title=" 3.png " alt= "Wkiol1hgeroqphmyaabhrwtcz30809.png"/>
4, edit the configuration file, boot to load the hard disk information
[Email protected] ~]# Vi/etc/fstab
/dev/sdb1/data ext4 defaults 1 2
Second, when the/data is not enough, can not be divided into a new partition, and then mounted to the same directory/data, so that the original data can not see, if the new partition is attached to the/data, then we only need to umount-l/dev/sdb2 the new partition SDB2 Uninstall, The original data can be seen.
This article is from the "Asteroid" blog, please be sure to keep this source http://3203180.blog.51cto.com/3193180/1880070
11th Linux Disk Management (1)