虚拟机安装linux下面的linux系统怎么宽展内存空间gparted-live-0.8.0-5

linux下使用gparted&live&CD无损扩展分区手记
这几天在红帽下折腾Oracle数据库,结果不小心搞坏了虚拟机,于是重装系统,才发现系统分区时/tmp分区划分过小了,导致Oracle无法正常安装,可是我的虚拟机系统都安装了好久,不能再删除重装吧,太浪费时间和精力了,那么问题来了:能不能像在windows下一样对分区进行无损扩展呢?答案是肯定的。
有了想法,那么立即实施吧!百度之,发现大家一致推荐gparted live
CD,设置BIOS光驱启动,嗯?无法从虚拟机光驱启动?第一关就难到我了,我会认输?NO!休息一天之后接着研究原因,发现启动项设置并没有设置CDROM到第一位,“+”“-”改变启动优先级只能用“-”,就这个小细节导致无法启动gparted使问题卡在这里一天时间无法解决。
启动成功后,顺利进入gparted界面,研究了相关资料后,终于搞明白这个增加分区原来是要先把增加的磁盘空间分配给extend分区,右键resize/move然后从最后一个分区整体往后面拉(整体拉不改变分区打小,否则会改变),该分区之前会出现未分配空间,依次移动(从最后一个分区依次向前移动),直到未分配空间到达要扩展的分区之后,再把该分区扩展到想要的大小即可,最后点击apply开始分区,耐心等待直到完成。我这里扩展10G,实际只给两个分区扩展(/tmp、/usr),其他基本保持不变,并没有将10G用完,留待下次扩展使用,嘿嘿。
已投稿到:
以上网友发言只代表其个人观点,不代表新浪网的观点或立场。screenshots
A Live CD Linux distribution built around the GParted hard/solid disk drive partitioning software
GParted LiveCD is a Live Linux operating system built around the GNOME
Partition Editor (popularly known as GParted) software, which can be
used for disk partitioning tasks. The GParted application is
successfully used in many Linux distributions to efficiently partition
hard disk drives, solid disk drives and USB flash disks. It allows users
to resize, move and copy partitions without losing any data.
Distributed as a Live CD
GParted LiveCD
Linux operating system is distributed as a Live CD ISO
supporting the 64-bit and 32-bit (i486 and i686-PAE)
architectures. It
is our number one choice for disk partitioning tasks,
no matter the
operating system you are currently using on your PC or
Live CD&boot options
Live CD presents a GRUB-based boot menu that allows you to start the
GParted LiveCD Linux operating system with the default settings (this is
the recommended option for most users), boot the operating system that
is currently installed on the computer&s hard disk drive, and test the
machine&s physical memory. There&s also an option for advanced
users who want to copy the entire live environment to RAM and eject the
boot media, and one for those of you who encounter graphical issues with
the default option.
How the Live CD works
Hitting Enter on the default selection will
start the live environment, during which you will be able to select a
different keymap (this is mostly useful for non-USB keyboards), as well
as to select your preferred language (English is the default option). Finally,
you will be able to choose if you want to start the X Window System and
use the GParted LiveCD in graphical mode (this is the default option),
override the display settings, or drop to a shell prompt.
Uses the Fluxbox window manager
choose the default option, you will immediately see a minimalistic
desktop environment powered by the lightweight Fluxbox window manager
and the GParted application. On the desktop you will find a small
and fast web browser called NetSurf, a screenshot utility, a Linux
terminal, as well as two utilities, one for changing the screen
resolution and another one for configuring the network.
Helps you to shrink Microsoft Windows C: partitions
Windows users can use GNOME Partition Editor to easily shrink or grow
their C: drive, in order to create space for new operating systems. In
addition, it can be used to rescue data from lost partitions.
New in GParted LiveCD 0.29.0-1:
Includes GParted 0.29.0 which adds the following enhancements since the last stable release:
Add support for UDF file system
Fix segmentation fault on disk with corrupted FAT file system
& GParted LiveCD was reviewed by
User comments
& runs on:Linux
& category:ROOT \
& developer:
& homepage:
&&&Like202K
&&&Follow13K拒绝访问 |
| 百度云加速
请打开cookies.
此网站 () 的管理员禁止了您的访问。原因是您的访问包含了非浏览器特征(3a71a0efd38843d7-ua98).
重新安装浏览器,或使用别的浏览器GParted Live 0.21.0-1 发布_Linux新闻_Linux公社-Linux系统门户网站
你好,游客
GParted Live 0.21.0-1 发布
来源:Linux社区&
作者:Linux
GParted Live 0.21.0-1 发布,此版本是最新的稳定版本,包括 GParted 0.21.0,修复了 GParted 的内部块复制算法的 off-by-one sector 错误;移除了不必要的分区缩放时候的重复 actions。值得关注的项有:基于 Debian's 'Sid' repository as of ;使用 i586 替换 i486 live 镜像;RAM 最低要求提高到 256。GParted Live 支持 VirtualBox, VMware, BIOS, UEFI 和&AMD/ATI, NVIDIA 以及 Intel 图形化物理计算机。 更多更新内容请看。 () : (223MB, ),
GParted (Gnome Partition Editor)是一种非常小巧自启动运行光盘,采用X.org,轻量级的Fluxbox窗口管理器,以及最新的2.6 Linux内核建构。其中包含的GParted硬盘分区工具,作为系统维护盘非常有用。
相关阅读:
VMware虚拟机中调整Linux分区大小&&使用GParted
用GParted合并分区
使用GParted和acronis进行Linux分区和NTFS分区无损调整
GParted:急救你的硬盘数据
GParted 的详细介绍:GParted 的下载地址:
本文永久更新链接地址:
相关资讯 & & &
& (08/09/:08)
& (03/24/:02)
& (10/26/:41)
& (05/27/:27)
& (12/23/:11)
& (10/04/:14)
   同意评论声明
   发表
