1. 在虚拟机下再添加一块硬盘,在vm菜单setting里面添加硬盘
添加一块SCSI的8G的虚拟硬盘,在linux下是shb,b表示第2个的意思
然后我们进入终端模式
输入fdisk /dev/sdb
出现Unable to open /dev/sdb
要确保VM setting-->hardware中出现:hard disk 2
fdisk /dev/sdb
若正确会提示
The number of cylinders for this disk is set to 1044.
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
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)
输入n创建分区
Command (m for help): n
Command action
e extended
p primary partition (1-4)
e是创建扩展分区
p是创建主分区
输入p
Partition number (1-4): 1 回车
First cylinder (1-1044, default 1): 1/起始柱头
Last cylinder or +size or +sizeM or +sizeK (1-1044, default 1044): 1044//终点
柱头
Command (m for help): w
输入w保存退出
2. 格式化
mkfs -t ext3 /dev/sdb1或者mkfs.ext3 /dev/sdb1格式化
3. 挂载分区
mkdir /usr/newspace
mount /dev/sdb1 /usr/newspace
df
(df命令是查看)
添加一块SCSI的8G的虚拟硬盘,在linux下是shb,b表示第2个的意思
然后我们进入终端模式
输入fdisk /dev/sdb
出现Unable to open /dev/sdb
要确保VM setting-->hardware中出现:hard disk 2
fdisk /dev/sdb
若正确会提示
The number of cylinders for this disk is set to 1044.
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
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)
输入n创建分区
Command (m for help): n
Command action
e extended
p primary partition (1-4)
e是创建扩展分区
p是创建主分区
输入p
Partition number (1-4): 1 回车
First cylinder (1-1044, default 1): 1/起始柱头
Last cylinder or +size or +sizeM or +sizeK (1-1044, default 1044): 1044//终点
柱头
Command (m for help): w
输入w保存退出
2. 格式化
mkfs -t ext3 /dev/sdb1或者mkfs.ext3 /dev/sdb1格式化
3. 挂载分区
编辑/etc/fstab文件,加入下面的内容
/dev/sdb1 /usr/newspace ext3 defaults 1 1
mkdir /usr/newspace
mount /dev/sdb1 /usr/newspace
df
(df命令是查看)