[root@localhost ~]# fdisk -l
磁盘 /dev/sda:53.7 GB, 53687091200 字节,104857600 个扇区
Units = 扇区 of 1 * 512 = 512 bytes
扇区大小(逻辑/物理):512 字节 / 512 字节
I/O 大小(最小/最佳):512 字节 / 512 字节
磁盘标签类型:dos
磁盘标识符:0x000ddde7
设备 Boot Start End Blocks Id System
/dev/sda1 * 2048 2099199 1048576 83 Linux
/dev/sda2 2099200 104857599 51379200 8e Linux LVM
磁盘 /dev/mapper/centos-root:48.4 GB, 48444211200 字节,94617600 个扇区
Units = 扇区 of 1 * 512 = 512 bytes
扇区大小(逻辑/物理):512 字节 / 512 字节
I/O 大小(最小/最佳):512 字节 / 512 字节
磁盘 /dev/mapper/centos-swap:4160 MB, 4160749568 字节,8126464 个扇区
Units = 扇区 of 1 * 512 = 512 bytes
扇区大小(逻辑/物理):512 字节 / 512 字节
I/O 大小(最小/最佳):512 字节 / 512 字节
2. 使用fdisk进行分区
[root@localhost ~]# fdisk /dev/sdb
欢迎使用 fdisk(util-linux 2.23.2)。
更改将停留在内存中,直到您决定将更改写入磁盘。
使用写入命令前请三思。
Device does not contain a recognized partition table
使用磁盘标识符 0xbe5f2f34 创建新的 DOS 磁盘标签。
命令(输入 m 获取帮助):m
命令操作
a toggle a bootable flag
#设置可引导标记
b edit bsd disklabel
#设置bsd磁盘标签
c toggle the dos compatibility flag
#设置DOS操作系统兼容标记
d delete a partition
#删除一个分区
g create a new empty GPT partition table
#创建一个新的空GPT分区表
G create an IRIX (SGI) partition table
#创建一个IRIX (SGI)分区表
l list known partition types
#显示已知的文件系统类型