(1) View disk capacity Fdisk-l
650) this.width=650; "Src=" https://s2.51cto.com/wyfs02/M02/A2/7F/wKioL1mg1Y7h37eBAABkVCHi_hk124.jpg-wh_500x0-wm_ 3-wmp_4-s_2177180924.jpg "title=" qq20170826095733.jpg "alt=" Wkiol1mg1y7h37ebaabkvchi_hk124.jpg-wh_50 "/>
Comments:
<1> Linux system Add a hard drive SDA
<2> HDD SDA, there are 2 partitions sda1/sda2
(2) Adding a piece of hard disk
① to view the added hard drive with Fdisk-l
650) this.width=650; "Src=" https://s2.51cto.com/wyfs02/M00/A2/80/wKioL1mg3APSyRGpAACdZXOcDL0033.jpg-wh_500x0-wm_ 3-wmp_4-s_1385509197.jpg "title=" qq20170826102512.jpg "alt=" Wkiol1mg3apsyrgpaacdzxocdl0033.jpg-wh_50 "/>
Comments:
<1> added a SDB hard disk to the Linux system with no partitions
(3) Partitioning the disk
Disk partitioning Command Fdisk/dev/sdb
650) this.width=650; "Src=" https://s4.51cto.com/wyfs02/M02/A2/80/wKioL1mg4MHTudswAABikpGpibk616.jpg-wh_500x0-wm_ 3-wmp_4-s_3909760697.jpg "title=" 5435436.jpg "alt=" Wkiol1mg4mhtudswaabikpgpibk616.jpg-wh_50 "/>
<1> n indicates that a partition was created
650) this.width=650; "Src=" https://s1.51cto.com/wyfs02/M00/A2/80/wKioL1mg402yV3r6AAATCBGDRv8885.jpg-wh_500x0-wm_ 3-wmp_4-s_3825276185.jpg "title=" qq20170826105608.jpg "alt=" Wkiol1mg402yv3r6aaatcbgdrv8885.jpg-wh_50 "/>
<2> p means create primary partition E means create extended partition, select Create partition 1, partition 2, etc.
650) this.width=650; "Src=" https://s3.51cto.com/wyfs02/M01/03/D0/wKiom1mg5IehPhLkAAAQgguD2F0436.jpg-wh_500x0-wm_ 3-wmp_4-s_359785242.jpg "title=" qq20170826105802.jpg "alt=" Wkiom1mg5iehphlkaaaqggud2f0436.jpg-wh_50 "/>
<3> Create the size of the partition, the partition size specified in the figure is 5G
650) this.width=650; "Src=" https://s1.51cto.com/wyfs02/M01/A2/81/wKioL1mg7DrzcchnAAAXdeiFmm0484.png-wh_500x0-wm_ 3-wmp_4-s_2244249317.png "title=" U]LGS2ZSD~6D3QH51PM5 (g1.png "alt=" wkiol1mg7drzcchnaaaxdeifmm0484.png-wh_50 "/ >
Comments:
If you do not specify a partition size, the default is to assign all to a partition
<4> w = Save partition Table
<5> viewing partition results with Fdisk-l
650) this.width=650; "Src=" https://s5.51cto.com/wyfs02/M01/03/D0/wKiom1mg7dOBS7_2AABttZ1bXko727.png-wh_500x0-wm_ 3-wmp_4-s_1468833213.png "title=" fsfg%_iazc9w)]ydh5ebi42.png "alt=" wkiom1mg7dobs7_2aabttz1bxko727.png-wh_50 "/ >
Comments:
<1> disk with 2 drives, SDA and SDB, respectively
(4) disk formatting
MKFS.EXT4/DEV/SDB1 formatting the first partition SDB1 of the SDB disk
MKFS.EXT4/DEV/SDB2 formatting the second partition SDB2 of the SDB disk
(5) partition mount
The partition of the disk is to be mounted on the directory to use
<1> We first create 2 directories mkdir data1 mkdir data2
<2> mount/dev/sdb1/data1 Mount/dev/sdb2/data2
<3> Df-h to see if the partition mount was successful
650) this.width=650; "Src=" https://s5.51cto.com/wyfs02/M02/A2/81/wKioL1mg8zjgkHpqAAAfxTNt-gc673.png-wh_500x0-wm_ 3-wmp_4-s_2613954875.png "title=" Ku[l ' l4ky{m47x ' 0z%) q_[w.png "alt=" wkiol1mg8zjgkhpqaaafxtnt-gc673.png-wh_50 "/ >
---------------------------------------------------------------------------------------
Unmount partition
UMOUNT/MNT Unloading partitions
This article is from the "Operation and maintenance of the Road" blog, please be sure to keep this source http://linuxzdq.blog.51cto.com/11196076/1959529
Linux Disk Management