parted command explanation
Usage: parted [options] ... [Device [command [parameters] ...] ...]
Apply the command with "parameters" to "Device". If the command is not given, it runs in interactive mode.
Help options:
-H,--help displays this help message
-L,--list lists all of the set partition information
-I,--interactive prompts the user when necessary
-S,--script never prompt the user
-V,--version display version
Operation Command:
Check MINOR #对文件系统进行一个简单的检查
CP [From-device] From-minor To-minor #将文件系统复制到另一个分区
Help [command] #打印通用求助信息, or information about the command
Mklabel label type #创建新的磁盘标签 (partition table)
MKFS MINOR File System type #在 MINOR Create a file system of type "file system type"
Mkpart partition Type [file system type] Start point termination point #创建一个分区
MKPARTFS partition type file system type start point termination point #创建一个带有文件系统的分区
Move MINOR start point end point #移动编号为 MINOR partition
Name MINOR name #将编号为 MINOR partition named "Names"
Print [MINOR] #打印分区表, or partition
Quit #退出程序
Rescue the missing partition of the start point #挽救临近 start point, end point
Resize MINOR start point end point #改变位于编号为 the size of the file system in the MINOR partition
RM MINOR #删除编号为 MINOR Partition
Select Device #选择要编辑的设备
Flag for SET MINOR flag State #改变编号为 MINOR partition
Operation Example:
(parted) represents the command entered in parted, other information that is automatically printed
1, first, similar to Fdisk, first select the hard disk to partition, here is/DEV/HDD:
[Email protected] ~]# PARTED/DEV/HDD
GNU Parted 1.8.1
Using/dev/hdd
Welcome to GNU parted! Type ' help ' to view a list of commands.
2, select/DEV/HDD as our operation of the disk, next need to create a partition table (in parted can use the help command to print assistance information):
(parted) Mklabel
Warning:the existing disk label ON/DEV/HDD is destroyed and all data on this disk would be lost. Want to continue?
Yes/no? (Warning the user that the data on the disk will be destroyed, ask whether to continue, we are a new disk here, enter Yes and return) Yes
New disk label type? [Msdos]? (The default is Msdos form of partition, we want to correctly partition the disk larger than 2TB, should use the GPT-mode partition table, enter the GPT after the return) GPT
3, create a good partition table, then you can partition operations, execute the mkpart command, enter the partition name, file system and the location of the partition
(parted) Mkpart
Partition name? []? Dp1
File system type? [Ext2]? Ext3
Start? 0
End? 500GB
4. You can print the partition information using the Print command after a good area, and here is a print sample
(parted) Print
Model:vbox harddisk (IDE)
Disk/dev/hdd:2199gb
Sector size (logical/physical): 512b/512b
Partition TABLE:GPT
Number Start End Size File system Name Flags
1 17.4kB 500GB 500GB DP1
5, if the partition is wrong, you can use the RM command to delete the partition, such as we want to delete the above partition, and then print the deleted results
(parted) RM 1 #rm后面使用分区的号码
(parted) Print
Model:vbox harddisk (IDE)
Disk/dev/hdd:2199gb
Sector size (logical/physical): 512b/512b
Partition TABLE:GPT
Number Start End Size File system Name Flags
6, according to the above method to the entire hard disk is divided into a good area, the following is a sample after completion
(parted) Mkpart
Partition name? []? Dp1
File system type? [Ext2]? Ext3
Start? 0
End? 500GB
(parted) Mkpart
Partition name? []? Dp2
File system type? [Ext2]? Ext3
Start? 500GB
End? 2199GB
(parted) Print
Model:vbox harddisk (IDE)
Disk/dev/hdd:2199gb
Sector size (logical/physical): 512b/512b
Partition TABLE:GPT
Number Start End Size File system Name Flags
1 17.4kB 500GB 500GB DP1
2 500GB 2199GB 1699GB DP2
7, because parted built MKFS is not perfect, so after completion we can use the QUIT command to exit parted and use the system's MKFS command to format the partition, if you use the Fdisk-l command to print the partition table will appear warning message, this is normal
[Email protected] ~]# fdisk-l
Warning:gpt (GUID Partition Table) detected on '/DEV/HDD '! The util Fdisk doesn ' t support GPT. Use GNU Parted.
disk/dev/hdd:2199.0 GB, 2199022206976 bytes
255 heads, Sectors/track, 267349 cylinders
Units = Cylinders of 16065 * 8225280 bytes
Device Boot Start End Blocks Id System
/DEV/HDD1 1 267350 2147482623+ ee EFI GPT
[Email protected] ~]# MKFS.EXT3/DEV/HDD1
[Email protected] ~]# MKFS.EXT3/DEV/HDD2
[Email protected] ~]# MKDIR/DP1/DP2
[Email protected] ~]# MOUNT/DEV/HDD1/DP1
[Email protected] ~]# MOUNT/DEV/HDD2/DP2
Profile: http://blog.csdn.net/wuweilong/article/details/7553200
Http://www.cnblogs.com/zhangpengme/archive/2011/12/29/2305963.html
Http://blog.chinaunix.net/uid-25057421-id-3503846.html
This article is from the "Boyhack" blog, make sure to keep this source http://461205160.blog.51cto.com/274918/1754538
parted command explanation