linux 磁盘分区parted

Parted分区
Parted(分区工具)
要支持大容量,需改用gpt分区模式(只有),可以有128个主分区
[root@server0 /]# parted /dev/vdb                    #
GNU Parted 3.1
使用 /dev/vdb
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) mktable gpt                     #指定分区模式
(parted) print                             #输出所有分区模式                                   
Model: Virtio Block Device (virtblk)
Disk /dev/vdb: 10.7GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags: 
Number  Start  End  Size  File system  Name  标志
(parted) mkpart                        #划分新的分区
分区名称?  []? haha                    #分区的名字                            
文件系统类型?  [ext2]? ext4            #分区的文件系统格式,不起实际作用
起始点? 0                              #起始点,第一个分区起始点为0                                
结束点? 4G                            #结束点                                  
警告: The resulting partition is not properly aligned for best performance.
忽略/Ignore/放弃/Cancel? Ignore         #忽略                                    
(parted) print                            #输出所有分区信息
Model: Virtio Block Device (virtblk)
Disk /dev/vdb: 10.7GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags: 
Number  Start   End     Size    File system  Name  标志
 1      17.4kB  4000MB  4000MB               haha
(parted) unit GB                          #设置显示单位                                
(parted) print                             #输出所有分区信息                              
Model: Virtio Block Device (virtblk)
Disk /dev/vdb: 10.7GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags: 
Number  Start   End     Size    File system  Name  标志
 1      0.00GB  4.00GB  4.00GB               haha
(parted) quit                                                             
信息: You may need to update /etc/fstab.
[root@server0 /]# parted /dev/vdb                    #
(parted) mkpart                                                           
分区名称?  []? haha
文件系统类型?  [ext2]? ext4
起始点? 4G                                                               
结束点? 8G                                                               
(parted) print                                                            
Model: Virtio Block Device (virtblk)
Disk /dev/vdb: 10.7GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags: 
Number  Start   End     Size    File system  Name  标志
 1      0.00GB  4.00GB  4.00GB               haha
 2      4.00GB  8.00GB  4.00GB               haha
(parted) quit                                                             
信息: You may need to update /etc/fsta

猜你喜欢

转载自blog.csdn.net/yuefei169/article/details/81332283