VMware Workstation虚拟机linux操作系统添加硬盘(Centos5.5)的简单教程

来源:互联网 发布:玉帝 天帝知乎 编辑:程序博客网 时间:2024/05/17 03:04

首先打开虚拟机设置,点击添加。


然后在弹出的添加硬件向导里面选择硬盘,然后“下一步”。


后面几个选项一般情况使用默认即可,最后设置好要添加的硬盘大小,完成后如下图所示。


这个时候虽然虚拟机已经给操作系统分配了硬盘的空间,但是我们还需要在linux系统中创建分区表。

启动我们的虚拟机。

这里我们需要用到一个分区工具叫Fdisk。Fdisk支持绝大多数操作系统,几乎所有的Linux操作系统都默认装有fdisk。

另外值得一提的是,使用fdisk指令需要root超级管理员的权限,可以使用“su -”切换到root用户。

在终端中输入以下指令:

fdisk /dev/sdb

(默认原来的硬盘名叫sda,新添加的会被命名为sdb,sdc,以此类推。。。)

会出现一堆提示,让你选择接下来的操作,输入m可以查看所有指令,

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 action  e   extended  p   primary partition (1-4)  

输入p,  创建主分区(主分区可以创建1到4个)

输入编号1

然后输入Cylinder数量,(计算公式:比如要分配的容量如2G(2048000000bytes)=XCylinder*63sectors*255heads*512bytes)

如果全部使用那就输入默认值即可。

最后输入w。

Command (m for help): w  The partition table has been altered!    Calling ioctl() to re-read partition table.  Syncing disks.

这样就为虚拟机里的linux操作系统增加了新的硬盘。









0 0
原创粉丝点击