Disk partitioning and file system creation and mounting under Linux CentOS
|
Browse:7994
|
Update:
2013-12-11 11:06
|
Tags:centos
The MBR (Master Boot Record) is a traditional partitioning mechanism that is applied to the vast majority of PC devices that use the BIOS.
1.MBR supports 32bit and 64bit systems
2.MBR limited number of supported partitions
3.MBR only supports hard drives up to 2T, more than 2T drives can only use 2T space (using other methods)
1. Primary partition: Up to 4 primary partitions can be created (available)
2. Extended partition: An extended partition occupies a primary partition location (not available, can be converted into logical partition)
3. Logical partitioning: Linux supports up to 63 IDE partitions and 15 SCSI partitions (available)
Fdisk Partitioning tool: Fdisk is an old partition tool from IBM that supports most operating systems, and almost all Linux distributions are equipped with FDISK, which is an MBR-based partitioning tool.
1. Go to root.
2. Enter Fdisk-l
disk/dev/sdb:8589 MB not partitioned in the figure, 8589934592 bytes
650) this.width=650; "Src=" http://hiphotos.baidu.com/exp/pic/item/8c511fe93901213fbb9021af56e736d12e2e95e6.jpg " class= "Pic-cursor-pointer" height= "285" width= "style=" border:0px;float:none;margin:0px auto 0px 54px; "alt=" 8c511fe93901213fbb9021af56e736d12e2e95e6 "/>
Is the newly mounted hard disk to be operated on.
3. Partition the SDB, enter: Fdisk/dev/sdb display input m to see help in the second picture below.
650) this.width=650; "Src=" http://hiphotos.baidu.com/exp/pic/item/d4239b35e5dde7119f712c85a5efce1b9c1661e6.jpg " class= "Pic-cursor-pointer" height= "213" width= "style=" border:0px;float:none;margin:0px auto 0px 54px; "alt=" D4239b35e5dde7119f712c85a5efce1b9c1661e6 "/>
650) this.width=650; "Src=" http://hiphotos.baidu.com/exp/pic/item/a6aed01b9d16fdfab984aa9db68f8c5495ee7b9d.jpg " class= "Pic-cursor-pointer" height= "346" width= "380" style= "border:0px;float:none;margin:0px auto 0px 114px;" alt= " a6aed01b9d16fdfab984aa9db68f8c5495ee7b9d "/>
n Create a new partition
p View current partition
W Save changes and exit
Enter P return (this time to create a primary partition)
Enter the partition number, enter 1 to return the car
then return .
set the size of this partition (for example, enter +5g; unit k,m,g) and return to
650) this.width=650; "Src=" http://hiphotos.baidu.com/exp/pic/item/ 5202e5f2b21193135b6890c367380cd791238d5f.jpg "class=" Pic-cursor-pointer "height=" "width=" "style=" border:0 px;float:none;margin:0px auto 0px 54px; "alt=" 5202e5f2b21193135b6890c367380cd791238d5f "/>
enter P return to show that a primary partition has been seen.
650) this.width=650; "Src=" http://hiphotos.baidu.com/exp/pic/item/5f9e93b1cb1349542ef68417544e9258d0094a9d.jpg " class= "Pic-cursor-pointer" height= "213" width= "style=" border:0px;float:none;margin:0px auto 0px 54px; "alt=" 5f9e93b1cb1349542ef68417544e9258d0094a9d "/>
Create an extended partition:
P style= "margin-top:0px;margin-bottom:25px;padding:0px;" > Enter n return Enter e carriage return
Enter the partition number, Enter 2 return car (1 area code has been used previously)
return to
Enter the size of the extended partition to be allocated (if you want to use all remaining space, you do not need to enter, direct carriage)
650) this.width=650; "Src=" http://hiphotos.baidu.com/exp/pic/item/a28d62d98d1001e938167b7cba0e7bec54e7975f.jpg " class= "Pic-cursor-pointer" height= "195" width= "style=" border:0px;float:none;margin:0px auto 0px 54px; "alt=" a28d62d98d1001e938167b7cba0e7bec54e7975f "/>
Enter p to display the partition
650) this.width=650; "Src=" http://hiphotos.baidu.com/exp/pic/item/2e6fa7389b504fc2de75df76e7dde71190ef6d5f.jpg " class= "Pic-cursor-pointer" height= "223" width= "style=" border:0px;float:none;margin:0px auto 0px 54px; "alt=" 2e6fa7389b504fc2de75df76e7dde71190ef6d5f "/>
650) this.width=650; "Src=" http://hiphotos.baidu.com/exp/pic/item/b3508d13b07eca808e6d5094932397dda144831e.jpg " class= "Pic-cursor-pointer" height= "182" width= "style=" border:0px;float:none;margin:0px auto 0px 54px; "alt=" b3508d13b07eca808e6d5094932397dda144831e "/>
---------------------------------------------------------------------------
650) this.width=650; "Src=" http://hiphotos.baidu.com/exp/pic/item/b0742dfa828ba61e9006a45c4334970a314e599d.jpg " class= "Pic-cursor-pointer" height= "243" width= "style=" border:0px;float:none;margin:0px auto 0px 54px; "alt=" b0742dfa828ba61e9006a45c4334970a314e599d "/>
Save Settings:
Enter W return, which shows the end of the following partition.
650) this.width=650; "Src=" http://hiphotos.baidu.com/exp/pic/item/ea85a94543a982264c6742548882b9014b90ebe4.jpg " class= "Pic-cursor-pointer" height= "111" width= "354" style= "border:0px;float:none;margin:0px auto 0px 127px;" alt= " Ea85a94543a982264c6742548882b9014b90ebe4 "/>
650) this.width=650; "Src=" http://hiphotos.baidu.com/exp/pic/item/aa59892bd40735fa806827ca9c510fb30e2408ed.jpg " class= "Pic-cursor-pointer" height= "243" width= "style=" border:0px;float:none;margin:0px auto 0px 54px; "alt=" Aa59892bd40735fa806827ca9c510fb30e2408ed "/>
The operating system manages files and data through the file system, the disk or partition needs to create a file system before it can be used for the operating system, and the process of creating a file system is called formatting.
Input: Mke2fs-t ext4/dev/sdb1 (Create file system for SDB1 primary partition with command MKE2FS)
Input: Mke2fs-t EXT4/DEV/SDB5 (Create file system for SDB5 logical partition)
650) this.width=650; "Src=" http://hiphotos.baidu.com/exp/pic/item/f76575600c33874426ec470f530fd9f9d72aa05d.jpg " class= "Pic-cursor-pointer" height= "385" width= "style=" border:0px;float:none;margin:0px auto 0px 54px; "alt=" f76575600c33874426ec470f530fd9f9d72aa05d "/>
-------------------------------------------------------------------------
650) this.width=650; "Src=" http://hiphotos.baidu.com/exp/pic/item/373bc4b44aed2e731f16ef5f8501a18b86d6fa83.jpg " class= "Pic-cursor-pointer" height= "382" width= "style=" border:0px;float:none;margin:0px auto 0px 54px; "alt=" 373bc4b44aed2e731f16ef5f8501a18b86d6fa83 "/>
650) this.width=650; "Src=" http://hiphotos.baidu.com/exp/pic/item/d872d695d143ad4bbe0d2eb380025aafa40f0666.jpg " class= "Pic-cursor-pointer" height= "334" width= "style=" border:0px;float:none;margin:0px auto 0px 54px; "alt=" d872d695d143ad4bbe0d2eb380025aafa40f0666 "/>
This article from "Dongdong Homeland" blog, declined reprint!
Disk partitioning and file system creation and mounting under Linux CentOS