Disk /dev/xvda: 8589 MB, 8589934592 bytes 255 heads, 63 sectors/track, 1044 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Device Boot Start End Blocks Id System /dev/xvda1 * 1 13 104391 83 Linux /dev/xvda2 14 1044 8281507+ 8e Linux LVM Disk /dev/xvdb: 23.6 GB, 23622320128 bytes 255 heads, 63 sectors/track, 2871 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Device Boot Start End Blocks Id System 我们可以看到/dev/xvdb容量有23.6G,而且没有分区,接下来我们对它进行分区和挂载 好,现在我们直接输入命令对xvdb进行分区:
复制代码代码如下: fdisk /dev/xvdb
进入fdisk命令模式,输入m查看所有命令解释。我们要用到主要是 n 命令,创建一个分区:
复制代码代码如下: Command (m for help): n
出现提示: Command action e extended p primary partition (1-4) p 有两个命令选择:e(创建扩展分区),p(创建主分区) 我直接选择了P /dev/xvdb中第1个分区
复制代码代码如下:Partition number (1-4): 1 First cylinder (1-2871, default 1):(enter:回车) Using default value 1 Last cylinder or +size or +sizeM or +sizeK (1-2871, default 2871):(enter:回车) Using default value 2871 输入W保存退出
复制代码代码如下:Command (m for help): w The partition table has been altered! Calling ioctl() to re-read partition table. Syncing disks. 通过上述步骤我们已将/dev/xvdb分区完成,下面我们对分区格式化并进行挂载