VMware下LINUX的虚拟机增加磁盘空间(绝对有用!!!!)

上传人:s9****2 文档编号:477680343 上传时间:2022-11-10 格式:DOCX 页数:4 大小:15.07KB
返回 下载 相关 举报
VMware下LINUX的虚拟机增加磁盘空间(绝对有用!!!!)_第1页
第1页 / 共4页
VMware下LINUX的虚拟机增加磁盘空间(绝对有用!!!!)_第2页
第2页 / 共4页
VMware下LINUX的虚拟机增加磁盘空间(绝对有用!!!!)_第3页
第3页 / 共4页
VMware下LINUX的虚拟机增加磁盘空间(绝对有用!!!!)_第4页
第4页 / 共4页
亲,该文档总共4页,全部预览完了,如果喜欢就下载吧!
资源描述

《VMware下LINUX的虚拟机增加磁盘空间(绝对有用!!!!)》由会员分享,可在线阅读,更多相关《VMware下LINUX的虚拟机增加磁盘空间(绝对有用!!!!)(4页珍藏版)》请在金锄头文库上搜索。

1、VMware下LINUX的虚拟机增加磁盘空间Linux 2010-04-16 11:20:43阅读83评论0字号:大中小VMware6.7 安装目录 下有一个命令行工具 vmware-vdiskmanager.exe 程序,可用来修改虚拟机硬盘的大小。方法如下:方法一:1. 关闭虚拟机;启动 Windows 下的命令提示符界面 ;2.命令进入VMware的安装目录(如:D:VMware),输入vmware-vdiskmanager”后按回车键,可显示关于该命令的说明。3. 执行如下命令: vmware-vdiskmanager -x 15Gb G:VMware SpaceRed Hat Ent

2、erprise Linux5.vmdk 参数-x表示要扩展虚拟机硬盘空间;紧随其后的数字指要扩展的大小(如15Gb,表示磁盘总量,包 含原来的磁盘容量);最后是要操作的虚拟机Linux的具体文件。若路径名中有空格,必须以双引号括起来。等待约10分钟,执行完毕,退出命令提示符窗口,重启VMware,这时虚拟机硬盘空间已变成15GB了。这个过程中,已安装的 Linux 系统不会被破坏。如果原来的虚拟机硬盘已被分成了多个分区,那么在通过vmware-vdiskmanager.exe扩大了硬盘空间后,还需要在虚拟机系统中将增加的分区划分、格式化。方法二:先关闭虚拟机电源,做如下设置: “ 虚拟机”-“

3、虚拟机设置”-“应用实例”-“增加磁盘空间”,可以随意添加你需要增到到的磁盘大小(如15Gb,表示磁盘总量,包含原来的磁盘容量);再重启电源进入系统做如下步骤设置。4. 启动虚拟机系统 用root登录(后续所有步骤都应以root用户身份登录操作),在 命令行用fdisk -I查看。 由于这里是直接修改了原始空间大小,因此可以看到/dev/sda空间改变为16.1GB(原磁盘空间从10G增加 到15G)。如果是从VMware菜单里增加虚拟硬盘,则会多出一个/dev/sd?,这里的?代表硬盘编号,第一 个硬盘编号为a即sda,第二个就是sdb,第三个是sdc,以此类推,一般来说 如果以前没有增加过

4、硬盘, 那么原来的硬盘就是sda通过VMware菜单增加的虚拟硬盘编号就是sdb。如果添加的第二块硬盘是IDE硬盘,就应该看到hdb,如果是SCSI硬盘,看到的就应该是sdb。5. 使用fdisk /dev/sda进入菜单项,m是列出菜单,p是列出分区表,n是增加分区,w是保存并推出。由于这里增加的磁盘只有5G,因此5G划为一个区。rootIocaIhost # fdisk -IDisk /dev/sda: 16.1 GB, 16106127360 bytes255 heads, 63 sectors/track, 1958 cyIindersUnits = cyIinders of 1606

5、5 * 512 = 8225280 bytesDevice Boot StartEndBlocks Id System/dev/sda1 * 113104391 83 Linux/dev/sda2 14 1305 10377990 8e Linux LVMrootlocalhost # fdisk /dev/sdaThe number of cylinders for this disk is set to 1958.There is nothing wrong with that, but this is larger than 1024,and could in certain setup

