一个物理设备是不能够直接被linux系统所识别的。要想能够在磁盘中写入和读取数据。我们得先执行以下步骤。
创建一个普通分区
1.添加磁盘 这一步在虚拟机中可以直接点击添加,不多赘述。
2.分区
在linux系统中 fdisk命令用来管理硬盘。下面我们介绍下这个命令的用法
格式为“fdisk [磁盘名称]”,它提供了集添加、删除、转换分区等功能于一身的“一站式分区服务”,这个命令的参数是交互式的
[root@localhost ~]# fdisk /dev/sdb
Welcome to fdisk (util-linux 2.23.2).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.
Device does not contain a recognized partition table
Building a new DOS disklabel with disk identifier 0x7bb9231c.
Command (m for help): m
Command action
a toggle a bootable flag
b edit bsd disklabel
c toggle the dos compatibility flag
d delete a partition
g create a new empty GPT partition table
G create an IRIX (SGI) partition table
l list known partition types
m print this menu
n add a new partition
o create a new empty DOS partition table
p print the partition table
q quit without saving changes
s create a new empty Sun disklabel
t change a partition's system id
u change display/entry units
v verify the partition table
w write table to disk and exit
x extra functionality (experts only)
Command (m for help): n //添加一个新的分区
Partition type:
p primary (0 primary, 0 extended, 4 free)
e extended
Select (default p): p //选择创建主分区 分区号默认是1
Partition number (1-4, default 1): 1
First sector (2048-41943039, de