磁盘管理---分区---parted命令
实验举例:
[root@server254 devices]# parted /dev/sdb
(parted) help (parted) printModel: VMware, VMware Virtual S (scsi)Disk /dev/sdb: 42.9GBSector size (logical/physical): 512B/512BPartition Table: msdosNumber 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.9GBSector size (logical/physical): 512B/512BPartition Table: msdosNumber 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.9GBSector size (logical/physical): 512B/512BPartition 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.9GBSector size (logical/physical): 512B/512BPartition Table: msdosNumber 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.9GBSector size (logical/physical): 512B/512BPartition Table: msdosNumber Start End Size Type File system Flags
1 1049kB 200MB 199MB primary 2 200MB 2000MB 1799MB primary 3 2000MB 2013MB 13.6MB primaryPartition type? [logical]? logical File system type? [ext2]? ext4Start? 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.9GBSector size (logical/physical): 512B/512BPartition Table: msdosNumber 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 cylindersUnits = cylinders of 16065 * 512 = 8225280 bytesSector size (logical/physical): 512 bytes / 512 bytesI/O size (minimum/optimal): 512 bytes / 512 bytesDisk identifier: 0x000b6e12Device Boot Start End Blocks Id System
/dev/sdb1 1 25 194560 83 LinuxPartition 1 does not end on cylinder boundary./dev/sdb2 25 244 1757184 83 LinuxPartition 2 does not end on cylinder boundary./dev/sdb3 244 245 13312 83 LinuxPartition 3 does not end on cylinder boundary./dev/sdb4 246 1216 7797760 f W95 Ext'd (LBA)