昨天想裝centos 6.3在本機上測試,但是在text 模式下安裝卻提示我“you do not have enough ram to install system ……”。我很奇怪,不是text下安裝只要180M的ram就可以了嗎?但是確實是裝不上,我試過將vm的內(nèi)存調(diào)制512M,才能裝。如何強制在低于512M內(nèi)存下安裝呢?google 英文半天,找到了一篇,但是我沒試,英文要修改 Anaconda代碼,Anaconda是redhat,centos的安裝程序,下面重點說下在低內(nèi)存下安裝的方法。
1.從32-bit CentOS LiveCD (CentOS-6.0-i386-LiveCD.iso)啟動,可以根據(jù)自己內(nèi)存選擇是圖形界面還是文本模式
2.以root身份登錄,方便后面的操作,省的每次都要su
3.編輯/usr/sbin/anaconda,在"within_available_memory"下面添加一行代碼:return True,修改后的樣子如下:
"within_available_memory" adding a line "return True" like this:
def within_available_memory(needed_ram):
return True
# kernel binary code estimate that is
# not reported in MemTotal by /proc/meminfo
epsilon = 15360 # 15 MB
return needed_ram (iutil.memInstalled() + epsilon)
4.編輯/usr/lib/anaconda/storage/__init__.py,找到第四個"swapoff",將
"umountFilesystems" from:
for device in devices:
if not device.format.mountable and
(device.format.type != "swap" or swapoff):
continue
修改成
for device in devices:
if not (device.format.mountable and
(device.format.type != "swap" or swapoff)):
continue
5.運行l(wèi)iveinst,這樣安裝的時候就會有swap了,就有足夠的內(nèi)存運行安裝程序了。