最近在虚拟机下玩oracle,磁盘空间严重不足,没办法只得增加硬盘
步骤如下:
1:
先将虚拟机Power Off,在VM选项下面有一个Setting选项,点击打开一个对话框里,点击左下角的“Add”,选择“Hard Disk”,之后选择“Create a new virtual disk”,按提示下一步就行了,
注:分配容量时,把split disk into 2GB files选中
2:
启动虚拟机系统,用root登陆,在 命令行用fdisk -l查看是否识别了新硬盘,如果添加的是IDE硬盘,就应该看到hdb,如果是SCSI硬盘,看到的就应该是sdb。
[root@oracle10g ~]# fdisk -l
[root@oracle10g ~]# fdisk -l
Disk /dev/sda: 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/sda1 * 1 913 7333641 83 Linux
/dev/sda2 914 1044 1052257+ 82 Linux swap
Disk /dev/sdb: 8589 MB, 8589934592 bytes
255 heads, 63 sectors/track, 1044 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk /dev/sdb doesn't contain a valid partition table
3:
使用fdisk /dev/sdb,在出现的选项中选择“w”,即将分区表写入硬盘并退出,这时再用fdisk -l查看就会发现:
Disk /dev/sdb: 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
4:用mkfs命令将其格式化,mkfs /dev/sdb
5:用mount命令将其挂载,mount -t ext2 /dev/sdb /home
6:查看磁盘空间
[root@oracle10g ~]# df -h
Filesystem 容量 已用 可用 已用% 挂载点
/dev/sda1 6.9G 6.2G 385M 95% /
none 252M 0 252M 0% /dev/shm
/dev/sdb 7.9G 18M 7.5G 1% /home
7:成功完成
阅读(1104) | 评论(0) | 转发(0) |