VMware虚拟机(linux)增加根目录磁盘空间_第1页
VMware虚拟机(linux)增加根目录磁盘空间_第2页
VMware虚拟机(linux)增加根目录磁盘空间_第3页
VMware虚拟机(linux)增加根目录磁盘空间_第4页
VMware虚拟机(linux)增加根目录磁盘空间_第5页
已阅读5页,还剩4页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

1、VMware虚拟机(linux )增加根目录磁盘空间今天查看学校的监控报修系统,不能访问了! !系统运行很慢,用top命令查看发现内存使用率90%用df -h ”查看“ /”目录使用率已达到 80%导致系统运行很慢。我用 以下方法扩大根目录磁盘空间。一、关闭你的虚拟机系统,找到如下内容:选择 Edit Virtual machesettingsl_p Inmpl 詩 Power on ifiis virtual machine iEdit virtual machine setti门专鼻点击Expand “.Hard Disk (I&E)FloppyI Network AdapterS U5B

2、 Controller Sound Card 凸 Pmte 刨 Dipley40 CBLftinfl file D ; MS 件績像如 u?(“AutodetectBridgedPresentAuto detectPresentAutodetectCapacityCurrent size; &SvEtenn free: 17.4G8MaxifTnurn wize:即 GBDislcinfbnnatjcinDisk 专申ce i$ not pwesllocated fer this hard diHard dtsk contents are stored in mulbple fi-fl nir

3、-Tin ir- Iiimfi iir-tm nkl |:Utilities 彳?扩大虚拟机的空间为40G(根据个人需要填写空间大小)。但是linux下面并不 可见。、使用linux下的fdisk工具进行分区用root用户登录到你的linux系统,查看你系统的分区#fdisk-l会出现以下的信息:DeviceBootStartEndBlocksId System/dev/sda1*16451200083 Linux/dev/sda264261120458496 8e Linux LVMDisk /dev/mapper/vg_zxw-lv_root: 18.8 GB,b

4、ytes255 heads, 63 sectors/track, 2289 cylindersUnits = cylinders of 16065 * 512 = 8225280 bytesSector size (logical/physical): 512 bytes / 512 bytesI/O size (minimum/optimal): 512 bytes / 512 bytesDisk identifier: 0x00000000Disk /dev/mapper/vg_zxw-lv_rootdoesnt contain a valid partition tableDisk /d

5、ev/mapper/vg_zxw-lv_swap: 2113 MB, 2113929216 bytes255 heads, 63 sectors/track, 257 cylindersUnits = cylinders of 16065 * 512 = 8225280 bytesSector size (logical/physical): 512 bytes / 512 bytesI/O size (minimum/optimal): 512 bytes / 512 bytesDisk identifier: 0x00000000Disk /dev/mapper/vg_zxw-lv_swa

6、p doesnt contain a valid partition table根据提示信息可以判断出此系统的磁盘接口为SCSI,对应“ sda”如果上面的红色字体是“hda”,那么此系统的磁盘接口为IDE对应“hda”所以我做一下操作:#fdisk /dev/sda/WARNINGD:OS-compatible modeis deprecated. Its strongly recommendedtoswitch off the mode (command c) and change displayunits tosectors (command u).Command (m for help

7、): m/ “ 列出fdisk 的帮助”Command actionatogglea bootable flagbedit bsd disklabelctogglethe dos compatibility flagddeletea partitionl list known partition typesm print this menunadd a new partitionocreate a new empty DOS partition tablepprint the partition tableqquit without saving changesscreate a new em

8、pty Sun disklabeltchange a partitions system iduchange display/entry unitsv verify the partition tablewwrite table to disk and exitx extra functionality (experts only)Command (m for help): n / ” 命令 n 用于添加新分区 Command actione extendedpprimary partition (1-4)p/ 选择创建主分区 此时,Partition number(1-4): 3 /fdis

9、k 会让你 选择主分区的编号,如果已经有了主分区 sdal, sda2,那么编号就选3,即要创建的该分区为 sda3.First cylinder (2611-3916, default2611):/ 此时,fdisk 又会让你选择该分区的开始值这个就是分区的 Start 值( start cylinder);这里最好直接按回车,Using default value 2611Last cylinder, +cylinders or +sizeK,M,G (2611-3916, default3916):/ 此时, fdisk 又会让你选择该分区的开始值这个就是分区的 End 值这里最好直接按

10、回车,Using default value 3916Comman(dm for help): w/w 保存所有并退出,分区划分完毕 The partition table has been altered!Calling ioctl() to re-read partition table.WARNING: Re-reading the partition table failed with error 16: Device orresource busy.The kernel still uses the old table. The new table will be used atth

11、e next reboot or after you run partprobe(8) or kpartx(8)Syncingdisks.三、 我们的新建分区/dev/sda3,却不是LVM的。所以,接下来使用fdisk将其 改成LVM的。#fdisk /dev/sdaCommand (m for help): mCommand (m for help): t / 改变分区系统 idPartition number (1-4): 3 / 指定分区号Hex code (type L to list codes): 8e /指定要改成的 id 号,8e代表 LVMCommand (m for he

12、lp): w四、重启系统后,登陆系统。(一定要重启系统,否则无法扩充新分区)五、格式化该新添加的分区:#fdisk -lDeviceBootStartEndBlocksIdSystem/dev/sda1*16451200083Linux/dev/sda2642611204584968eLinux LVM/dev/sda32611391610483758e Linux LVM你会发现多了一块分区。#mkfs -t ext3 /dev/sda3 / 在硬盘分区“ /dev/sda3 ”上创建“ ext3 ”文件系统。 此时我们就可以使用该新增分区啦:六、扩充新分区#lvs#pvcreate /de

13、v/sda3 /pvcreate 指令用于将物理硬盘分区初始化为物理卷,以便被LVM使用。要创建物理卷必须首先对硬盘进行分区,并且将硬盘分区的类型设置为“ 8e”后,才能使用pvcreat指令将 分区初始化为物理卷。Physical volume /dev/sda3 successfully created#vgextend VolGroup00 /dev/sda3 (其中是当前需要扩充的 lvm 组名,可以通 过 df -h 查看,例如我的是:/dev/mapper/VolGroup00-LogVol00 ) /vgextend 指令用于动态的扩展卷 组,它通过向卷组中添加物理卷来增加卷组的

14、容量。#vgdisplay/用于显示LNM卷组的元数据信息。- Volume group -VG Namevg_zxwSystem IDlvm2FormatMetadata Sequence No 3VG Accessread/writeVG StatusresizableMAX LV0Cur LV2Open LV2Max PV0Cur PV1Act PV1VG Size19.51 GiBPE Size4.00 MiBTotal PE4994Alloc PE / Size4994 / 19.51 GiBFree PE / Size4994 / 10.01GBVGUUID sqBgTs-iA8x-tCXZ-KYxK-SyWS-TfXQ-uBsL aR( 主要查看 Free PE / Size 4994 / 10.01GB ,说明我们最多可以有 10.01GB 的扩充空间。我一般选择小于 10.01GB)# lvextend -L+9.8G/dev

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论