cakin24 阅读(40) 评论(0)
一 分区模式之MBR
1、主分区不超过4个
2、单个分区容量最大2TB
 
二 分区模式之GPT
1、主分区个数“几乎”没有限制。
在GPT的分区表中最多支持128个主分区。
2、单个分区容量“几乎”没有限制。
在GPT的分区模式中,每个分区的大小突破了MBR分区2TB限制。
75.png
 
三 实战
[root@localhost ~]# parted
GNU Parted 3.1
Using /dev/sda
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) help
align-check TYPE N check partition N for TYPE(min|opt)
alignment
help [COMMAND] print general help, or help on COMMAND
mklabel,mktable LABEL-TYPE create a new disklabel (partition
table)
mkpart PART-TYPE [FS-TYPE] START END make a partition
name NUMBER NAME name partition NUMBER as NAME
print [devices|free|list,all|NUMBER] display the partition table, available
devices, free space, all found partitions, or a particular partition
quit exit program
rescue START END rescue a lost partition near START and
END
rm NUMBER delete partition NUMBER
select DEVICE choose the device to edit
disk_set FLAG STATE change the FLAG on selected device
disk_toggle [FLAG] toggle the state of FLAG on selected
device
set NUMBER FLAG STATE change the FLAG on partition NUMBER
toggle [NUMBER [FLAG]] toggle the state of FLAG on partition
NUMBER
unit UNIT set the default unit to UNIT
version display the version number and
copyright information of GNU Parted
(parted) select /dev/sdc
Using /dev/sdc
(parted) mklabel gpt
(parted) print
Model: ATA VBOX HARDDISK (scsi)
Disk /dev/sdc: 8590MB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags:
 
Number Start End Size File system Name Flags
 
(parted) print all
Model: ATA VBOX HARDDISK (scsi)
Disk /dev/sda: 107GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags:
 
Number Start End Size Type File system Flags
1 1049kB 525MB 524MB primary xfs boot
2 525MB 32.7GB 32.2GB primary xfs
3 32.7GB 54.2GB 21.5GB primary xfs
4 54.2GB 107GB 53.2GB extended
5 54.2GB 65.0GB 10.7GB logical xfs
6 65.0GB 69.2GB 4295MB logical linux-swap(v1)
7 69.2GB 107GB 38.1GB logical xfs
 
 
Model: ATA VBOX HARDDISK (scsi)
Disk /dev/sdb: 8590MB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags:
 
Number Start End Size Type File system Flags
1 1049kB 3147MB 3146MB primary
2 3147MB 6368MB 3221MB primary
3 6368MB 8590MB 2222MB extended
5 6369MB 7443MB 1074MB logical
6 7444MB 8590MB 1146MB logical
 
 
Model: ATA VBOX HARDDISK (scsi)
Disk /dev/sdc: 8590MB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags:
 
Number Start End Size File system Name Flags
 
 
(parted) mkpart
Partition name? []? A
File system type? [ext2]?
Start? 0
End? 2000
Warning: The resulting partition is not properly aligned for best performance.
Ignore/Cancel? Cancel
(parted) mkpart
Partition name? []?
File system type? [ext2]?
Start? 1
End? 2000
(parted) print
Model: ATA VBOX HARDDISK (scsi)
Disk /dev/sdc: 8590MB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags:
 
Number Start End Size File system Name Flags
1 1049kB 2000MB 1999MB
 
(parted) mkpart test 2000 3000
(parted) print
Model: ATA VBOX HARDDISK (scsi)
Disk /dev/sdc: 8590MB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags:
 
Number Start End Size File system Name Flags
1 1049kB 2000MB 1999MB
2 2000MB 3000MB 1000MB test
 
(parted) mkpart abc 2500 3500
Warning: You requested a partition from 2500MB to 3500MB (sectors
4882812..6835937).
The closest location we can manage is 3000MB to 3500MB (sectors
5859328..6835937).
Is this still acceptable to you?
Yes/No? yes
(parted) print
Model: ATA VBOX HARDDISK (scsi)
Disk /dev/sdc: 8590MB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags:
 
Number Start End Size File system Name Flags
1 1049kB 2000MB 1999MB
2 2000MB 3000MB 1000MB test
3 3000MB 3500MB 500MB abc
 
(parted) rm 3
(parted) print
Model: ATA VBOX HARDDISK (scsi)
Disk /dev/sdc: 8590MB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags:
 
Number Start End Size File system Name Flags
1 1049kB 2000MB 1999MB
2 2000MB 3000MB 1000MB test
 
(parted) mkpart abc 3000 4000
(parted) print
Model: ATA VBOX HARDDISK (scsi)
Disk /dev/sdc: 8590MB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags:
 
Number Start End Size File system Name Flags
1 1049kB 2000MB 1999MB
2 2000MB 3000MB 1000MB test
3 3000MB 4000MB 1000MB abc
 
(parted) mkpart aa 4000 5000
(parted) mkpart bb 5000 6000
(parted) print
Model: ATA VBOX HARDDISK (scsi)
Disk /dev/sdc: 8590MB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags:
 
Number Start End Size File system Name Flags
1 1049kB 2000MB 1999MB
2 2000MB 3000MB 1000MB test
3 3000MB 4000MB 1000MB abc
4 4000MB 5000MB 999MB aa
5 5000MB 6000MB 1000MB bb
 
(parted) unit GB
(parted) quit
Information: You may need to update /etc/fstab.