尊重网上道德,遵守中华人民共和国的各项有关法律法规
承担一切因您的行为而直接或间接导致的民事或刑事法律责任
本站管理人员有权保留或删除其管辖留言中的任意内容
本站有权在网站内转载或引用您的评论
参与本评论即表明您已经阅读并接受上述条款1315人阅读
centos(7)
linux(25)
利用vmware安装centos6.4时,发现虚拟机的linux存储容量不够,则增加10G的空间给linux,可是这样并不能解决linux中分区大小,需要配置。查看分区占用情况,发现/dev/sda2挂载的根分区占用最多,软件全部安装在该分区中。/dev/sda1 及swap分区情况正常。我们分区扩大sda2的分区大小
[root@localhost ~]# fdisk -l
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
Disk /dev/sda: 5368 MB,
255 heads, 63 sectors/track, 652 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
&& Device Boot&&& Start&&&&&& End&&& Blocks&& Id System
/dev/sda1&& *&&&&&&&& 1&&&&&&& 25&&& 200781&& 83 Linux
/dev/sda2&&&&&&&&&&& 26&&&&&& 620&& ; 83 Linux
/dev/sda3&&&&&&&&&& 621&&&&&& 652&&& 257040&& 82 Linux swap
sda1挂载/boot 分区 200 M,sda2挂载 / 分区 剩余所有,sda3 为swap分区 100M
[root@localhost ~]# df -l
文件系统    1K-块&&&&&&& 已用&&&&&&&& 可用&&&&&&&&&& 已用%&& 挂载点
/dev/sda2&&&&&&&&&&&&& 4704236&&& 4374939&&& 329297&&&&&&& 93%&&&&&&& /&
/dev/sda1&&&&&&&&&&&&& 194443&&&&& 9377&&&&&&& 175027&&&&&&& 6%&&&&&&&&& /boot
none&&&&&&&&&&&&&&&&&&&& 95336&&&&&&& 0&&&&&&&&&&&&& 95336&&&&&&&&& 0%&&&&&&&& /dev/shm
&&&&&&&& 如果重装系统,可以重新划分虚拟硬盘空间和分区,但系统很多东西要重新设置,有些软件也要重新安装和设置,比较麻烦。不选择重装,于是在网上搜索资料,看能不能扩充虚拟硬盘容量并调整Linux分区大小,最好是不改变现有分区结构,只将扩充的虚拟硬盘空间加大到sda2分区上。
&&&&&&&&& 首先是扩充虚拟硬盘容量,这个问题找到了解决方法。在VMware中有一个工具,专门用来管理虚拟硬盘,不过得在命令行中运行。在VMware安装目录下有这个程序vmware-vdiskmanager.exe 。win+R 打开cmd窗口 cd d:\vmware (我的VMware安装在 D:\vmware目录中) 运行vmware-vdiskmanager 出来以下界面
&& 下面是命令帮助信息。可以看到如果要扩充虚拟硬盘空间,可以用参数 -x ( -x &new-capacity&&&& : expand the disk to the specified capacity) 它也有使用举例 : ex 4: vmware-vdiskmanager.exe -x 36Gb myDisk.vmdk 意思是将 myDisk.vmdk (虚拟机存放目录中的虚拟硬盘文件) 容量扩充至36Gb 。按照此信息,将我的虚拟硬盘文件 E:\Red Hat Linux\Red Hat Linux.vmdk&扩充至10Gb
吧。键入命令D:\vmware&vmware-vdiskmanager -x 10Gb &E:\Red Hat Linux\Red Hat Linux.vmdk& 。出现错误:
原因是没有关闭虚拟机正在运行的Linux系统,init 0 关闭它再来。D:\vmware&vmware-vdiskmanager -x 10Gb &E:\Red Hat Linux\Red Hat Linux.vmdk& ,好!此时开始执行
等到100% 后,成功
到这里第一个问题(扩充虚拟硬盘容量)解决了。
或者也可以通过虚拟机的
扩容选项来扩容。
& & & &接下来第二个问题,如何将扩充进来的空余空间,加到sda2上。
&&&&&&&&&&& 网上有很多方法都是说,将空余空间划分成第四个主分区sda4,格式化成ext3,然后挂载到 / 目录下,毕竟是根目录占用了93%的硬盘空间,想来有道理,动手~~~
我们先启动Linux系统来fdisk -l 看一下
root@localhost ~]# fdisk -l
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
Disk /dev/sda: 10.7 GB,
255 heads, 63 sectors/track, 1305 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
&& Device Boot&&& Start&&&&&& End&&& Blocks&& Id System
/dev/sda1&& *&&&&&&&& 1&&&&&&& 25&&& 200781&& 83 Linux
/dev/sda2&&&&&&&&&&& 26&&&&&& 620&& ; 83 Linux
/dev/sda3&&&&&&&&&& 621&&&&&& 652&&& 257040&& 82 Linux swap
可以看到硬盘空间确实已经增大了,但没有出现在我们的分区列表中。df 查看也和原来一样
[root@localhost ~]# df -l
文件系统    1K-块&&&&&&& 已用&&&&&&&& 可用&&&&&&&&&& 已用%&& 挂载点
/dev/sda2&&&&&&&&&&&&& 4704236&&& 4374939&&& 329297&&&&&&& 93%&&&&&&& /&
/dev/sda1&&&&&&&&&&&&& 194443&&&&& 9377&&&&&&& 175027&&&&&&& 6%&&&&&&&&& /boot
none&&&&&&&&&&&&&&&&&&&& 95336&&&&&&& 0&&&&&&&&&&&&& 95336&&&&&&&&& 0%&&&&&&&& /dev/shm
那么我们就把这个空余空间用起来吧—— fdisk命令在/dev/sda(第一块scsi硬盘) 上&& n 新加一个分区
[root@localhost ~]# fdisk /dev/sda
The number of cylinders for this disk is set to 1305.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups 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): m&&&&&&&按m或输入 help 获取参数帮助
Command action
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)
Command (m for help):n&&&&&&&&&&选择 n 添加一个新分区
Command action
&& e&& extended
&& p&& primary partition (1-4)&&&&&&&&选择p 创建主分区,e为创建逻辑分区
Selected partition 4
First cylinder (653-1305, default 653):&&&&&&&&&&&&&&&不作输入按系统默认大小去分配
Using default value 653
Last cylinder or +size or +sizeM or +sizeK (653-1305, default 1305):&&&&&&&不作输入按系统默认大小去分配&
Using default value 1305
Command (m for help):w
The partition table has been altered!
Calling ioctl() to re-read partition table.
WARNING: Re-reading the partition table failed with error 16: \x{8BBE}\x{5907}\x{6216}\x{8D44}\x{6E90}\x{5FD9}.
The kernel still uses the old table.
The new table will be used at the next reboot.&
Syncing disks.
w保存并退出,将空余空间全部划分给了一个新分区 sda4,The kernel still uses the old table.
The new table will be used at the next reboot.&&&好吧,重启后再来 reboot 。或者通过查看cat /proc/partitions查看分区情况,通过命令
解决方法:执行下partprobe&命令
&&&&&&&partprobe包含在parted的rpm软件包中。partprobe可以修改kernel中分区表,使kernel重新读取分区表。&因此,使用该命令就可以创建分区并且在不重新启动机器的情况下系统能够识别这些分区。
查看是否安装该命令:
[root@db1 dev]# rpm -q parted
parted-1.8.1-23.el5
我们执行一下该命令:
[root@db1 dev]#&partprobe
Warning: Unable to open /dev/hdc read-write (Read-only file system).&&/dev/hdc has been opened read-only.
/dev/sda4出来了,但还没有格式化,也没有挂载到目录上面去。接下来就将它格式化成ext3,并挂载到 根目录(/)下去。
格式化成ext3 命令 mkfs.ext3 /dev/sda4
[root@localhost~]# mkfs.ext4 /dev/sda4
mke2fs 1.32 (09-Nov-2002)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
656000 inodes, 1311305 blocks
65565 blocks (5.00%) reserved for the super user
First data block=0
41 block groups
32768 blocks per group, 32768 fragments per group
16000 inodes per group
Superblock backups stored on blocks:
&&&&&&& 3, , 4736
Writing inode tables: done
Creating journal (8192 blocks): done
Writing superblocks and filesystem accounting information: done
This filesystem will be automatically checked every 37 mounts or
180 days, whichever comes first. Use tune2fs -c or -i to override.
挂载到根目录命令:mount /dev/sda4&& /&&&&&&&& 命令执行完,成功则没有任何提示,我们df 看一下
[root@localhost ~]# df -l
文件系统    1K-块&&&&&&& 已用&&&&&&&& 可用&&&&&&&&&& 已用%&& 挂载点
/dev/sda2&&&&&&&&&&&&& 4704236&&& 4374939&&& 329297&&&&&&& 93%&&&&&&& /&
/dev/sda1&&&&&&&&&&&&& 194443&&&&& 9377&&&&&&& 175027&&&&&&& 6%&&&&&&&&& /boot
none&&&&&&&&&&&&&&&&&&&& 95336&&&&&&& 0&&&&&&&&&&&&& 95336&&&&&&&&& 0%&&&&&&&& /dev/shm
/dev/sda4&&&&&&&&&&&&& 4704236&&& 4374939&&& 329297&&&&&&& 93%&&&&&&& /&
&&&&&&&&&& 成了这个样子,看来这方法并不行,怎么新挂上去的分区也被占用了93%。这里没懂是怎么回事。没有达到我想要的效果,这个问题用这个方法解决不了,怎么办呢?歇会儿,再去百度&Google逛逛。
&&&&&&&&&& 恩,据CSDN有位仁兄说,Linux有这么个命令 parted ,可以来调整分区,不过很麻烦,全部是命令操作,还要自己计算好调整分区的起始和结束位置,技术含量太高,偶不会了,只会搞些简单的。
&&&&&&&&& 继续找ing ~~,又找到这么个方法,有个软件可以像Windows中的partitionmagic一样操作Linux分区,名叫gparted ,和parted命令有些相似,是不是有些根源?赶快去网上找找,在它的官网下载了这个软件,最新版滴,liveCD版的ISO文件,加载在光驱中启动去操作分区。init 6 重启 ,加载ISO文件,设置虚拟机BIOS从光驱启动………………&&
一路默认选项。
可以查看分区选项,通过resize来调整分区。
嘿嘿,还可以,行了,所有调整好后,最后Apply,等待它去执行吧!等待
完成后,再重启,进入Linux系统,用fdisk -l 和df 命令查看,哈哈,OK了
[root@localhost ~]# fdisk -l
Disk /dev/sda: 10.7 GB,
255 heads, 63 sectors/track, 1305 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
&& Device Boot&&& Start&&&&&& End&&& Blocks&& Id System
/dev/sda1&& *&&&&&&&& 1&&&&&&& 25&&& 200781&& 83 Linux
/dev/sda2&&&&&&&&&&& 26&&&&& 7+ 83 Linux
/dev/sda3&&&&&&&&& 1273&&&&& 1305&&& ; 82 Linux swap
[root@localhost ~]# df
文件系统    1K-块&&&&&&& 已用&&&&&&&& 可用&&&&&&&&&& 已用%&& 挂载点
/dev/sda2&&&&&&&&&&&&& 9860296&& 2024280&&& 7435356&&&& 22%&&&&&& /&
/dev/sda1&&&&&&&&&&&&& 194443&&&&& 9377&&&&&&&& 175027&&&&&& 6%&&&&&&& /boot
none&&&&&&&&&&&&&&&&&&&& 95336&&&&&& 0&&&&&&&&&&&&& 95336&&&&&&& 0%&&&&&&& /dev/shm
&至此问题已经解决。
&&相关文章推荐
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
访问:101895次
积分:1650
积分:1650
排名:千里之外
原创:49篇
转载:101篇
(1)(1)(1)(1)(1)(1)(3)(3)(2)(6)(10)(2)(9)(7)(1)(9)(6)(3)(2)(1)(2)(2)(1)(2)(2)(1)(7)(17)(11)(10)(6)(8)(7)(4)
(window.slotbydup = window.slotbydup || []).push({
id: '4740881',
container: s,
size: '200,200',
display: 'inlay-fix'

我要回帖

更多关于 linux虚拟机内存 的文章

 

随机推荐