6、s cause problems with:1) software that runs at boot time (e.g., old versions of LILO)2) booting and partitioning software from other OSs(e.g., DOS FDISK, OS/2 FDISK)Command (m for help): pDisk /dev/sda: 16.1 GB, 16106127360 bytes255 heads, 63 sectors/track, 1958 cylindersUnits = cylinders of 16065 *

7、 512 = 8225280 bytesDevice Boot StartEndBlocks Id System/dev/sda1 * 113104391 83 Linux/dev/sda2 14 1305 10377990 8e Linux LVMCommand (m for help): nCommand actione extendedp primary partition (1-4)pPartition number (1-4): 3First cylinder (1306-1958, default 1306): +1306Last cylinder or +size or +siz

8、eM or +sizeK (1306-1958, default 1958): +1958Value out of range.Last cylinder or +size or +sizeM or +sizeK (1306-1958, default 1958):Using default value 1958Command (m for help): pDisk /dev/sda: 16.1 GB, 16106127360 bytes255 heads, 63 sectors/track, 1958 cylindersUnits = cylinders of 16065 * 512 = 8

9、225280 bytesDevice Boot StartEndBlocks Id System/dev/sda1 * 113104391 83 Linux/dev/sda2 14 1305 10377990 8e Linux LVM/dev/sda3 1306 1958 5245222+ 83 LinuxCommand (m for help): wThe partition table has been altered!Calling ioctl() to re-read partition table.WARNING: Re-reading the partition table fai

10、led with error 16: 设备或资源忙.The kernel still uses the old table.The new table will be used at the next reboot.Syncing disks./dev/sda3 1306 1958 5245222+ 83 Linuxrootlocalhost # reboot#需 reboot 一下机器继续如下步骤rootlocalhost # df -h#挂载前的分区情况文件系统 容量 已用 可用 已用% 挂载点/dev/mapper/VolGroup00-LogVol008.6G 2.8G 5.4G 35

11、% /dev/sda1 99M 12M 82M 13% /boottmpfs 125M 0 125M 0% /dev/shm6. 使用 mkfs.ext3 /dev/sda3 格式化分区rootlocalhost # mkfs.ext3 /dev/sda3mke2fs 1.39 (29-May-2006)Filesystem label=OS type: LinuxBlock size=4096 (log=2)Fragment size=4096 (log=2)656000 inodes, 1311305 blocks65565 blocks (5.00%) reserved for the

12、super userFirst data block=0Maximum filesystem blocks=134637158441 block groups32768 blocks per group, 32768 fragments per group16000 inodes per groupSuperblock backups stored on blocks:32768, 98304, 163840, 229376, 294912, 819200, 884736Writing inode tables: doneCreating journal (32768 blocks): don

13、eWriting superblocks and filesystem accounting information: doneThis filesystem will be automatically checked every 31 mounts or180 days, whichever comes first. Use tune2fs -c or -i to override.rootlocalhost # cd /rootlocalhost /# mkdir /cm#增加一个/cmrootlocalhost /# mount /dev/sda3 /cm#挂载分区到 /cmrootlo

14、calhost /# df -h#挂载后的分区情况文件系统 容量 已用 可用 已用% 挂载点/dev/mapper/VolGroup00-LogVol008.6G 2.8G 5.4G 35% /dev/sda199M12M 82M 13% /boottmpfs/dev/sda3125M5.0G0 125M 0% /dev/shm139M 4.6G 3% /cm7.设置开机自动加载创建加载点:mkdir /cm挂载之后,修改vi /etc/fstab分区表文件,在文件最后加上 /dev/sda3 /cm ext3 defaults 0 0 然后保存,重启即可。(注意:修改分区表如果有误,将导致进不了 linux桌面系统,但这时系统会进入commandline模式,我们可以在commandline模式下对有误的fstab进行修复更改 不过默认情况下这个commandline模式会是Read-Only file system,这意味着你的任何修改操作都是不允许的,但可以通过命令mount / -oremount,rw 来解除这个限制)。

展开阅读全文
相关资源
相关搜索

当前位置:首页 > 建筑/环境 > 建筑资料

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号