码迷,mamicode.com
首页 > 系统相关 > 详细

Linux运维系统工程师系列---21

时间:2015-07-02 08:43:42      阅读:204      评论:0      收藏:0      [点我收藏+]

标签:linux运维 磁盘管理 分区 parted

磁盘管理---分区---parted命令

    实验举例:

        

[root@server254 devices]# parted /dev/sdb
(parted) help


(parted) print
Model: VMware, VMware Virtual S (scsi)
Disk /dev/sdb: 42.9GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos

Number  Start   End    Size   Type     File system  Flags
 1      32.3kB  214MB  214MB  primary
(parted) print                                                           
Model: VMware, VMware Virtual S (scsi)
Disk /dev/sdb: 42.9GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos

Number  Start  End  Size  Type  File system  Flags

(parted) mkpart     

 
     创建分区 :                                                   
Partition type?  primary/extended? primary                               
File system type?  [ext2]? ext4                                          
Start? 1                                                                 
End? 200M                                                                
(parted) print                                                           
Model: VMware, VMware Virtual S (scsi)
Disk /dev/sdb: 42.9GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos

Number  Start   End    Size   Type     File system  Flags
 1      1049kB  200MB  199MB  primary

(parted) mkpart                                                          
Partition type?  primary/extended? primary                               
File system type?  [ext2]? ext4                                          
Start?                                                                   
Start? 200M                                                              
End? 2000M                                                               
(parted) print                                                           
Model: VMware, VMware Virtual S (scsi)
Disk /dev/sdb: 42.9GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos

Number  Start   End     Size    Type     File system  Flags
 1      1049kB  200MB   199MB   primary
 2      200MB   2000MB  1799MB  primary

(parted) mkpart                                                          
Partition type?  primary/extended? p                                     
File system type?  [ext2]? ext4                                          
Start? 2000M                                                             
End? 2013M                                                               
(parted) print                                                           
Model: VMware, VMware Virtual S (scsi)
Disk /dev/sdb: 42.9GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos

Number  Start   End     Size    Type     File system  Flags
 1      1049kB  200MB   199MB   primary
 2      200MB   2000MB  1799MB  primary
 3      2000MB  2013MB  13.6MB  primary
Partition type?  [logical]? logical                                      
File system type?  [ext2]? ext4
Start? 2015M                                                             
End? 2200M                                                               
Warning: The resulting partition is not properly aligned for best performance.
Ignore/Cancel? Ignore                                                    
(parted) print                                                           
Model: VMware, VMware Virtual S (scsi)
Disk /dev/sdb: 42.9GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos

Number  Start   End     Size    Type      File system  Flags
 1      1049kB  200MB   199MB   primary
 2      200MB   2000MB  1799MB  primary
 3      2000MB  2013MB  13.6MB  primary
 4      2015MB  10.0GB  7985MB  extended               lba
 5      2015MB  2200MB  185MB   logical

(parted) rm 5     
(parted) quit

     
[root@server254 devices]# fdisk -l /dev/sdb

 

Disk /dev/sdb: 42.9 GB, 42949672960 bytes
255 heads, 63 sectors/track, 5221 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000b6e12

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1          25      194560   83  Linux
Partition 1 does not end on cylinder boundary.
/dev/sdb2              25         244     1757184   83  Linux
Partition 2 does not end on cylinder boundary.
/dev/sdb3             244         245       13312   83  Linux
Partition 3 does not end on cylinder boundary.
/dev/sdb4             246        1216     7797760    f  W95 Ext‘d (LBA)

 

本文出自 “空谷幽兰” 博客,请务必保留此出处http://2489843.blog.51cto.com/2479843/1669946

Linux运维系统工程师系列---21

标签:linux运维 磁盘管理 分区 parted

原文地址:http://2489843.blog.51cto.com/2479843/1669946

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!