fdisk -l 查看分区状况,也可查看指定分区
Disk /dev/sda: 21.5 GB, 21474836480 bytes 255 heads, 63 sectors/track, 2610 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: 0x0009ec81
Device Boot Start End Blocks Id System /dev/sda1 * 1 13 102400 83 Linux Partition 1 does not end on cylinder boundary. /dev/sda2 13 274 2097152 82 Linux swap / Solaris Partition 2 does not end on cylinder boundary. /dev/sda3 274 2611 18770944 83 Linux
///////////////////////////////////////////////////////////////////////////////////////////////
添加虚拟磁盘
#init 0
编辑虚拟机设置 - 添加 - 硬盘 -下一步 - scsi - 创建新的虚拟磁盘 - 磁盘大小10G - 将虚拟磁盘存储为单个文件 - 完成 - 确定 - 开机。
///////////////////////////////////////////////////////////////////////////////////////////////////////
给虚拟磁盘分区
#fdisk -l
两个磁盘 给新的磁盘分区
#fdisk /dev/sdb
磁盘大小大于两个T,使用parted /dev/sdb m 查看可使用的指令 p 打印当前分区列表
n 创建新的分区
选择不同的分区类型 e是扩展分区 p是主分区
Command (m for help): n
Command action
e extended
p primary pa
p
Partition number (1-4): 1 First cylinder (1-1305, default 1): 1 Last cylinder, +cylinders or +size{K,M,G} (1-1305, default 1305): +2G
//////////////////////////////////////////////////////////////////////////////////////////
Command (m for help): p
Disk /dev/sdb: 10.7 GB, 10737418240 bytes 255 heads, 63 sectors/track, 1305 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: 0xfae59dbe
Device Boot Start End Blocks Id System
/dev/sdb1 1 262 2104483+ 83 Linux
/////////////////////////////////////////////////////////////////////////////////////////////
Command (m for help): n
Command action
e extended
p primary partition (1-4)
e
Partition number (1-4): 2
First cylinder (263-1305, default 263):
Using default value 263
Last cylinder, +cylinders or +size{K,M,G} (263-1305, default 1305): +5G
//////////////////////////////////////////////////////////////////////////////////////////////
Device Boot Start End Blocks Id System
/dev/sdb1 1 262 2104483+ 83 Linux
/dev/sdb2 263 916 5253255 5 Extended
////////////////////////////
Command (m for help): n
Command action
l logical (5 or over)
p primary partition (1-4)
l
First cylinder (263-916, default 263):
Using default value 263 Last cylinder, +cylinders or +size{K,M,G} (263-916, default 916): +2G
//////////////////////////////////////////////////////////////////////////////////
Command (m for help): p
Disk /dev/sdb: 10.7 GB, 10737418240 bytes 255 heads, 63 sectors/track, 1305 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: 0xfae59dbe
Device Boot Start End Blocks Id System
/dev/sdb1 1 262 2104483+ 83 Linux
/dev/sdb2 263 916 5253255 5 Extended
/dev/sdb5 263 524 2104483+ 83 Linux
///////////////////////////////////////////////////////////////////////
wq保存退出